I created my own controller, derived from Zend_Controller_Action, calling it
Tim_Controller_Action and all of my controllers derive from my controller.
(putting it in Library/Tim/Controller/Action.php)

Dont forget to call parent::init(); if you override the init in the real
controllers.

On Thu, Oct 16, 2008 at 10:15, gerardroche <[EMAIL PROTECTED]> wrote:

>
> you could do it in your bootstrap.
>
>
>
>
> Steven Szymczak wrote:
> >
> > Every one of my action controllers has an init() function that pulls a
> > config object from the registry and uses it to set some paths used
> > throughout the site (e.g.):
> >
> > public function init() {
> >       $view_cfg = Zend_Registry::get('SITE_CFG');
> >
> >       $this->view->__set('pubImages', $view_cfg->dirs->images);
> >       $this->view->__set('jsDir', $view_cfg->dirs->js);
> >       $this->view->__set('cssDir', $view_cfg->dirs->css);
> > }
> >
> > How can factor out this functionality without resorting to a parent
> > class for all my action controllers?  I seem to recall a similar post to
> > the list, several months ago, that suggested utilizing a helper
> somehow...
> >
> > Suggestions?
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/How-do-I-factor-out-tasks-common-to-every-action-controller--tp20003502p20004290.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>

Reply via email to