我正在使用新的 Zend Framework 2 进行测试,我在尝试使用 baseUrl View 助手时发现了一个问题,我在调用 $this->baseUrl()
时遇到了以下错误> 在我的 phtml View 文件中;
调试错误:
C:\Zend\ZendServer\share\ZendFramework2\library\Zend\ServiceManager\ServiceManager.php line 424 - Uncaught exception 'Zend\ServiceManager\Exception\ServiceNotFoundException' with message 'Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for baseUrl' in C:\Zend\ZendServer\share\ZendFramework2\library\Zend\ServiceManager\ServiceManager.php:424
最佳答案
这看起来像 ZF1 的特性,ZF2 有 helper Zend\View\Helper\BasePath
在 View $this->basePath();
关于php - baseUrl View 助手不适用于 ZendFramework 2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12866578/