本文整理汇总了PHP中Mage_Core_Model_Layout::getOutput方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Layout::getOutput方法的具体用法?PHP Mage_Core_Model_Layout::getOutput怎么用?PHP Mage_Core_Model_Layout::getOutput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Layout
的用法示例。
在下文中一共展示了Mage_Core_Model_Layout::getOutput方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetOutput
/**
* @covers Mage_Core_Model_Layout::addBlock
* @covers Mage_Core_Model_Layout::addOutputBlock
* @covers Mage_Core_Model_Layout::getOutput
* @covers Mage_Core_Model_Layout::removeOutputBlock
*/
public function testGetOutput()
{
$blockName = 'block_' . __METHOD__;
$expectedText = "some_text_for_{$blockName}";
$block = new Mage_Core_Block_Text();
$block->setText($expectedText);
$this->_model->addBlock($block, $blockName);
$this->_model->addOutputBlock($blockName);
$this->assertEquals($expectedText, $this->_model->getOutput());
$this->_model->removeOutputBlock($blockName);
$this->assertEmpty($this->_model->getOutput());
}
示例2: testGetOutput
/**
* @covers Mage_Core_Model_Layout::addOutputElement
* @covers Mage_Core_Model_Layout::getOutput
* @covers Mage_Core_Model_Layout::removeOutputElement
*/
public function testGetOutput()
{
$blockName = 'block_' . __METHOD__;
$expectedText = "some_text_for_{$blockName}";
$block = $this->_layout->addBlock('Mage_Core_Block_Text', $blockName);
$block->setText($expectedText);
//$this->_layout->addOutputElement($blockName);
// add the same element twice should not produce output duplicate
//$this->_layout->addOutputElement($blockName);
$this->assertEquals($expectedText, $this->_layout->getOutput());
$this->_layout->removeOutputElement($blockName);
$this->assertEmpty($this->_layout->getOutput());
}
示例3: getOutput
/**
* Get all blocks marked for output
*
* @return string
*/
public function getOutput()
{
if (!Mage::getSingleton('Flagbit_Typo3connect/Core')->isEnabled()) {
return parent::getOutput();
}
$out = '';
foreach ($this->_blocks as $key => $block) {
Mage::getSingleton('Flagbit_Typo3connect/Core')->setBlock($key, $block);
}
//return parent::getOutput();
if (!empty($this->_output)) {
foreach ($this->_output as $callback) {
$out .= $this->getBlock($callback[0])->{$callback}[1]();
}
}
return $out;
}
示例4: getOutput
/**
* Records that layout was rendered
* (non-PHPdoc)
* @see Mage_Core_Model_Layout::getOutput()
*/
public function getOutput()
{
$this->record(self::ACTION_RENDER, 'layout');
return parent::getOutput();
}
示例5: getOutput
/**
* Replace all inline JavaScript
*
* @return string
*/
public function getOutput()
{
$output = parent::getOutput();
if (preg_match('/<body\\s*[^>]*>.*<\\/body>/is', $output, $body)) {
$oldBody = $body[0];
// Replace script tags
$newBody = preg_replace('/<script\\s*[^>]*>.*?<\\/script>/is', '', $oldBody);
// Replace JS events
foreach ($this->_jsEvents as $event) {
$newBody = preg_replace("/(<[^>]+){$event}\\s*=\\s*(['\"])/is", "\$1{$event}-vde=\$2", $newBody);
}
// Replace href JS
$newBody = preg_replace('/(<[^>]+)href\\s*=\\s*([\'"])javascript:/is', '$1href-vde=$2', $newBody);
$output = str_replace($oldBody, $newBody, $output);
}
return $output;
}