umpirsky wrote:
>
> Hi.
>
> I wonder, if you want to use url helper for all urls in your app, you can
> access it from view with $this->url(). from controller with
> $this->wiew->url()...
>
> But when you want for example to use it to set action of a form in form
> init() method, do you access it through front controller or bootstrap or
> you set action explicitly in the view script?
> What is the right way to go?
>
> Regards,
> Sasa Stamenkovic.
>
You can do that easily using the form view helper and the URL of the calling
page so doing so from the init() method isn't required. For example,
indexAction()
{
$this->view->form = new Default_Form_MyForm();
}
index.phtml
<?=$this->form->setAction($this->url());?>
You could probably do it in the form using the helper broker but I've never
had a need to do so.
--
View this message in context:
http://www.nabble.com/url-helper-available-all-over-your-app-tp25992262p25992433.html
Sent from the Zend Framework mailing list archive at Nabble.com.