hello I just want to ask whether we can call a view method to a model? I know that we can call it on our controller in zend framework. Like if I want to call the url method of view on my controller I can call it like this
$this->view->url(array(),'');
and on the view we just can call it by
$this->url(array(),'');
But When I tried to call the same method on my model by
$this->view->url(array(),'');
it generates an error of call to undefined method url.
Now I want to ask whether it is possible to call view method to a model? If yes then how? What Am I doing wrong.
Thanks
If you want to use the URL helper, why not inject / lazy load it in your model, eg
This way, you can either pass the helper to your model from the controller…
or let the lazy loader fetch it statically from the helper broker.