Exemplo n.º 1
0
 protected function getParams(BaseHookRenderEvent $event)
 {
     $ref = $event->getArgument('ref') ? $event->getArgument('ref') : $this->getView();
     $refId = 0;
     if ($event->getArgument('ref_id')) {
         $refId = $event->getArgument('ref_id');
     } else {
         if ($this->getRequest()->attributes->has('id')) {
             $refId = intval($this->getRequest()->attributes->get('id'));
         } elseif ($this->getRequest()->query->has($ref . '_id')) {
             $refId = intval($this->getRequest()->query->get($ref . '_id'));
         }
     }
     if (null === $ref || 0 === $refId) {
         throw new InvalidArgumentException($this->trans("Reference not found", [], Comment::MESSAGE_DOMAIN));
     }
     return [$ref, $refId];
 }
Exemplo n.º 2
0
 public function __construct($code, array $arguments = [], array $fields = [])
 {
     parent::__construct($code, $arguments);
     $this->fragmentBag = new FragmentBag();
     $this->fields = $fields;
 }
Exemplo n.º 3
0
 public function __construct($code, array $arguments = array())
 {
     parent::__construct($code, $arguments);
     $this->fragmentBag = new FragmentBag();
 }