开发者

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?


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


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/');
}


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜