Hello,

I am trying to get ZF2 to call a 403 error page when a 403 error is set.
This is similar to the behavior when a 404 error is set. How can I do this? 

I have tried this, but doesn't work:

public function onDispatchError(MvcEvent $e)
   {
       // do your auth checks...
            // get response from event
            $response = $e->getResponse();
            // set status 403 (forbidden) 
            $response->setStatusCode(403);
            $model = $e->getViewModel();
            //$model->setLayout('layout/blank');
            $model->setTemplate('error/403');
            return $model;
   }

Any suggestions?

-Nikesh



--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/How-to-dispatch-a-custom-403-page-in-ZF2-tp4659654.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to