开发者_运维知识库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.
精彩评论