Welcome Guest, Not a member yet? Register   Sign In
Wildcard routing in 3.x
#1

Hi,

I'm currently upgrading on of my site from CI 2 to 3. One of the controllers I had to give another name because of reserved php names. In my config/route.php I had set up these routes:

PHP Code:
$route['list/new'] = "lijst/mynew";
$route['list/all'] = "lijst/all";
$route['list/country'] = "lijst/country";

$route['list/new/:any'] = "lijst/mynew";
$route['list/all/:any'] = "lijst/all";
$route['list/country/:any'] = "lijst/country"

The 'lijst' controller has a lot of  different arguments passed as searchengine-friendly arguments, like list/all/g/f/a/16/start/0/limit/15/ .

i guess behaviour of the wildcard in CI 3.x has changed, in 2 it worked for me. Is there a possibility to have this done in CI? The passed arguments are finite, but it would take a whole bunch of routes to configure (and it's error-prone)

Regards,

Frank
Reply
#2

@Keiichi
Here is a link to assist you: https://www.codeigniter.com/user_guide/g...uting.html
Reply
#3

More specifically the regular expressions section: https://www.codeigniter.com/user_guide/g...xpressions

Look at the login route example.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB