[Solar-talk] Re: [Solar-svn] Revision 3037 (a.k.a page black-list)
Antti Holvikari
anttih at gmail.com
Mon Mar 24 13:55:21 CDT 2008
On Mon, Mar 24, 2008 at 8:41 PM, Jeff Surgeson <solar at 3hex.com> wrote:
> > This is not quite the way it works, unrecognized requests invoke
> > _notFound() no matter what.
> >
> > In my humble opinion in a production environment if a controller or action
> > is not found, forwarding to the default controller and default action is
> > preferable to a error page. I accept that in the event of no default
> > controller and action it needs to forward it to a error page.
>
> >> Just to be clear, are you talking about page controller's _notFound()
> >> or front controller's _notFound()?
>
> page controllers not so? eg Vendor_App_User is my page controller class, my
> front controller is solar_controller_front. This has a _notFound() which
> displays a simple 404 not found page, which can and is overridden in my
> Vendor_App_Base with its own _notFound() which forwards to error page.
>
>
> >> My bet is that the _notFound() is invoked in your page class and not
> >> in the front-controller. And this is the way it is supposed to.
> >> Hope I'm not missing anything here.
>
> More likely me to be missing something :-(
>
> So you are saying if my default (as setup in solar.config) is "user" and my
> only page controller class is Vendor_App_User, with a _action_default of
> list, and with only one action named actionList and I request
> nonexistantclass/listall it will default to user/listall, it will find the
> user class but wont find action listall so will run _notFound() instead of
> running user/list?
if you request "nonexistantclass/listall" it will call your default
page controller with params "nonexistantclass/listall". The page
controller will then try to find "nonexistantclass" action, and when
it is not found _notFound() will be called.
> Why bother to define a default page controller class in config, and specify a
> default action in that class if it is not used when the requested
> controller/action is not found?
It will be used when there is no app and/or action requested. But for
situations where you request non-found apps or actions, it makes more
sense to display an error page than to just go with the defaults. I
think many were requesting this feature.
Does that sound reasonable?
--
Antti Holvikari <http://anttih.com>
More information about the Solar-talk
mailing list