1

I just started learning the zend framework and what im wondering is , is it possible to create controllers and actions without ever touching the zend tool? I see the zend tool a great tool when creating new projects or a new controller but for creating actions its just extra work. Is it also possible to output an actions variables into the associated controllers view rather than its own view?

thanks

Masoman
  • 85
  • 2
  • 12

1 Answers1

0

You don't really need Zend Tool if you don't want. I find it helpful for creating the initial project but beyond that I hardly ever use it.

Zend_View is exposed by the Zend_Controller_Action, but it is independent of the specific controller action. If you assign variables to the view from a particular action, and render a different view, or call another action, the previously set view variables are still there. I think that was what you were asking.

drew010
  • 68,777
  • 11
  • 134
  • 162
  • i had created an action in a controller and set a view variable pageTitle and tried calling it in the controllers view and it wouldnt work. what i did was removed the action and placed the cal into init() and it worked. so i guess thats what i have to do so that the controllers view can be used. – Masoman Jan 21 '12 at 05:49
  • If you set a view variable from a particular action, that action has to be called for it to actually set the variable. If the action isn't called, it won't be available, but it is possible to call multiple actions if necessary. Using init() or preDispatch() like you did is also a good way to make something available to all actions in a particular controller. – drew010 Jan 21 '12 at 20:44