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


PHP Mage_Core_Model_Layout::createBlock方法代码示例

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


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

示例1: setUp

 public function setUp()
 {
     $this->_profile = Mage::getModel('Mage_Sales_Model_Recurring_Profile');
     Mage::register('current_recurring_profile', $this->_profile);
     $this->_layout = Mage::getModel('Mage_Core_Model_Layout');
     $this->_block = $this->_layout->createBlock('Mage_Sales_Block_Recurring_Profile_View', 'block');
 }
开发者ID:,项目名称:,代码行数:7,代码来源:

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例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: getStaticBlock

 /**
  * Loads a Magento CMS static block
  * 
  * @param  string $identifier Key of CMS block
  * 
  * @return string|boolean
  */
 public static function getStaticBlock($identifier)
 {
     $block = self::$layout->createBlock('cms/block')->setBlockId($identifier)->toHtml();
     if ($block) {
         return $block;
     }
     return false;
 }
开发者ID:steverobbins,项目名称:magento-integration,代码行数:15,代码来源:magento-integration.php

示例9: 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

示例10: _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

示例11: 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

示例12: 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

示例13: 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

示例14: testSetClassType

 public function testSetClassType()
 {
     $layout = new Mage_Core_Model_Layout();
     $block = $layout->createBlock('Mage_Adminhtml_Block_Tax_Class', 'block');
     $childBlock = $layout->addBlock('Mage_Core_Block_Template', 'grid', 'block');
     $expected = Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT;
     $this->assertNotEquals($expected, $childBlock->getClassType());
     $block->setClassType($expected);
     $this->assertEquals($expected, $childBlock->getClassType());
 }
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:10,代码来源:Class.php

示例15: testToHtmlHasIndex

 /**
  * @magentoAppIsolation enabled
  */
 public function testToHtmlHasIndex()
 {
     Mage::getDesign()->setArea(Mage_Core_Model_App_Area::AREA_ADMINHTML);
     $layout = new Mage_Core_Model_Layout(array('area' => Mage_Core_Model_App_Area::AREA_ADMINHTML));
     $block = $layout->createBlock('Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle_Option_Search', 'block');
     $indexValue = 'magento_index_set_to_test';
     $block->setIndex($indexValue);
     $html = $block->toHtml();
     $this->assertContains($indexValue, $html);
 }
开发者ID:nayanchamp,项目名称:magento2,代码行数:13,代码来源:SearchTest.php


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