• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wildcard routing in 3.x


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)



Here is a link to assist you: https://www.codeigniter.com/user_guide/g...uting.html

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

Look at the login route example.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

Users browsing this thread:
1 Guest(s)

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2018 MyBB Group.