Hi, thank you for your reply, however I've already fixed my problem. Anyway, the point of the problem was how to get the action helper object in a layout script that is NOT related to a controller action, bacause what you said is ok when I have an action controller where to assign the object to the view.
But where to assign data returned by an action helper to the view for script like header.phtml or menu.phtml? I solved using My_Controller_Action that extends Zend_Controller_Action and make there all the assignment to the view. What do you think about this solution? And I have another question: it is possible from an action helper do assignment to the view? Bye Sergio Rinaudo > Date: Fri, 22 May 2009 12:03:06 -0700 > From: [email protected] > To: [email protected] > Subject: Re: [fw-general] Get an action helper object within a layout view > script. > > > > > Razorblade wrote: > > > > > > Hi, > > I need to get the returned object from an action helper, within a layout > > view script. > > How to get the helper object and use it? > > Thanks > > > > Sergio Rinaudo > > > > > > to pass data from action itself to the view or in your case to a layout > (which is similar to a view), you could pass the var to the view like this: > $this->view->myvar = $myvar; > > the content of your $myvar can be an object, if its the case you could use > it like this in your view or layout: > > echo $this->escape($this->myvar->myoption); > > in your action helper you do something and after its done you probably want > to return some data to the action: > > return $myData; > > then could call the helper in your action like this: > > $myHelperData = $this->_helper->myhelperxy($myParam); > > then as i said you pass the data to the view or layout, see above ... > > a good article about action helpers can be found here: > > http://devzone.zend.com/article/3350 > > > > -- > View this message in context: > http://www.nabble.com/Get-an-action-helper-object-within-a-layout-view-script.-tp23653470p23676276.html > Sent from the Zend Framework mailing list archive at Nabble.com. > Quali sono le parole più cliccate? Scopri la top! _________________________________________________________________ Più di 30 stazioni. Ascolta la Radio su Messenger! http://messenger.it/radioMessenger.aspx
