本文整理汇总了PHP中Mage_Core_Block_Text::setText方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Block_Text::setText方法的具体用法?PHP Mage_Core_Block_Text::setText怎么用?PHP Mage_Core_Block_Text::setText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Block_Text
的用法示例。
在下文中一共展示了Mage_Core_Block_Text::setText方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _beforeToHtml
public function _beforeToHtml()
{
$block_1 = new Mage_Core_Block_Text();
$block_1->setText('The first sentence.');
$this->setChild('the_first', $block_1);
$block_2 = new Mage_Core_Block_Text();
$block_2->setText('The second sentence .');
$this->setChild('the_second', $block_2);
}
示例2: manejandobloquesAction
public function manejandobloquesAction()
{
$block_1 = new Mage_Core_Block_Text();
$block_1->setText('Original Text');
$block_2 = new Mage_Core_Block_Text();
$block_2->setText('The second sentence.');
$main_block = new Mage_Core_Block_Template();
$main_block->setTemplate('nofrills/manejandobloques.phtml');
$main_block->setChild('the_first', $block_1);
$main_block->setChild('the_second', $block_2);
$block_1->setText('Wait , I want this text instead .');
echo $main_block->toHtml();
}
示例3: testToHtml
public function testToHtml()
{
$this->_block->setText('test');
$this->assertEquals('test', $this->_block->toHtml());
}
示例4: testSetFrameTags
public function testSetFrameTags()
{
$block = new Mage_Core_Block_Text();
$block->setText('text');
$block->setFrameTags('p');
$this->assertEquals('<p>text</p>', $block->toHtml());
$block->setFrameTags('p class="note"', '/p');
$this->assertEquals('<p class="note">text</p>', $block->toHtml());
$block->setFrameTags('non-wellformed tag', 'closing tag');
$this->assertEquals('<non-wellformed tag>text<closing tag>', $block->toHtml());
}
示例5: 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());
}