Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function render()
 {
     if ($this->widgetOptions->count()) {
         $container = new Container();
         $container->add(new Element(parent::render()));
         $container->add($this->widgetOptions);
         return $container->render();
     } else {
         return parent::render();
     }
 }
Exemple #2
0
 /**
  * {@inheritdoc}
  */
 public function layout() : Container
 {
     if ($this->isRequired() == false) {
         $this->widgetOptions->addData('plugin', ['allowClear' => true]);
     }
     $container = parent::layout();
     if ($this->widgetOptions->count()) {
         $instance = $this->getFieldContainer($container);
         $instance->add($this->widgetOptions);
     }
     return $container;
 }
Exemple #3
0
 /**
  * @param AbstractShape $shape
  *
  * @return $this|self
  */
 public function addShape(AbstractShape $shape)
 {
     $this->widgetOptions->addData('shapes', [$shape]);
     return $this;
 }
Exemple #4
0
 /**
  * {@inheritdoc}
  */
 public function render()
 {
     $this->data['widgetOptions'] = $this->widgetOptions->count() ? $this->widgetOptions->render() : null;
     return parent::render();
 }
Exemple #5
0
 /**
  * @return string
  */
 public function render()
 {
     return $this->element->render() . $this->options->render();
 }