开发者

What Arguments are Used in Createblock() method Of Magento?

开发者 https://www.devze.com 2023-04-12 11:29 出处:网络
开发者_运维知识库I am trying to create an simple form in magento Backend (Admin Side).. I want to display a button \"Add New\" on right side of it.

开发者_运维知识库I am trying to create an simple form in magento Backend (Admin Side).. I want to display a button "Add New" on right side of it. I have used the following code

$this->loadLayout() ->_addContent($this->getLayout()->createBlock('namespace_mymodule')) ->renderLayout();

But its not working... I don't know what exactly are the arguments that i need to pass in CreateBlock() method.. I have just Can Anyone Help me with this...


The createBlock($class_string) method creates an instance of a block, much in the same way that Mage::getModel($class_string) and Mage::helper($class_string) create instances of models and helpers, respectively.

To create a simple form, you'll need to associate your block with a template, which you can do by calling the ->setTemplate($template_file) method on your newly created block. Other than that, we're going to need more information to help.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号