Custom CMS and (:any) Route Predicament - 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: Custom CMS and (:any) Route Predicament (/showthread.php?tid=35313) |
Custom CMS and (:any) Route Predicament - El Forum - 10-25-2010 [eluser]Vheissu[/eluser] My CMS is nearing completion (functionality wise) and although it currently works I have a few issues. My setup: * Codeigniter 2.0 (latest version) * Modular Extensions (latest version) * PHP 5.3.0 I have a module called pages with a pages controller that contains a _remap remap function and in my routes.php I have the following code: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); So if I have an auth module and go /auth/login - I find that the (:any) is routing this to my pages controller _remap function and not actually calling the module controller, this also seems to be the case for controllers in the root application controllers directory, is there a better way? I tried using 404_override in my routes file instead of (:any) but it didn't seem to work. Is there a way to check if a controller / module exists first before loading up a page? And also, how would I handle pages with the same name as modules and controllers in my application? Appending /page/page-name to the URL would probably be a fix, but I want them to just be /page-name instead. Custom CMS and (:any) Route Predicament - El Forum - 10-25-2010 [eluser]wiredesignz[/eluser] Modular Extensions uses $route['404'] at the current time. I will be updating it soon to use the CI2.0 $route['404_override'] instead. Custom CMS and (:any) Route Predicament - El Forum - 10-26-2010 [eluser]Vheissu[/eluser] [quote author="wiredesignz" date="1288090734"]Modular Extensions uses $route['404'] at the current time. I will be updating it soon to use the CI2.0 $route['404_override'] instead.[/quote] Ah, thank you so much. I just took a look at PyroCMS code and noticed that it was using just 404 too. It now works and does all of the checking for real modules / controllers first as a 404 redirect would. My question stands however of how do I have page names that share the same name as a controller / module. Will it always access the page first or the module / controller? Custom CMS and (:any) Route Predicament - El Forum - 10-26-2010 [eluser]Phil Sturgeon[/eluser] [quote author="Vheissu" date="1288090831"]My question stands however of how do I have page names that share the same name as a controller / module. Will it always access the page first or the module / controller?[/quote] What do you mean by that? The 404 route will work just like any other Controller and/or Method call. Set the title however you normally would. |