[eluser]darkhouse[/eluser]
I love this system. It's made my app quite powerful and flexible. I've integrated the modules into a new CMS we're developing. Thank you for providing it.
However, I had a problem where I had a uri '/students/gallery' that was trying to load the gallery module I have (modules/gallery/controllers/gallery) instead of loading the page that the gallery module is used on. The reason is because there is no physical students/gallery page, instead these are slugs in a database, so the router didn't find the page, but did find the module and broke my page.
I solved this by removing the first line in the _validate_request function in the extended router class:
Code:
public function _validate_request($segments) {
/* locate module controller */
//if ($located = $this->locate($segments)) return $located; <-- this line
/* use a default 404 controller */
if (isset($this->routes['404']) AND $segments = explode('/', $this->routes['404'])) {
if ($located = $this->locate($segments)) return $located;
}
/* no controller found */
//my custom code to load the cms system goes here, instead of showing a 404 error
}
Now everything is working as it should. I just want to confirm that this line is only there so that under normal circumstances, if a physical controller is not found, it will look for a module using that uri, and that by removing it, all I'm losing is the ability to use the uri to load a module. Is that correct?
Thanks!