本文整理匯總了PHP中Magento\Framework\View\Layout::getUpdate方法的典型用法代碼示例。如果您正苦於以下問題:PHP Layout::getUpdate方法的具體用法?PHP Layout::getUpdate怎麽用?PHP Layout::getUpdate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Framework\View\Layout
的用法示例。
在下文中一共展示了Layout::getUpdate方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testGetUpdate
public function testGetUpdate()
{
$themeMock = $this->getMockForAbstractClass('Magento\\Framework\\View\\Design\\ThemeInterface');
$this->themeResolverMock->expects($this->once())->method('get')->will($this->returnValue($themeMock));
$this->processorFactoryMock->expects($this->once())->method('create')->with(['theme' => $themeMock])->will($this->returnValue($this->processorMock));
$this->assertEquals($this->processorMock, $this->model->getUpdate());
$this->assertEquals($this->processorMock, $this->model->getUpdate());
}
示例2: _wrapEsi
/**
* Replace the output of the block, containing ttl attribute, with ESI tag
*
* @param \Magento\Framework\View\Element\AbstractBlock $block
* @param \Magento\Framework\View\Layout $layout
* @return string
*/
protected function _wrapEsi(\Magento\Framework\View\Element\AbstractBlock $block, \Magento\Framework\View\Layout $layout)
{
$url = $block->getUrl('page_cache/block/esi', ['blocks' => json_encode([$block->getNameInLayout()]), 'handles' => json_encode($layout->getUpdate()->getHandles())]);
// Varnish does not support ESI over HTTPS must change to HTTP
$url = substr($url, 0, 5) === 'https' ? 'http' . substr($url, 5) : $url;
return sprintf('<esi:include src="%s" />', $url);
}
示例3: getUpdate
/**
* {@inheritdoc}
*/
public function getUpdate()
{
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'getUpdate');
if (!$pluginInfo) {
return parent::getUpdate();
} else {
return $this->___callPlugins('getUpdate', func_get_args(), $pluginInfo);
}
}
示例4: _wrapEsi
/**
* Replace the output of the block, containing ttl attribute, with ESI tag
*
* @param \Magento\Framework\View\Element\AbstractBlock $block
* @param \Magento\Framework\View\Layout $layout
* @return string
*/
protected function _wrapEsi(\Magento\Framework\View\Element\AbstractBlock $block, \Magento\Framework\View\Layout $layout)
{
$url = $block->getUrl('page_cache/block/esi', ['blocks' => json_encode([$block->getNameInLayout()]), 'handles' => json_encode($layout->getUpdate()->getHandles())]);
return sprintf('<esi:include src="%s" />', $url);
}
示例5: testGetUpdate
public function testGetUpdate()
{
$this->assertInstanceOf('Magento\\Framework\\View\\Layout\\ProcessorInterface', $this->_layout->getUpdate());
}