parent::postDispatch($request) inside your extended class?
FWIW: postDispatch() of the plugin is where the Layout component determines
whether or not to initiate the final step in this "two-step" layout process
with respect to the controller dispatch cycle. So if you are gonna extend
this class, you MUST call postDispatch() or offer similar functionality as
to what that method actually does.
The bigger question is: Why? Unless you are altering the way Zend_Layout's
controller plugin does its job, its just as easy to create your own plugin
that would run before the Layout Plugin and register it with the Controller
Plugin broker.
In my experience, there are very few use cases to actually extend this
component's class.
-ralph
On 3/7/09 9:34 AM, "Cristian Bichis" <contact@zftutorials.com> wrote:
> Hello,
>
> I was using a Zend_Layout_Controller_Plugin_Layout based class as layout
> plugin.
>
> I was experiencing one weird problem when running classes derived from this,
> for postDispatch
>
> public function postDispatch(Zend_Controller_Request_Abstract $request)
> {
> //my own code
> }
>
>
> In case is not called
>
> parent::postDispatch($request);
>
> then Zend_Layout seems to be disabled automatically, so is rendered only the
> view.
>
> This is the expected behavior ? I didn't posted to Issue tracker yet an issue,
> might be my fault...
--
Ralph Schindler
Software Engineer | ralph.schindler@zend.com
Zend Framework | http://framework.zend.com/
没有评论:
发表评论