Nogyara wrote:
>
> Hi guys,
> just a quick question, how can someone set parameters for view helper's
> constructor?
>
> It seems, it is possible, according to this post
> (http://www.nabble.com/Set-View-Helper-Options-%28formTextarea%29-tf4475302s16154.html#a12760567)
> but I can't figure out how, when view helper's main method is called
> directly from view script, without any constructing of helper itself.
> Any clues, pls?
>
Hi, you can create Helper's instance in required action and then assign it
to the view, e.g.:
function myAction() {
$helper = new MyHelper('firstArg', 'secondArg'...);
$this->view->myHelper = $helper;
}
--
View this message in context:
http://www.nabble.com/Passing-parameters-to-view-helper%27s-constructor--tf4877999s16154.html#a14041938
Sent from the Zend Framework mailing list archive at Nabble.com.