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


PHP LayoutInterface::getUpdate方法代码示例

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


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

示例1: setUp

 protected function setUp()
 {
     $this->markTestIncomplete('MAGETWO-6406');
     parent::setUp();
     $this->_setFixtureTheme();
     $this->_layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Framework\\View\\LayoutInterface', ['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:shabbirvividads,项目名称:magento2,代码行数:11,代码来源:MassactionTest.php

示例2: loadLayoutUpdates

 /**
  * Load layout updates
  *
  * @return $this
  */
 protected function loadLayoutUpdates()
 {
     Profiler::start('LAYOUT');
     /* dispatch event for adding handles to layout update */
     $this->eventManager->dispatch('layout_load_before', ['full_action_name' => $this->request->getFullActionName(), 'layout' => $this->layout]);
     Profiler::start('layout_load');
     /* load layout updates by specified handles */
     $this->layout->getUpdate()->load();
     Profiler::stop('layout_load');
     Profiler::stop('LAYOUT');
     return $this;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:17,代码来源:Builder.php

示例3: setUp

 protected function setUp()
 {
     $this->markTestIncomplete('MAGETWO-6406');
     parent::setUp();
     $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
     /** @var \Magento\Theme\Model\Theme\Registration $registration */
     $registration = $objectManager->get('Magento\\Theme\\Model\\Theme\\Registration');
     $registration->register();
     $objectManager->get('Magento\\Framework\\View\\DesignInterface')->setDesignTheme('BackendTest/test_default');
     $this->_layout = $objectManager->create('Magento\\Framework\\View\\LayoutInterface', ['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');
     $this->assertNotFalse($this->_block, 'Could not load the block for testing');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:16,代码来源:MassactionTest.php

示例4: testInitProductLayout

 /**
  * @magentoAppIsolation enabled
  * @magentoAppArea frontend
  */
 public function testInitProductLayout()
 {
     $uniqid = uniqid();
     /** @var $product \Magento\Catalog\Model\Product */
     $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Catalog\\Model\\Product');
     $product->setTypeId(\Magento\Catalog\Model\Product\Type::DEFAULT_TYPE)->setId(99)->setUrlKey($uniqid);
     /** @var $objectManager \Magento\TestFramework\ObjectManager */
     $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
     $objectManager->get('Magento\\Framework\\Registry')->register('product', $product);
     $this->_helper->initProductLayout($product, $this->_controller);
     $rootBlock = $this->_layout->getBlock('root');
     $this->assertInstanceOf('Magento\\Theme\\Block\\Html', $rootBlock);
     $this->assertContains("product-{$uniqid}", $rootBlock->getBodyClass());
     $handles = $this->_layout->getUpdate()->getHandles();
     $this->assertContains('catalog_product_view_type_simple', $handles);
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:20,代码来源:ViewTest.php

示例5: testInitProductLayout

 /**
  * @magentoAppIsolation enabled
  * @magentoAppArea frontend
  */
 public function testInitProductLayout()
 {
     $uniqid = uniqid();
     /** @var $product \Magento\Catalog\Model\Product */
     $product = $this->objectManager->create('Magento\\Catalog\\Model\\Product');
     $product->setTypeId(\Magento\Catalog\Model\Product\Type::DEFAULT_TYPE)->setId(99)->setUrlKey($uniqid);
     /** @var $objectManager \Magento\TestFramework\ObjectManager */
     $objectManager = $this->objectManager;
     $objectManager->get('Magento\\Framework\\Registry')->register('product', $product);
     $this->_helper->initProductLayout($product, $this->_controller);
     /** @var \Magento\Framework\View\Page\Config $pageConfig */
     $pageConfig = $this->objectManager->get('Magento\\Framework\\View\\Page\\Config');
     $bodyClass = $pageConfig->getElementAttribute(\Magento\Framework\View\Page\Config::ELEMENT_TYPE_BODY, 'classes');
     $this->assertContains("product-{$uniqid}", $bodyClass);
     $handles = $this->_layout->getUpdate()->getHandles();
     $this->assertContains('catalog_product_view_type_simple', $handles);
 }
开发者ID:aiesh,项目名称:magento2,代码行数:21,代码来源:ViewTest.php

示例6: getCurrentPageLayout

 /**
  * Retrieve current applied page layout
  *
  * @return \Magento\Framework\Object|boolean
  */
 public function getCurrentPageLayout()
 {
     if ($this->_layout->getBlock('root') && $this->_layout->getBlock('root')->getLayoutCode()) {
         return $this->_config->getPageLayout($this->_layout->getBlock('root')->getLayoutCode());
     }
     // All loaded handles
     $handles = $this->_layout->getUpdate()->getHandles();
     // Handles used in page layouts
     $pageLayoutHandles = $this->_config->getPageLayoutHandles();
     // Applied page layout handles
     $appliedHandles = array_intersect($handles, $pageLayoutHandles);
     if (empty($appliedHandles)) {
         return false;
     }
     $currentHandle = array_pop($appliedHandles);
     $layoutCode = array_search($currentHandle, $pageLayoutHandles, true);
     return $this->_config->getPageLayout($layoutCode);
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:23,代码来源:Layout.php

示例7: loadLayout

 /**
  * Load layout
  *
  * @return void
  */
 public function loadLayout()
 {
     $this->layout->getUpdate()->load();
     $this->layout->generateXml();
     $this->layout->generateElements();
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:11,代码来源:Layout.php


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