Skip to content

Instantly share code, notes, and snippets.

@xcommerce-gists
Created January 25, 2014 15:37
Show Gist options
  • Save xcommerce-gists/8618162 to your computer and use it in GitHub Desktop.
Save xcommerce-gists/8618162 to your computer and use it in GitHub Desktop.
Sample Magento administrative edit form block
<?php
/**
* News List admin edit form block
*
* @author Magento
*/
class Magentostudy_News_Block_Adminhtml_News_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
{
/**
* Prepare form action
*
* @return Magentostudy_News_Block_Adminhtml_News_Edit_Form
*/
protected function _prepareForm()
{
$form = new Varien_Data_Form(array(
'id' => 'edit_form',
'action' => $this->getUrl('*/*/save'),
'method' => 'post',
'enctype' => 'multipart/form-data'
));
$form->setUseContainer(true);
$this->setForm($form);
return parent::_prepareForm();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment