本文整理汇总了PHP中Mage_Core_Model_Layout类的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Layout类的具体用法?PHP Mage_Core_Model_Layout怎么用?PHP Mage_Core_Model_Layout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mage_Core_Model_Layout类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: testGetMethodsNoChild
public function testGetMethodsNoChild()
{
$layout = new Mage_Core_Model_Layout();
$block = $layout->createBlock('Mage_Checkout_Block_Cart');
$methods = $block->getMethods('child');
$this->assertEquals(array(), $methods);
}
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:7,代码来源:Cart.php
示例2: testGetMassactionBlock
public function testGetMassactionBlock()
{
$layout = new Mage_Core_Model_Layout();
$block = $layout->createBlock('Mage_Adminhtml_Block_Widget_Grid', 'block');
$child = $layout->addBlock('Mage_Core_Block_Template', 'massaction', 'block');
$this->assertSame($child, $block->getMassactionBlock());
}
开发者ID:nemphys,项目名称:magento2,代码行数:7,代码来源:GridTest.php
示例3: testGetGridJsObject
/**
* @magentoAppIsolation enabled
*/
public function testGetGridJsObject()
{
Mage::register('current_product', new Varien_Object());
$layout = new Mage_Core_Model_Layout();
$block = $layout->createBlock('Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config', 'block');
$this->assertEquals('super_product_linksJsObject', $block->getGridJsObject());
}
开发者ID:nemphys,项目名称:magento2,代码行数:10,代码来源:ConfigTest.php
示例4: testGetAdditionalActionBlock
public function testGetAdditionalActionBlock()
{
$layout = new Mage_Core_Model_Layout();
$block = $layout->createBlock('Mage_Adminhtml_Block_Widget_Grid_Massaction_Item', 'block');
$expected = $layout->addBlock('Mage_Core_Block_Template', 'additional_action', 'block');
$this->assertSame($expected, $block->getAdditionalActionBlock());
}
开发者ID:nemphys,项目名称:magento2,代码行数:7,代码来源:ItemTest.php
示例5: showAddressFields
/**
* @param Mage_Core_Model_Layout
*/
protected function showAddressFields(Mage_Core_Model_Layout $layout)
{
$registerForm = $layout->getBlock('customer_form_register');
if ($registerForm instanceof Mage_Core_Block_Abstract) {
$registerForm->setShowAddressFields(true);
}
}
开发者ID:ryaan-anthony,项目名称:magento-register-with-address,代码行数:10,代码来源:Observer.php
示例6: setUp
protected function setUp()
{
$this->_layoutMock = Mage::getModel('Mage_Core_Model_Layout');
$this->_block = $this->_layoutMock->createBlock('Mage_Backend_Block_Widget_Grid_Extended', 'grid', array('layout' => $this->_layoutMock));
$this->_block->addColumn('column1', array('id' => 'columnId1'));
$this->_block->addColumn('column2', array('id' => 'columnId2'));
}
开发者ID:,项目名称:,代码行数:7,代码来源:
示例7: setUp
protected function setUp()
{
$customer = new Mage_Customer_Model_Customer();
$customer->load(1);
Mage::register('current_customer', $customer);
$layout = new Mage_Core_Model_Layout(array('area' => 'adminhtml'));
$this->_block = $layout->createBlock('Mage_Adminhtml_Block_Customer_Edit_Tab_View_Accordion');
}
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:8,代码来源:Accordion.php
示例8: _getFormInstance
/**
* Get form instance
*
* @param array $args
* @return Varien_Data_Form
*/
protected function _getFormInstance($args = array())
{
$layout = new Mage_Core_Model_Layout();
/** @var $block Mage_Adminhtml_Block_Urlrewrite_Cms_Page_Edit_Form */
$block = $layout->createBlock('Mage_Adminhtml_Block_Urlrewrite_Cms_Page_Edit_Form', 'block', $args);
$block->toHtml();
return $block->getForm();
}
开发者ID:nemphys,项目名称:magento2,代码行数:14,代码来源:FormTest.php
示例9: testGetHeaderText
/**
* @param $registryData
* @param $expected
* @dataProvider getStoreDataForBlock
*/
public function testGetHeaderText($registryData, $expected)
{
$this->_initStoreTypesInRegistry($registryData);
$layout = new Mage_Core_Model_Layout();
$block = $layout->createBlock('Mage_Adminhtml_Block_System_Store_Edit', 'block');
$block->setArea(Mage_Core_Model_App_Area::AREA_ADMINHTML);
$this->assertEquals($expected, $block->getHeaderText());
}
开发者ID:nemphys,项目名称:magento2,代码行数:13,代码来源:EditTest.php
示例10: testToHtmlFormId
public function testToHtmlFormId()
{
$layout = new Mage_Core_Model_Layout();
$block = $layout->createBlock('Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Type_Select', 'select');
$html = $block->getPriceTypeSelectHtml();
$this->assertContains('select_{{select_id}}', $html);
$this->assertContains('[{{select_id}}]', $html);
}
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:8,代码来源:Select.php
示例11: testGetColumns
public function testGetColumns()
{
$layout = new Mage_Core_Model_Layout();
$block = $layout->addBlock('Mage_Wishlist_Block_Customer_Wishlist_Items', 'test');
$child = $this->getMock('Mage_Core_Block_Text', array('isEnabled'));
$child->expects($this->any())->method('isEnabled')->will($this->returnValue(true));
$layout->addBlock($child, 'child', 'test');
$this->assertSame(array($child), $block->getColumns());
}
开发者ID:nemphys,项目名称:magento2,代码行数:9,代码来源:ItemsTest.php
示例12: testSetListOrders
public function testSetListOrders()
{
$layout = new Mage_Core_Model_Layout();
$layout->addBlock('Mage_Core_Block_Text', 'head');
// The tested block is using head block
$block = $layout->addBlock('Mage_CatalogSearch_Block_Result', 'block');
$childBlock = $layout->addBlock('Mage_Core_Block_Text', 'search_result_list', 'block');
$this->assertSame($childBlock, $block->getListBlock());
}
开发者ID:nemphys,项目名称:magento2,代码行数:9,代码来源:ResultTest.php
示例13: testGetMode
public function testGetMode()
{
$layout = new Mage_Core_Model_Layout();
$layout->addBlock($this->_block, 'test');
$expected = uniqid();
$toolbar = new Mage_Core_Block_Text(array('current_mode' => $expected));
$layout->addBlock($toolbar, 'toolbar', 'test');
$this->assertEquals($expected, $this->_block->getMode());
}
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:9,代码来源:View.php
示例14: testPrepareLayout
/**
* Test prepare layout
*
* @dataProvider prepareLayoutDataProvider
*
* @param array $blockAttributes
* @param array $expected
*/
public function testPrepareLayout($blockAttributes, $expected)
{
$layout = new Mage_Core_Model_Layout(array('area' => Mage_Core_Model_App_Area::AREA_ADMINHTML));
/** @var $block Mage_Adminhtml_Block_Urlrewrite_Edit */
$block = $layout->createBlock('Mage_Adminhtml_Block_Urlrewrite_Edit', '', $blockAttributes);
$this->_checkSelector($block, $expected);
$this->_checkButtons($block, $expected);
$this->_checkForm($block, $expected);
}
开发者ID:nayanchamp,项目名称:magento2,代码行数:17,代码来源:EditTest.php
示例15: performUploadButtonTest
/**
* Reuse code for testing getUploadButtonHtml()
*
* @param Mage_Core_Block_Abstract $block
*/
public static function performUploadButtonTest(Mage_Core_Block_Abstract $block)
{
$layout = new Mage_Core_Model_Layout();
$layout->addBlock($block, 'links');
$expected = uniqid();
$text = new Mage_Core_Block_Text(array('text' => $expected));
$layout->addBlock($text, 'upload_button', 'links');
self::assertEquals($expected, $block->getUploadButtonHtml());
}
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:14,代码来源:Links.php
示例16: setUp
protected function setUp()
{
$this->_block = new Mage_Tag_Block_Product_Result();
$this->_layout = new Mage_Core_Model_Layout();
$this->_layout->addBlock('Mage_Core_Block_Text', 'root');
$this->_layout->addBlock('Mage_Core_Block_Text', 'head');
$this->_layout->addBlock($this->_block, 'test');
$this->_child = new Mage_Core_Block_Text();
$this->_layout->addBlock($this->_child, 'search_result_list', 'test');
}
开发者ID:nemphys,项目名称:magento2,代码行数:10,代码来源:ResultTest.php
示例17: _buildBlock
/**
* Composes a container with several buttons in it
*
* @param array $titles
* @return Mage_Adminhtml_Block_Widget_Container
*/
protected function _buildBlock($titles)
{
$layout = new Mage_Core_Model_Layout();
$block = new Mage_Adminhtml_Block_Widget_Container();
foreach ($titles as $id => $title) {
$block->addButton($id, array('title' => $title));
}
$layout->addBlock($block, 'block');
return $block;
}
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:16,代码来源:Container.php
示例18: testAddTab
/**
* @magentoAppIsolation enabled
*/
public function testAddTab()
{
$widgetInstance = new Mage_Widget_Model_Widget_Instance();
Mage::register('current_widget_instance', $widgetInstance);
$layout = new Mage_Core_Model_Layout();
$block = $layout->createBlock('Mage_Adminhtml_Block_Widget_Tabs', 'block');
$layout->addBlock('Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tab_Main', 'child_tab', 'block');
$block->addTab('tab_id', 'child_tab');
$this->assertEquals(array('tab_id'), $block->getTabsIds());
}
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:13,代码来源:Tabs.php
示例19: testGetPagerHtml
public function testGetPagerHtml()
{
$layout = new Mage_Core_Model_Layout();
$block = $layout->createBlock('Mage_Catalog_Block_Product_List_Toolbar', 'block');
$childBlock = $layout->addBlock('Mage_Core_Block_Text', 'product_list_toolbar_pager', 'block');
$expectedHtml = '<b>Any text there</b>';
$this->assertNotEquals($expectedHtml, $block->getPagerHtml());
$childBlock->setText($expectedHtml);
$this->assertEquals($expectedHtml, $block->getPagerHtml());
}
开发者ID:nemphys,项目名称:magento2,代码行数:10,代码来源:ToolbarTest.php
示例20: testGetShowQueueAdd
public function testGetShowQueueAdd()
{
$layout = new Mage_Core_Model_Layout();
$block = $layout->createBlock('Mage_Adminhtml_Block_Newsletter_Subscriber', 'block');
$childBlock = $layout->addBlock('Mage_Core_Block_Template', 'grid', 'block');
$expected = 'test_data';
$this->assertNotEquals($expected, $block->getShowQueueAdd());
$childBlock->setShowQueueAdd($expected);
$this->assertEquals($expected, $block->getShowQueueAdd());
}
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:10,代码来源:Subscriber.php
注:本文中的Mage_Core_Model_Layout类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论