public function test() { $container = new Container(); $c1 = new DataView('1'); $c2 = new DataView('2'); $container->children()->set([$c1, $c2]); self::assertEquals('12', $container->render()); }
/** * Renders component and returns output. * * @return string */ public function render() { $out = ''; foreach ($this->getData() as $row) { $this->injectData($row); $out .= parent::render(); } return $out; }
/** * SolidRow constructor. * * If columns count argument is specified, SolidRow will use it instead of real grid's columns count. * * @param ComponentInterface[] $components * @param string $cellTagName * @param int|null $columnsCount */ public function __construct($components = [], $cellTagName = 'td', $columnsCount = null) { $this->cellTag = new Tag($cellTagName, $columnsCount ? ['colspan' => $columnsCount] : [], $components); $this->rowTag = new Tag('tr', [], [$this->cellTag]); parent::__construct([$this->rowTag]); }
/** * Section constructor. * * @param string $name */ public function __construct($name) { parent::__construct(); $this->setDestinationParentId('template'); $this->setId('section-' . $name); }