本文整理汇总了PHP中Mage_Core_Model_Layout::_generateBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Layout::_generateBlock方法的具体用法?PHP Mage_Core_Model_Layout::_generateBlock怎么用?PHP Mage_Core_Model_Layout::_generateBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Layout
的用法示例。
在下文中一共展示了Mage_Core_Model_Layout::_generateBlock方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _generateBlock
/**
* Add block object to layout based on xml node data
*
* @param Varien_Simplexml_Element $node
* @param Varien_Simplexml_Element $parent
*
* @return Aoe_Layout_Model_Layout
*/
protected function _generateBlock($node, $parent)
{
if ($node instanceof Mage_Core_Model_Layout_Element) {
if (!$this->checkConditionals($node)) {
return $this;
}
}
return parent::_generateBlock($node, $parent);
}
示例2: _generateBlock
protected function _generateBlock($node, $parent)
{
if (isset($node['ifconfig']) && ($configPath = (string) $node['ifconfig'])) {
if (!Mage::getStoreConfigFlag($configPath)) {
return;
}
}
return parent::_generateBlock($node, $parent);
}
示例3: _generateBlock
/**
* Add block object to layout based on xml node data
*
* @param Varien_Simplexml_Element $node
* @param Varien_Simplexml_Element $parent
* @return Mage_Core_Model_Layout
*/
protected function _generateBlock($node, $parent)
{
$viewerEnabled = Mage::getStoreConfigFlag('dev/debug/widgetslotviewer_enable');
if ($viewerEnabled && isset($node->label)) {
$blockLabel = $node->label;
$viewerName = $node['name'] . '.slot_viewer';
$viewerXml = "<block type='core/template' name='{$viewerName}' template='widgetslotviewer/slotviewer.phtml'>" . "<action method='setParentLabel'><label>{$blockLabel}</label></action>" . "</block>";
$viewerChild = new Varien_Simplexml_Element($viewerXml);
$node->appendChild($viewerChild);
}
return parent::_generateBlock($node, $parent);
}
示例4: _generateBlock
/**
* Add block object to layout based on xml node data
*
* @param Varien_Simplexml_Element $node
* @param Varien_Simplexml_Element $parent
* @return Mage_Core_Model_Layout
*/
protected function _generateBlock($node, $parent)
{
// Check for enterprise version to determine if we should render the targetrule blocks
$ee = Mage::helper('mybuys')->isMageEnterprise();
$myBuysBlockName = (string) $node['name'];
// If CE, then do not add these blocks
if (!$ee && ($myBuysBlockName == "mybuys_targetrule_related" || $myBuysBlockName == "mybuys_targetrule_upsell")) {
return $this;
} else {
// For all others, call the parent
parent::_generateBlock($node, $parent);
}
}
示例5: _generateBlock
/**
* Records information about new block creation
* (non-PHPdoc)
* @see Mage_Core_Model_Layout::_generateBlock()
*/
protected function _generateBlock($node, $parent)
{
$this->_collectedBlock = null;
parent::_generateBlock($node, $parent);
if ($this->_collectedBlock !== null) {
$target = $this->_collectedBlock->getNameInLayout();
$params = array();
if (isset($node['as'])) {
$params['alias'] = (string) $node['as'];
} else {
$params['alias'] = $target;
}
if (isset($node['class'])) {
$params['type'] = (string) $node['class'];
} elseif (isset($node['type'])) {
$params['type'] = (string) $node['type'];
}
$params['class'] = get_class($this->_collectedBlock);
$params['is_root'] = isset($node['output']);
$this->record(self::ACTION_BLOCK_CREATED, $target, $params);
if (isset($node['template'])) {
$this->record(self::ACTION_BLOCK_ACTION, $target . '::setTemplate', array('template' => (string) $node['template']));
}
}
return $this;
}
示例6: processingGenerateBlock
private function processingGenerateBlock($node, $parent, $config_node)
{
$node['template'] = $config_node;
return parent::_generateBlock($node, $parent);
}
示例7: _generateBlock
/**
* Add block object to layout based on XML node data
*
* @param Varien_Simplexml_Element $node
* @param Varien_Simplexml_Element $parent
* @return Mage_Core_Model_Layout
*/
protected function _generateBlock($node, $parent)
{
parent::_generateBlock($node, $parent);
$blockName = (string) $node['name'];
$block = $this->getBlock($blockName);
if (!$block) {
return $this;
}
if (in_array($blockName, array_keys($this->_cacheBlocks))) {
$block->setData('cache_lifetime', $this->_cacheBlocks[$blockName]['lifetime']);
if (!empty($this->_cacheBlocks[$blockName]['key'])) {
$block->setData('cache_key', $this->_cacheBlocks[$blockName]['key']);
}
}
if (in_array($blockName, array_keys($this->_esiBlocks))) {
$block->setData('esi', 1);
}
return $this;
}