コード例 #1
0
 /**
  * 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);
 }
コード例 #2
0
 /**
  * {@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;
 }
コード例 #3
0
ファイル: Route.php プロジェクト: delatbabel/framework
 /**
  * Get the middleware for the route's controller.
  *
  * @return array
  */
 public function controllerMiddleware()
 {
     if (!$this->isControllerAction()) {
         return [];
     }
     return ControllerDispatcher::getMiddleware($this->getController(), $this->getControllerMethod());
 }
コード例 #4
0
ファイル: Route.php プロジェクト: AlexCutts/framework
 /**
  * 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);
 }
コード例 #5
0
 /**
  * {@inheritDoc}
  */
 protected function makeController($controller)
 {
     $instance = parent::makeController($controller);
     $this->injectControllerDependencies($instance);
     return $instance;
 }