2008年8月7日星期四

Re: [fw-mvc] Prevent action from being executed

-- Greg Freeman <greg@imagize.com.au> wrote
(on Thursday, 07 August 2008, 04:49 PM -0700):
> How do you prevent an action from being called directly? I have an action
> that is used to render a menu response segment for the layout. I don't want
> people to be able to call it directly via a URL.

Honestly, I'd recommend creating a view helper that queries the model
and prepares the content instead of using action(). action() is
expensive in terms of processing, and leads to issues just like the one
you're experiencing. :)

--
Matthew Weier O'Phinney
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/

没有评论: