Some help.. - 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: Some help.. (/showthread.php?tid=6773) |
Some help.. - El Forum - 03-12-2008 [eluser]adamp1[/eluser] Its a problem from the first route, because you used regex its catching the call to blog and sending it to main/blog As said you cant use full regex since it means you can only have one controller. So you need the following Code: $route['lists/(d+)'] = 'main/lists/$1'; Some help.. - El Forum - 03-12-2008 [eluser]xwero[/eluser] The last rout i gave you should be as low as possible in the routes configuration file because it's a very greedy match. There are a few options where you don't need to fill you routes configuration with all controllers you add, but if you only have a few controllers you can do Code: $route['(blog|admin)'] = '$1'; Code: $route['(lists|method2ofmain)'] = 'main/$1'; Some help.. - El Forum - 03-12-2008 [eluser]zilverdistel[/eluser] Great it works, but I have another suggestion for serving up static pages. I'd make a controller page.php Code: class Page extends Controller { then in your view folder, you can make all the static pages you want. if you make Page your default controller, you're set. Some help.. - El Forum - 10-10-2008 [eluser]oriceon[/eluser] And if i say that i receive Page Not Found? I created this page.php into controller then into view i created html_start end and a about.php page. I made change in default controller then i acces http://localhost/CodeIgniter/about.html What is wrong? Some help.. - El Forum - 10-14-2008 [eluser]oriceon[/eluser] I solved the problem. 1. Into routes.php i added: $route['default_controller'] = "statice"; $route['scaffolding_trigger'] = ""; $route['([a-z]+)'] = 'statice/index/$1'; 2. Into controllers i made a controller named statice.php then i have that code Code: class Statice extends Controller { Then into views i have pages: despre.php , statice.php and so on ... then if i load: http://localhost/codeigniter/ it`s load default page: statice.php from view else if i try http://localhost/codeigniter/despre.html it`s load despre.php so that i need! Some help.. - El Forum - 10-14-2008 [eluser]Shahgeb[/eluser] try to understand segment of codeignitor userguide there is first segment is controller after project name and than comes function name so you must mention controller name like Blog/list hopes you want and work |