도우미 함수 내에서 forward() 함수를 사용하고 싶습니다. 불행히도 나는 그것을 관리 할 수 없다.phalcon forward() 도우미 함수에서 작동하지 않습니다.
인 IndexController :
class IndexController extends ControllerBase
public function indexAction()
$helper = new CustomFunctions();
$helper->log();
die('still here');
{
{
CustomFunctions
class CustomFunctions extends \Phalcon\DI\Injectable{
public function log(){
//...
$this->dispatcher->forward([
'controller' => 'error',
'action' => 'route404'
]);
return false;
}
}
왜 앞으로 didnt가 작동합니까? 그것은 인덱스 컨트롤러에서 메시지를 표시하는 대신 오류 컨트롤러로 전달해야합니다. 모든 조언에 감사드립니다.
을, 감사합니다 선생님 :) – boosterV
리다이렉트가 작동 중입니다; p $ response-> redirect ('route404') -> send() – boosterV