__construct() public method

public __construct ( Symfony\Component\HttpKernel\KernelInterface $kernel )
$kernel Symfony\Component\HttpKernel\KernelInterface
Ejemplo n.º 1
0
 /**
  * @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();
 }
Ejemplo n.º 2
0
 /**
  * @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);
 }
Ejemplo n.º 3
0
 /**
  * @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();
 }
Ejemplo n.º 4
0
 /**
  * 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');
 }
Ejemplo n.º 5
0
 /**
  * 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');
 }