本文整理汇总了PHP中Magento\Framework\View\Layout::isManipulationAllowed方法的典型用法代码示例。如果您正苦于以下问题:PHP Layout::isManipulationAllowed方法的具体用法?PHP Layout::isManipulationAllowed怎么用?PHP Layout::isManipulationAllowed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\View\Layout
的用法示例。
在下文中一共展示了Layout::isManipulationAllowed方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testIsManipulationAllowed
/**
* @param bool $parentName
* @param array $containerConfig
* @param bool $result
* @dataProvider isManipulationAllowedDataProvider
*/
public function testIsManipulationAllowed($parentName, $containerConfig, $result)
{
$elementName = 'element_name';
$this->structureMock->expects($this->once())->method('getParentId')->with($this->equalTo($elementName))->will($this->returnValue($parentName));
if ($parentName) {
$this->structureMock->expects($this->once())->method('hasElement')->with($this->equalTo($parentName))->will($this->returnValue($containerConfig['has_element']));
if ($containerConfig['has_element']) {
$this->structureMock->expects($this->once())->method('getAttribute')->with($this->equalTo($parentName), $this->equalTo('type'))->will($this->returnValue($containerConfig['attribute']));
}
}
$this->assertSame($result, $this->model->isManipulationAllowed($elementName));
}
示例2: testIsManipulationAllowed
public function testIsManipulationAllowed()
{
$this->_layout->addBlock('Magento\\Framework\\View\\Element\\Text', 'block1');
$this->_layout->addBlock('Magento\\Framework\\View\\Element\\Text', 'block2', 'block1');
$this->assertFalse($this->_layout->isManipulationAllowed('block1'));
$this->assertFalse($this->_layout->isManipulationAllowed('block2'));
$this->_layout->addContainer('container1', 'Container 1');
$this->_layout->addBlock('Magento\\Framework\\View\\Element\\Text', 'block3', 'container1');
$this->_layout->addContainer('container2', 'Container 2', [], 'container1');
$this->assertFalse($this->_layout->isManipulationAllowed('container1'));
$this->assertTrue($this->_layout->isManipulationAllowed('block3'));
$this->assertTrue($this->_layout->isManipulationAllowed('container2'));
}
示例3: isManipulationAllowed
/**
* {@inheritdoc}
*/
public function isManipulationAllowed($name)
{
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'isManipulationAllowed');
if (!$pluginInfo) {
return parent::isManipulationAllowed($name);
} else {
return $this->___callPlugins('isManipulationAllowed', func_get_args(), $pluginInfo);
}
}