/** * Make a controller instance via the IoC container. * * @param string $controller * @return mixed */ protected function makeController($controller) { if ($this->creator) { Controller::setRouter($this->router); return $this->creator->createController($controller, $this->getPage()); } return parent::makeController($controller); }
/** * {@inheritdoc} */ protected function makeController($controller) { $controller = parent::makeController($controller); if (true === $controller instanceof Controller) { $controller->setLayoutDispatcher($this->container['layout']); $controller->setViewFactory($this->container['view']); $controller->setRouter($this->container['router']); } return $controller; }
/** * Get the middleware for the route's controller. * * @return array */ public function controllerMiddleware() { if (!$this->isControllerAction()) { return []; } return ControllerDispatcher::getMiddleware($this->getController(), $this->getControllerMethod()); }
/** * Dispatch the request to the route to a controller class. * * @param \Illuminate\Http\Request $request * @param \Illuminate\Routing\ControllerDispatacher $controllerDispatcher * @return mixed */ protected function dispatchToController(Request $request, ControllerDispatcher $controllerDispatcher) { list($class, $method) = explode('@', $this->action['controller']); return $controllerDispatcher->dispatch($this, $request, $class, $method); }
/** * {@inheritDoc} */ protected function makeController($controller) { $instance = parent::makeController($controller); $this->injectControllerDependencies($instance); return $instance; }