/** * Create a new Controller instance. */ public function __construct() { parent::__construct(); // Setup the used Template to default, if it is not already defined. if (!isset($this->template)) { $this->template = Config::get('app.template'); } // Initialise the Language object. if ($this->language !== false) { $this->language = Language::instance('legacy_api', LANGUAGE_CODE); } // Setup the (legacy) Middleware. $this->beforeFilter('@callLegacyBefore'); $this->afterFilter('@callLegacyAfter'); }
/** * Make a controller instance via the IoC container. * * @param string $controller * @return mixed */ protected function makeController($controller) { Controller::setFilterer($this->filterer); return $this->container->make($controller); }
/** * Apply the applicable after filters to the route. * * @param \Routing\Controller $instance * @param \Routing\Route $route * @param \Http\Request $request * @param string $method * @return mixed */ protected function assignAfter($instance, $route, $request, $method) { foreach ($instance->getAfterFilters() as $filter) { if ($this->filterApplies($filter, $request, $method)) { $route->after($this->getAssignableAfter($filter)); } } }