views:

29

answers:

1

I have a layout 'profile'

<div>
    <div> $this->action(action1, controller1, module1)<div>
    <div> $this->layout()->content </div>
    <div> $this->action(someotheraction, soController,soModule );
</div

And the problem starts when I want to get the $request->Params() from the action1 , controller1 module1 , it is empty. I looked at the code of a helper Action , it does accept as a 4th parameter Params, but then I will have to set it somewhere in the layout - which is not good. Basically what are the recommendations of guru people that are pretty professional with zend Framework. Maybe I should do some work around or should change the concept of how I am injecting additional Controller(module) actions

A: 

If you want to get the current Request object in the View, you can either inject it to the View from the controller or get it from the Front Controller via

$request = Zend_Controller_Front::getInstance()->getRequest();

The above is how the Action helper gets it itself.

Any argument, including $params, set to the action method of Action Helper will be set to the current Request object before it is dispatched. The Request will go through the entire dispatch cycle again, which is slow and why the Action Helper is generally avoided. The Action Helper will return (but not output) the body of the Response.

Not sure if that answers your question though.

Gordon
Well , YES you have answered my question, Especially by providing the link , which lead me to the thought that using the Action Helper is not really good idea for certain means =)
simple