pre*_*ris 0 php zend-framework
谁知道这个错误意味着什么?谷歌搜索后,我发现一堆网站似乎有相同的错误?谢谢
exception 'Zend_Controller_Action_Exception' with message 'Action "index" does not exist and was not trapped in __call()' in /usr/local/zend/apache2/htdocs/pintsy/lib/Zend/Controller/Action.php:485
Stack trace:
#0 /usr/local/zend/apache2/htdocs/pintsy/lib/Zend/Controller/Action.php(515): Zend_Controller_Action->__call('indexAction', Array)
#1 /usr/local/zend/apache2/htdocs/pintsy/lib/Zend/Controller/Dispatcher/Standard.php(289): Zend_Controller_Action->dispatch('indexAction')
#2 /usr/local/zend/apache2/htdocs/pintsy/lib/Zend/Controller/Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#3 /usr/local/zend/apache2/htdocs/pintsy/html/index.php(114): Zend_Controller_Front->dispatch()
#4 {main}
Run Code Online (Sandbox Code Playgroud)
这意味着indexAction你的控制器类中没有方法.
您的控制器已实例化,并且根据URL,Magento确定该操作是"索引".这是默认操作.例如,如果您有这样的网址
http://example.com/products/
Run Code Online (Sandbox Code Playgroud)
通常(Zend在整个地方的使用方式不同)和这样的URL一样
http://example.com/products/index
Run Code Online (Sandbox Code Playgroud)
也就是说,它们都会实例化一个ProductController和一个索引的动作.
public function indexAction(){...}
Run Code Online (Sandbox Code Playgroud)
因此,您的控制器缺少名为indexAction的方法.接下来会发生什么,请求被发送到PHP魔术__call方法.如果在类上存在此方法,则调用不存在的方法.在Zend的例外是告诉你,除了学生要没有方法indexAction,没有什么在__call左右indexAction任.