public function testToHtmlWithContainer() { $listName = $this->_block->getNameInLayout(); $block1 = $this->_layout->addBlock('Magento\\Framework\\View\\Element\\Text', '', $listName); $this->_layout->addContainer('container', 'Container', [], $listName); $block2 = $this->_layout->addBlock('Magento\\Framework\\View\\Element\\Text', '', 'container'); $block3 = $this->_layout->addBlock('Magento\\Framework\\View\\Element\\Text', '', $listName); $block1->setText('text1'); $block2->setText('text2'); $block3->setText('text3'); $html = $this->_block->toHtml(); $this->assertEquals('text1text2text3', $html); }
/** * * Iterates through fieldsets and fetches complete html * * @return string */ protected function _toHtml() { $children = $this->getLayout()->getChildBlocks($this->getNameInLayout()); $total = count($children); $i = 0; $this->setText(''); /** @var $block \Magento\Framework\View\Element\AbstractBlock */ foreach ($children as $block) { $i++; $block->setIsLastFieldset($i == $total); $this->addText($block->toHtml()); } return parent::_toHtml(); }
/** * Collection factory * * @param \Magento\Framework\View\Element\Context $context * @param \Magento\Framework\Registry $coreRegistry * @param array $data */ public function __construct(\Magento\Framework\View\Element\Context $context, \Magento\Framework\Registry $coreRegistry, array $data = array()) { $this->_coreRegistry = $coreRegistry; parent::__construct($context, $data); }
/** * @param \Magento\Framework\View\Element\Context $context * @param \Magento\Framework\AuthorizationInterface $authorization * @param \Magento\Framework\Registry $registry * @param array $data */ public function __construct(\Magento\Framework\View\Element\Context $context, \Magento\Framework\AuthorizationInterface $authorization, \Magento\Framework\Registry $registry, array $data = []) { $this->_authorization = $authorization; $this->_coreRegistry = $registry; parent::__construct($context, $data); }
/** * Initialize grid params * * @return void */ protected function _construct() { parent::_construct(); $this->setId('billing_agreement_orders'); }
/** * @param \Magento\Framework\View\Element\Context $context * @param \Magento\Framework\AuthorizationInterface $authorization * @param array $data */ public function __construct(\Magento\Framework\View\Element\Context $context, \Magento\Framework\AuthorizationInterface $authorization, array $data = array()) { $this->_authorization = $authorization; parent::__construct($context, $data); }