i just found a solution to your problem, maybe it has to do with the action
stack (do you use it?).
Additionally to setting the dispatched state to false in the preDispatch
method, try to set the state to true in the postDispatch method. This works
for me. Maybe the action stack tries to run the action on and on if it's
dispatched state is false.
dinok wrote:
>
> Thanks..
> but I can't get it working:
> public function preDispatch(Zend_Controller_Request_Abstract $request)
> {
> echo "here";
> $request->setDispatched(true);
> }
>
> Nothing happens with the parameters true and false.
> With true, the normal aciton is display. With false, i get a never ending
> loop of "here"
> Where is the mistake?
>
> Best regards
>
>
> Matthew Weier O'Phinney-3 wrote:
>>
>> -- dinok <dino.knoll@gmx.de> wrote
>> (on Monday, 11 August 2008, 12:03 PM -0700):
>>> I am currently thinking of the problem, how to cache view scripts of
>>> actions
>>> without the layout.
>>> The reason is very simple:
>>> I have a dynamic pagelayout with elements like username, custom rights
>>> and
>>> so on.
>>> But the content is the same, just think of rendering an article. There I
>>> have a hudge object which I have to render. There is a partial-loop,
>>> formatting the tags, maybe bbcode, formating a locale date..
>>>
>>> A possibility is to extend the Zend_Controller_Action and rewrite the
>>> dispatch method.
>>> Then I check if a response segment can be loaded from cache, when it's
>>> possible, I skip the dispatch process of the action and simply push the
>>> response in the response object.
>>>
>>> Do you have any other ideas?
>>
>> Use a front controller plugin. On preDispatch(), check to see if the
>> currently selected action has been cached, and if so, push the cache
>> contents to the response object and unset the request object's
>> dispatched flag.
>>
>> --
>> Matthew Weier O'Phinney
>> Software Architect | matthew@zend.com
>> Zend Framework | http://framework.zend.com/
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Zend_Cache-of-action-views%2C-not-the-layout-tp18931589p20333335.html
Sent from the Zend Core mailing list archive at Nabble.com.
没有评论:
发表评论