Yes, But I'm not using doctrine or zend DB. I tried writing some custom factories but I still get some errors. I'm using Propel.
Best Regards, Nikesh Hajari Mobile: (503) 473-6689 On Apr 7, 2013, at 4:38 PM, Marco Pivetta <[email protected]> wrote: Have you already looked at how BjyAuthorize handles this? Check the unauthorized view strategy: https://github.com/bjyoungblood/BjyAuthorize/blob/master/src/BjyAuthorize/View/UnauthorizedStrategy.php Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On 7 April 2013 22:28, nikeshhajari <[email protected]> wrote: > 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] > > >
