Beispiel #1
0
 /**
  * Render html output
  *
  * @return string
  */
 protected function _toHtml()
 {
     $this->setText('');
     $layout = $this->getLayout();
     foreach ($this->getChildNames() as $child) {
         $this->addText($layout->renderElement($child, false));
     }
     return parent::_toHtml();
 }
Beispiel #2
0
 /**
  * Render html output
  *
  * @return string
  */
 protected function _toHtml()
 {
     $this->setText('');
     $layout = $this->getLayout();
     foreach ($this->getChildNames() as $child) {
         /** @var Generic $childBlock */
         $childBlock = $layout->getBlock($child);
         if ($childBlock instanceof Generic) {
             $childBlock->setItem($this->getItem());
             $this->addText($layout->renderElement($child, false));
         }
     }
     return parent::_toHtml();
 }
Beispiel #3
0
 /**
  * Render html output
  *
  * @return string
  */
 protected function _toHtml()
 {
     $this->setText('<li');
     $params = $this->getLiParams();
     if (!empty($params) && is_array($params)) {
         foreach ($params as $key => $value) {
             $this->addText(' ' . $key . '="' . addslashes($value) . '"');
         }
     } elseif (is_string($params)) {
         $this->addText(' ' . $params);
     }
     $this->addText('>' . $this->getInnerText() . '</li>' . "\r\n");
     return parent::_toHtml();
 }
Beispiel #4
0
 /**
  * @param string $text
  * @param bool $before
  * @param string $expectedResult
  *
  * @dataProvider addTextDataProvider
  */
 public function testAddText($text, $before, $expectedResult)
 {
     $this->elementText->setText('example');
     $this->elementText->addText($text, $before);
     $this->assertEquals($expectedResult, $this->elementText->getText('example'));
 }
Beispiel #5
0
 public function testToHtml()
 {
     $this->_block->setText('test');
     $this->assertEquals('test', $this->_block->toHtml());
 }
 protected function _beforeToHtml()
 {
     $this->setText(sprintf('example widget: var1=%s, var2=%s', $this->getData('var1'), $this->getData('var2')) . __('Translate me') . __('Var1 %1, Var2 %2, Var %3', time(), date('Y'), 32) . __('Copyright %1 <a href="%2">Magento</a>', date('Y'), 'http://magento.com'));
     return parent::_beforeToHtml();
 }