Frontend\Core\Engine\Base\Object::__construct PHP 메소드

__construct() 공개 메소드

It will grab stuff from the reference.
public __construct ( Symfony\Component\HttpKernel\KernelInterface $kernel )
$kernel Symfony\Component\HttpKernel\KernelInterface
    public function __construct(KernelInterface $kernel)
    {
        parent::__construct($kernel);
        $this->tpl = $this->getContainer()->get('templating');
        $this->URL = $this->getContainer()->get('url');
    }

Usage Example

예제 #1
0
파일: Widget.php 프로젝트: forkcms/forkcms
 /**
  * @param KernelInterface $kernel
  * @param string          $module The module to use.
  * @param string          $action The action to use.
  * @param string          $data   The data that should be available.
  */
 public function __construct(KernelInterface $kernel, $module, $action, $data = null)
 {
     parent::__construct($kernel);
     // get objects from the reference so they are accessible
     $this->header = $this->getContainer()->get('header');
     $this->URL = $this->getContainer()->get('url');
     // set properties
     $this->setModule($module);
     $this->setAction($action);
     $this->setData($data);
 }
All Usage Examples Of Frontend\Core\Engine\Base\Object::__construct