By default the page is set like this in the Application
module.config array:
\'template_map\' => array(
\'error/404\' => __DIR__ . \'/
I am not sure I follow what you are trying to achieve, can you give a clear example of what you are trying to do?
If you are simply trying to add variables to the view model passed you could even do this in your controller, check out AbstractActionController
/**
* Action called if matched action does not exist
*
* @return array
*/
public function notFoundAction()
{
$response = $this->response;
$event = $this->getEvent();
$routeMatch = $event->getRouteMatch();
$routeMatch->setParam('action', 'not-found');
if ($response instanceof HttpResponse) {
return $this->createHttpNotFoundModel($response);
}
return $this->createConsoleNotFoundModel($response);
}
/**
* Create an HTTP view model representing a "not found" page
*
* @param HttpResponse $response
* @return ViewModel
*/
protected function createHttpNotFoundModel(HttpResponse $response)
{
$response->setStatusCode(404);
// Add in extra stuff from your ServiceLocator here...
// $viewModel->setTemplate(..);
return new ViewModel(array(
'content' => 'Page not found',
));
}