Zend\Mvc\View\Http\RouteNotFoundStrategy::injectController PHP Метод

injectController() защищенный Метод

If either $displayExceptions or $displayNotFoundReason are enabled, injects the controllerClass from the MvcEvent. It checks to see if a controller is present in the MvcEvent, and, if not, grabs it from the route match if present; if a controller is found, it injects it into the model.
protected injectController ( Zend\View\Model\ViewModel $model, MvcEvent $e ) : void
$model Zend\View\Model\ViewModel
$e Zend\Mvc\MvcEvent
Результат void
    protected function injectController($model, $e)
    {
        if (!$this->displayExceptions() && !$this->displayNotFoundReason()) {
            return;
        }
        $controller = $e->getController();
        if (empty($controller)) {
            $routeMatch = $e->getRouteMatch();
            if (empty($routeMatch)) {
                return;
            }
            $controller = $routeMatch->getParam('controller', false);
            if (!$controller) {
                return;
            }
        }
        $controllerClass = $e->getControllerClass();
        $model->setVariable('controller', $controller);
        $model->setVariable('controller_class', $controllerClass);
    }