/** * {@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(); } }
/** * {@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; }
/** * @param AbstractShape $shape * * @return $this|self */ public function addShape(AbstractShape $shape) { $this->widgetOptions->addData('shapes', [$shape]); return $this; }
/** * {@inheritdoc} */ public function render() { $this->data['widgetOptions'] = $this->widgetOptions->count() ? $this->widgetOptions->render() : null; return parent::render(); }
/** * @return string */ public function render() { return $this->element->render() . $this->options->render(); }