zend框架中函数getBaseUrl()的问题

时间:2022-02-02 20:18:34

i have BaseUrl class in this path application\views\helpers

我在此路径application \ views \ helpers中有BaseUrl类

class Zend_View_Helper_BaseUrl {
    function baseUrl ()
    {
        $fc = Zend_Controller_Front::getInstance();
        return $fc->getBaseUrl();
    }
}

but in my views when i use

但在我看来,当我使用

echo $this->baseUrl(); 

its null;

someone could help ?

有人可以帮忙吗?

thanks

1 个解决方案

#1


1  

There are already a View-Helper for BaseURL : class Zend_View_Helper_BaseUrl extends Zend_View_Helper_Abstract

BaseURL已有一个View-Helper:类Zend_View_Helper_BaseUrl扩展Zend_View_Helper_Abstract

I think you have problem with the default ; try to rename your Zend_View_Helper_BaseUrl or try to use the default one.

我认为你的默认有问题;尝试重命名Zend_View_Helper_BaseUrl或尝试使用默认值。

#1


1  

There are already a View-Helper for BaseURL : class Zend_View_Helper_BaseUrl extends Zend_View_Helper_Abstract

BaseURL已有一个View-Helper:类Zend_View_Helper_BaseUrl扩展Zend_View_Helper_Abstract

I think you have problem with the default ; try to rename your Zend_View_Helper_BaseUrl or try to use the default one.

我认为你的默认有问题;尝试重命名Zend_View_Helper_BaseUrl或尝试使用默认值。