/** * TableCaption constructor. * * @param null|string $text * @param array $attributes caption tag attributes */ public function __construct($text, $attributes = []) { parent::__construct('caption', $attributes); $this->setDestinationParentId(Grid::TABLE_ID); $this->setId(static::ID); $this->addChild($this->text = new DataView($text)); }
/** * @param array|null $attributes * @param array $options components or 'value' => 'label' array * @param string $selectedValue */ public function __construct(array $attributes = [], array $options = [], $selectedValue = null) { parent::__construct('select', $attributes, self::makeOptionComponents($options)); if ($selectedValue !== null) { $this->setOptionSelected($selectedValue); } }
/** * TagWithText constructor. * * @param string $tagName html tag name, optional, default value: 'div' * @param string $text tag contents (optional) * @param array $attributes html tag attributes (optional) */ public function __construct($tagName = 'div', $text = '', array $attributes = []) { parent::__construct($tagName, $attributes, [$this->textComponent = new DataView($text)]); }