「http:// localhost / public / account / test」にアクセスすると正しく機能するビューがありますが、感嘆符を追加すると(「http:// localhost / public / account / test!」)、次のようになります。アプリケーションエラー。ただし、404エラーが発生することを期待しています。testAction()
コントローラーにはメソッドのみがあり、メソッドはありませんtest-Action()
(PHPでそれを回避できるかのように)。代わりに404エラーをスローするにはどうすればよいですか?
私が受け取ったアプリケーションエラーの詳細は次のとおりです。
メッセージ:スクリプト'account / test-.phtml'がパスに見つかりません(/ website / application / modules / default / views / scripts /)
スタックトレース:
#0 /Applications/XAMPP/xamppfiles/lib/php/pear/Zend/View/Abstract.php(876): Zend_View_Abstract->_script('account/test-.p...')
#1 /Applications/XAMPP/xamppfiles/lib/php/pear/Zend/Controller/Action/Helper/ViewRenderer.php(897): Zend_View_Abstract->render('account/test-.p...')
#2 /Applications/XAMPP/xamppfiles/lib/php/pear/Zend/Controller/Action/Helper/ViewRenderer.php(918): Zend_Controller_Action_Helper_ViewRenderer->renderScript('account/test-.p...', NULL)
#3 /Applications/XAMPP/xamppfiles/lib/php/pear/Zend/Controller/Action/Helper/ViewRenderer.php(957): Zend_Controller_Action_Helper_ViewRenderer->render()
#4 /Applications/XAMPP/xamppfiles/lib/php/pear/Zend/Controller/Action/HelperBroker.php(277): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#5 /Applications/XAMPP/xamppfiles/lib/php/pear/Zend/Controller/Action.php(523): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#6 /Applications/XAMPP/xamppfiles/lib/php/pear/Zend/Controller/Dispatcher/Standard.php(289): Zend_Controller_Action->dispatch('testAction')
#7 /Applications/XAMPP/xamppfiles/lib/php/pear/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#8 /Applications/XAMPP/xamppfiles/lib/php/pear/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#9 /Applications/XAMPP/xamppfiles/lib/php/pear/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#10 /website/public/index.php(42): Zend_Application->run()
#11 {main}
Request Parameters:
array(3) {
["controller"]=>
string(7) "account"
["action"]=>
string(5) "test!"
["module"]=>
string(7) "default"
}