[英]Zend Framework 1 Routing issue exception
大家好,我在Zend Framework 1
路由遇到问题。 我不断收到此错误:
Exception information:
Message: Action "testfree" does not exist and was not trapped in __call()
Stack trace:
#0 Zend/Controller/Action.php(518): Zend_Controller_Action->__call('testfreeAction', Array)
#1 Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('testfreeAction')
#2 Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#3 Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#4 Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#5 public/index.php(46): Zend_Application->run()
#6 {main}
Request Parameters:
array (
'controller' => 'journal',
'action' => 'testfree',
'journal_id' => '23',
'module' => 'default',
)
这是我在html
链接
<a class="button"
href="<?php echo $this->url(
array(
'module' => 'default',
'controller' => 'journal',
'action' => 'testfree',
'journal_id' => $this->journal->id
),
null,
false)
?>">Test Free</a>
我在模块的默认子目录中有一个名为JournalController的Controller
。 它具有一种称为testfree()的方法。 我想调用此方法。
这是Controller
的代码
public function testfree(){
echo "test free";
die();
}
我没有与Zend
合作的经验。 我正在尝试改变我的一位同事所做的一件工作。 谁能给我关于我要去哪里的建议? 我需要更新Bootstrap.php
文件中的内容吗?
任何帮助深表感谢
testfree
是一种操作,因此请尝试在名称中添加“ Action” :
public function testfreeAction(){
...
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.