takeshin
takeshin

Reputation: 50638

Custom path for view scripts

I use customized paths for my application based on Zend Framework (a.k.a. themes).

The view scripts are saved in public/themes/themename/modulename/..., so switching the application theme is just substituting themename in the path.

How to tell Zend Tool to generate the view scripts in this directory instead of the default one? I suppose some kind of provider is needed?

How to register the provider to have it by default for all zf based projects?

Upvotes: 2

Views: 297

Answers (3)

Adrian
Adrian

Reputation: 128

Look at the default Zend Providers and extend the classes with your own, overloading the paths.

Upvotes: 1

Iznogood
Iznogood

Reputation: 12843

I cannot tell you how you can achieve what you want but I can point you to some great help. Zendcast If you don't know about zendcast its a great palce to look for tutorials about the zend framework.

Upvotes: 0

smack0007
smack0007

Reputation: 11366

In your bootstrap you can add a script path:

protected function _initViewScripts()
{
    $this->bootstrap('view');
    $view = $this->getComponent('view');

    $view->addScriptPath('path/to/view/scripts/');
}

Upvotes: 0

Related Questions