当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Core_Model_Layout::getUpdate方法代码示例

本文整理汇总了PHP中Mage_Core_Model_Layout::getUpdate方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Layout::getUpdate方法的具体用法?PHP Mage_Core_Model_Layout::getUpdate怎么用?PHP Mage_Core_Model_Layout::getUpdate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Core_Model_Layout的用法示例。


在下文中一共展示了Mage_Core_Model_Layout::getUpdate方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

 protected function setUp()
 {
     $this->_layout = Mage::getModel('Mage_Core_Model_Layout', array('area' => 'adminhtml'));
     $this->_layout->getUpdate()->load('layout_test_grid_handle');
     $this->_layout->generateXml();
     $this->_layout->generateElements();
     $this->_block = $this->_layout->getBlock('admin.test.grid.massaction');
 }
开发者ID:,项目名称:,代码行数:8,代码来源:

示例2: setUp

 protected function setUp()
 {
     /** @var $themeUtility Mage_Core_Utility_Theme */
     $themeUtility = Mage::getModel('Mage_Core_Utility_Theme', array(dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'design', Mage::getDesign()));
     $themeUtility->registerThemes()->setDesignTheme('test/default', 'frontend');
     /* Disable loading and saving layout cache */
     Mage::app()->getCacheInstance()->banUse('layout');
     $this->_layout = Mage::getModel('Mage_Core_Model_Layout');
     $this->_layout->getUpdate()->addHandle('layout_test_handle_main');
     $this->_layout->getUpdate()->load('layout_test_handle_extra');
 }
开发者ID:nickimproove,项目名称:magento2,代码行数:11,代码来源:LayoutTestBase.php

示例3: getBlock

 /**
  * Get block
  *
  * @param string $blockName
  * @return Mage_Core_Block_Abstract
  */
 public function getBlock($blockName)
 {
     /** @var $layout Mage_Core_Model_Layouts */
     $this->_prepareLayout();
     $this->_layout->getUpdate()->load($this->_getHandles());
     $this->_layout->generateXml()->generateBlocks();
     $block = $this->_layout->getBlock($blockName);
     $this->unsetLayout();
     return $block;
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:16,代码来源:OfflineCatalog.php

示例4: testLayoutObjectArgumentUpdatersDirective

 public function testLayoutObjectArgumentUpdatersDirective()
 {
     $layout = new Mage_Core_Model_Layout();
     $layout->getUpdate()->load(array('layout_test_handle_arguments_object_type_updaters'));
     $layout->generateXml()->generateElements();
     $expectedObjectData = array(0 => 'updater call', 1 => 'updater call', 2 => 'updater call');
     $expectedSimpleData = 2;
     $block = $layout->getBlock('block_with_object_updater_args')->getOne();
     $this->assertInstanceOf('Mage_Core_Block_Text', $block);
     $this->assertEquals($expectedObjectData, $block->getUpdaterCall());
     $this->assertEquals($expectedSimpleData, $layout->getBlock('block_with_object_updater_args')->getTwo());
 }
开发者ID:nayanchamp,项目名称:magento2,代码行数:12,代码来源:LayoutArgumentTest.php

示例5: _generateBlockLayoutXML

 protected function _generateBlockLayoutXML($blockName)
 {
     if (self::$_layoutXml == null) {
         self::$_layoutXml = Mage::app()->getLayout()->getUpdate()->asSimplexml();
     }
     $sections = self::$_layoutXml->xpath("//block[@name='{$blockName}'] | //reference[@name='{$blockName}']");
     $layoutXml = '';
     foreach ($sections as $section) {
         $layoutXml .= $this->_generateSubBlockLayoutXml($section);
     }
     $layout = new Mage_Core_Model_Layout();
     $layout->getUpdate()->addUpdate($layoutXml);
     $layout->generateXml();
     $layoutXml = $layout->getXmlString();
     return $layoutXml;
 }
开发者ID:vinayshuklasourcefuse,项目名称:sareez,代码行数:16,代码来源:Abstract.php

示例6: testGetUpdate

 public function testGetUpdate()
 {
     $this->assertInstanceOf('Mage_Core_Model_Layout_Update', $this->_layout->getUpdate());
 }
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:4,代码来源:Layout.php

示例7: testGenerateElementsBroken

 /**
  * @expectedException Magento_Exception
  */
 public function testGenerateElementsBroken()
 {
     $layout = new Mage_Core_Model_Layout();
     $layout->getUpdate()->load('layout_test_handle_remove_broken');
     $layout->generateXml()->generateElements();
 }
开发者ID:nayanchamp,项目名称:magento2,代码行数:9,代码来源:LayoutTest.php

示例8: setUp

 protected function setUp()
 {
     $this->_layout = new Mage_Core_Model_Layout();
     $this->_layout->getUpdate()->addHandle('layout_test_handle_main');
     $this->_layout->getUpdate()->load('layout_test_handle_extra');
 }
开发者ID:nayanchamp,项目名称:magento2,代码行数:6,代码来源:LayoutTestBase.php

示例9: _hasBlockInXml

 /**
  * @param string $blockType
  * @param Mage_Core_Model_Layout $layout
  * @return bool
  */
 protected function _hasBlockInXml($blockType, $layout)
 {
     /* @var $xml Mage_Core_Model_Layout_Element */
     $xml = $layout->getUpdate()->asSimplexml();
     return $blocks = $xml->xpath("//block[@type='{$blockType}']");
 }
开发者ID:xiaoguizhidao,项目名称:ortodon,代码行数:11,代码来源:Observer.php

示例10: addAssets

 public function addAssets(Mage_Core_Model_Layout $layout)
 {
     $head = $layout->getBlock('head');
     $content = $layout->getBlock('content');
     if ($head && $content) {
         $head->addCss('webforms/form.css');
         $head->addJs('prototype/window.js');
         $head->addItem('js_css', 'prototype/windows/themes/default.css');
         $head->addItem('js_css', 'prototype/windows/themes/alphacube.css');
         // logic
         $head->addJs('webforms/logic.js');
         // stars
         $head->addJs('webforms/stars.js');
         $head->addCss('webforms/stars.css');
         // tooltips
         $head->addJs('webforms/HelpBalloon.js');
         $head->addCss('webforms/helpballoon.css');
         // wysiwyg
         $head->addJs('tiny_mce/tiny_mce.js');
         // calendar
         $head->addJs('calendar/calendar.js');
         $head->addJs('calendar/calendar-setup.js');
         $head->addItem('js_css', 'calendar/calendar-blue.css');
         // ajax file uploader
         if (Mage::getStoreConfig('webforms/files/ajax')) {
             if (Mage::getStoreConfig('webforms/files/load_jquery')) {
                 $head->addJs('webforms/jQuery/jquery-1.7.1.min.js');
                 $head->addJs('webforms/jQuery/no-conflict.js');
             }
             $head->addJs('webforms/blueimp/js/vendor/jquery.ui.widget.js');
             $head->addJs('webforms/blueimp/js/jquery.iframe-transport.js');
             $head->addJs('webforms/blueimp/js/jquery.fileupload.js');
             $head->addCss('webforms/file-upload.css');
         }
     }
     if (in_array('cms_page', $layout->getUpdate()->getHandles()) || in_array('webforms_index_index', $layout->getUpdate()->getHandles())) {
         if (!$this->isProduction()) {
             Mage::getSingleton('core/session')->addError($this->getNote());
         }
     }
     // add custom assets
     Mage::dispatchEvent('webforms_add_assets', array('layout' => $layout));
     return $this;
 }
开发者ID:smitmanglam,项目名称:staging,代码行数:44,代码来源:Data.php

示例11: updateLayoutHandles

 public function updateLayoutHandles()
 {
     foreach ($this->layoutHandles as $layoutHandle) {
         $this->layout->getUpdate()->addHandle($layoutHandle);
     }
 }
开发者ID:bennoislost,项目名称:extra-layout-handles,代码行数:6,代码来源:AbstractHandle.php

示例12: _addUpdate

 /**
  * Add a custom layout update.
  * 
  * @param Mage_Core_Model_Layout $layout The current layout instance.
  * @param string                 $xml    The layout update XML.
  *
  * @return void
  */
 protected function _addUpdate(Mage_Core_Model_Layout $layout, $xml)
 {
     $update = simplexml_load_string('<update_xml>' . $xml . '</update_xml>', $layout->getUpdate()->getElementClass());
     $layout->getUpdate()->addUpdate($xml);
 }
开发者ID:n2bh,项目名称:mage-design2,代码行数:13,代码来源:Observer.php


注:本文中的Mage_Core_Model_Layout::getUpdate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。