Welcome Guest, Not a member yet? Register   Sign In
Order resource route in routes.php
#3

To clarify and wonder.

Try the following situation.

PHP Code:
/**
 * --------------------------------------------------------------------
 * Route Definitions
 * --------------------------------------------------------------------
 */

// We get a performance increase by specifying the default
// route since we don't have to scan directories.
$routes->add('/''Begin::index');

//  resource
$routes->resource('test');
$routes->resource('test2', ['namespace' => 'App\Controllers\Admin']);

//  Static visitor
$routes->add('a''Begin::a');
$routes->add('b''Begin::b');
$routes->add('c''Begin::c');

//  Dynamic visitor
$routes->add('(:any)''Begin::i/$1');
$routes->add('(:any)/(:any)''Begin::i2/$1/$2'); 

1) The recources are loaded after the wildcards
The order above is clearly before
How to change this?

2) The Uri /admin/test/i  will not work because of the wildcards.
( The controller is there and works with no wild card present. )

Only the wild cards only cover 2 segments not 3.
In Codeigniter 3 this works, but not in Codeigniter 4?

3) Adding slashes didn't change anything.
The adding of leading slashes is even discouraged when reading a couple forum threads.

So even more questions or are these bugs?

Greetings,
Ubel Jan van Wijhe
Reply


Messages In This Thread
Order resource route in routes.php - by ubeljan - 07-14-2018, 01:52 AM
RE: Order resource route in routes.php - by ubeljan - 07-15-2018, 01:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB