分配View Helpers ZF 1.12

时间:2014-08-03 20:58:15

标签: zend-framework model-view-controller zend-framework-mvc

我无法让视图助手工作。这是我到目前为止所做的:

我在application.ini

中添加了这个
resources.view.helperPath.My_View_Helper = APPLICATION_PATH "/helpers"

在目录应用程序/帮助程序中,我将文件设置为findurl.php

在findurl.php里面我把

<?php
class My_View_Helper_findurl extends Zend_View_Helper_Abstract
{
    public function findUrl($url){
         $url = $url;
         return htmlspecialchars($url);
    }
}
?>

然后在view.phtml文件中我尝试了$ this-&gt; findurl(&#34; http://google.com&#34;);没有运气,页面空白。

我知道我可能错误地命名约定,任何人都可以帮助我吗?谢谢。

我也在view.phtml

中尝试了这个
$helper = $this->_helper->getHelper('findurl');
echo $helper->findUrl("http://google.com");

1 个答案:

答案 0 :(得分:0)

相关问题