[Solar-talk] 404 Not found and handling of non-existing
controllers/action
Rick
rick at gibbed.us
Fri Nov 23 18:35:29 CST 2007
I complained about this on the IRC channel many months ago and made the
necessary changes to my front
controller (with the assistance of people there) for this, you can find my
changes at
http://www.privatepaste.com/c60Eu0Zoh6
I remember something about getting this submitted back to be merged in, but
that never happened.
Hope this helps,
Rick.
On 11/23/07, Rodrigo Moraes <rodrigo.moraes at gmail.com> wrote:
>
> On Nov 23, 2007 12:31 PM, Adrian Videnie wrote:
> > Let me know what you think!
>
> I was wondering why isn't the front controller like that. Here I made
> a quick implementation for the idea, naming the second falback
> 'error_handler_controller' ( a terrible name :). That controller is
> used as a fallback when: a) it is defined and b) the requested page is
> not empty. Otherwise, the configured 'default' is used. Here we go:
>
> // take the page name off the top of the path and try to get a
> // controller class from it.
> $page = array_shift($uri->path);
> $class = $this->_getPageClass($page);
>
> // did we get a class from it?
> if (! $class) {
> // put the original segment back on top.
> array_unshift($uri->path, $page);
>
> if (empty($page) ||
> !$this->_config['error_handler_controller']) {
> // try to get a controller class from the default page
> name
> $class = $this->_getPageClass($this->_default);
> } else {
> // try to get a controller class for the non-empty page
> name
> // (usually, a error handler app)
> $class =
> $this->_getPageClass($this->_config['error_handler_controller']);
> }
> }
>
> So... it seems a good idea to to define a controller to handle wrong
> requests. Specially because, currently, we have to make the default
> app take care of bad requests too... Are we missing something that
> would make this a bad idea?
>
> -- rodrigo
> _______________________________________________
> Solar-talk mailing list
> Solar-talk at lists.solarphp.com
> http://mailman-mail3.webfaction.com/listinfo/solar-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman-mail3.webfaction.com/pipermail/solar-talk/attachments/20071123/3886b6b8/attachment.html
More information about the Solar-talk
mailing list