/** * Produce and return block's html output * * It is a final method, but you can override _toHtml() method in descendants if needed. * * @return string */ public final function toHtml() { $this->_eventManager->dispatch('core_block_abstract_to_html_before', array('block' => $this)); if ($this->_storeConfig->getConfig('advanced/modules_disable_output/' . $this->getModuleName())) { return ''; } $html = $this->_loadCache(); if ($html === false) { if ($this->hasData('translate_inline')) { $this->_translator->setTranslateInline($this->getData('translate_inline')); } $this->_beforeToHtml(); $html = $this->_toHtml(); $this->_saveCache($html); if ($this->hasData('translate_inline')) { $this->_translator->setTranslateInline(true); } } $html = $this->_afterToHtml($html); /** * Check framing options */ if ($this->_frameOpenTag) { $html = '<' . $this->_frameOpenTag . '>' . $html . '<' . $this->_frameCloseTag . '>'; } return $html; }
public function testGetSetTranslateInline() { $this->assertEquals(true, $this->_model->getTranslateInline()); $this->_model->setTranslateInline(false); $this->assertEquals(false, $this->_model->getTranslateInline()); }