CodeIgniter Forums
Controller with name 'list' - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Controller with name 'list' (/showthread.php?tid=13623)



Controller with name 'list' - El Forum - 11-30-2008

[eluser]freshface[/eluser]
I want to create a controller with the name 'list' is it possible (and how) to override the reserved php keyword to use it.
Or could I solve it with routes? And how.

Thx


Controller with name 'list' - El Forum - 11-30-2008

[eluser]Colin Williams[/eluser]
Code:
$route['list'] = 'my_list';
$route['list/(.+)'] = "my_list/$1";



Controller with name 'list' - El Forum - 11-30-2008

[eluser]kevinprince[/eluser]
Definitely solve it with routes, you really dont want to be going around overwriting PHP core functionality because its likely to cause you issues down the road.


Controller with name 'list' - El Forum - 11-30-2008

[eluser]Colin Williams[/eluser]
List is an odd controller name, anyway. Pretty generic.