ZF2: How can I set basePath to be the same for a whole application?

会有一股神秘感。 提交于 2019-12-11 10:23:00

问题


The manual's example shows how to set the basePath only for some specific viewModel:

$this->getHelper('basePath')->setBasePath()

But I want to set it somewhere in one place and then it is the same for any viewModel I create in any Controller. How can I do it?


回答1:


You could set a global base path in config:

'view_manager' => array(
    'base_path' => '/path/'
)


来源:https://stackoverflow.com/questions/13955426/zf2-how-can-i-set-basepath-to-be-the-same-for-a-whole-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!