현재 페이지를 채우는 데 json 서비스로만 사용되는 Zend MVC 애플리케이션으로 컨트롤러를 구축하고 있습니다. GET 메서드 만 사용하여이 끝점에 액세스하도록 사용자에게 제한하고 싶습니다 (보안상의 이유로).Zend _forward()가 preDispatch()에서 작동하지 않습니까?
나는이 게시물 _forward() in Zend does not work?을 따라 갔지만 작동하지 못했습니다.
나는 preDispatch를 사용하여 요청을 감지하지 못하고 동일한 컨트롤러에서 errorAction으로 전달하려고합니다. 내 코드가 좋아하는이,
public function preDispatch(){
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
//Restrict this Controller access to Http GET method
if(!($this->getRequest()->isGet())){
return $this->_forward('error');
}
}
public function errorAction(){
$this->getResponse()->setHttpResponseCode(501);
echo "Requested Method is not Implemented";
}
내가 POST 요청으로 페이지를 테스트, 그것이 내가 그것이 유일한 경우 궁금
$this->_redirect("service/error");
작업있어
PHP Fatal error: Maximum execution time of 30 seconds exceeded
을 던졌습니다 보이는 /이 상황을 처리하는 가장 좋은 방법.
도움이 될 것입니다. 미리 감사드립니다.
최고는 ... 마법처럼 일했다 ..! 빠른 응답 주셔서 감사합니다 : D 조 –