public __construct ( Symfony\Component\HttpKernel\KernelInterface $kernel ) | ||
$kernel | Symfony\Component\HttpKernel\KernelInterface |
/** * @param KernelInterface $kernel * @param string $module The module wherefore this is the configuration-file. */ public function __construct(KernelInterface $kernel, $module) { parent::__construct($kernel); $this->module = (string) $module; // read the possible actions based on the files $this->setPossibleActions(); }
/** * @param KernelInterface $kernel * @param string $action The action to use. * @param string $module The module to use. */ public function __construct(KernelInterface $kernel, $action, $module) { parent::__construct($kernel); // store the current module and action (we grab them from the URL) $this->setModule($module); $this->setAction($action); }
/** * @param KernelInterface $kernel * * @throws RedirectException */ public function __construct(KernelInterface $kernel) { parent::__construct($kernel); // add ourself to the reference so other classes can retrieve us $this->getContainer()->set('url', $this); // fetch the request object from the container $this->request = $this->get('request'); // if there is a trailing slash we permanent redirect to the page without slash if (mb_strlen($this->request->getRequestUri()) != 1 && mb_substr($this->request->getRequestUri(), -1) == '/') { throw new RedirectException('Redirect', new RedirectResponse(mb_substr($this->request->getRequestUri(), 0, -1), 301)); } // set query-string and parameters for later use $this->parameters = $this->request->query->all(); // process URL $this->processQueryString(); }
/** * The constructor will set some properties, it populates the parameter array with urldecoded * values for ease of use. * * @param KernelInterface $kernel */ public function __construct(KernelInterface $kernel) { parent::__construct($kernel); $this->tpl = $this->getContainer()->get('template'); $this->header = $this->getContainer()->get('header'); }
/** * It will grab stuff from the reference. * * @param KernelInterface $kernel */ public function __construct(KernelInterface $kernel) { parent::__construct($kernel); $this->tpl = $this->getContainer()->get('templating'); $this->URL = $this->getContainer()->get('url'); }