我尝试在 Zend_Layout 选项中使用 helperClass。我创建一个类:
class Helper_Testi extends Zend_Controller_Action_Helper_Abstract{
public function init(){
echo "111111111";
$this->fff = 'hello from Helper';
}
public function getMessage(){
echo "==============";
return "message";
}
}
并在 Bootstrap.php 中尝试将其添加到 Zend_Layout:
$options = array('layout' => 'layout','helperClass'=>'../application/controllers/helper/Testi');
$layout = new Zend_Layout();
$layout->startMvc($options);
但是当我重新加载浏览器时,我看到了异常:
Fatal error: Uncaught exception 'Zend_Exception' with message 'File "../application/controllers/helper/Testi.php" does not exist or class "../application/controllers/helper/Testi" was not found in the file'
我做错了什么?请帮帮我。