Module declaration |
Filename: app/etc/modules/Mage_Sintax.xml
true local
Module configuration file |
Filename: app/code/local/Mage/Sintax/etc/config.xml
0.1.0 Mage_Sintax_Model sintax_mysql4 Mage_Sintax_Model_Mysql4 Mage_Sintax_Block Mage_Sintax_Helper Mage_Sintax sintax Mage_Sintax.csv My Form sintax.xml
Controller |
Filename: app/code/local/Mage/Sintax/controllers/Adminhtml/MyformController.php
loadLayout()->renderLayout(); } public function postAction() { $post = $this->getRequest()->getPost(); try { if (empty($post)) { Mage::throwException($this->__('Invalid form data.')); } /* here's your form processing */ $message = $this->__('Your form has been submitted successfully.'); Mage::getSingleton('adminhtml/session')->addSuccess($message); } catch (Exception $e) { Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); } $this->_redirect('*/*'); }}
Form block |
Filename: app/code/local/Mage/Sintax/Block/Myform.php
// this step is optional
Layout updates for your form |
Filename: app/design/adminhtml/default/default/layout/sintax.xml
Form template |
Filename: app/design/adminhtml/default/default/template/sintax/myform.phtml
__('My form title')?>
Translations |
Filename: app/locale/en_US/Mage_Sintax.csv
// this step is optional
Helper |
Filename: app/code/local/Mage/Sintax/Helper/Data.php