阅读:4009回复:0
Magento 开发后台管理Grids和Forms
In my humble opinion, creating new sections in the Admin Panel are a tad bit more complicated than creating new features on the frontend. Hopefully, this post will help get you a few steps closer to being able to understand and create adminhtml grids and forms.
The first thing you need to do is create a menu item to get to your new grid, then you begin the exciting journey into some Adminhtml action. The Config How about I just throw the whole stinkin’ config.xml file out here right off the bat: 0.1.0 awesome.xml Awesome Menu Item Example Menu Item Super_Awesome_Adminhtml Super_Awesome_Model awesome_mysql4 Super_Awesome_Model_Mysql4 [*]There is a layout file defined (awesome.xml) [*]There is a change to the adminhtml router that tells the route to look in our module before looking into Mage_Adminhtml [*]Everything else is pretty straight-forward (models, resource models, collections, setup, blocks, helpers…) Before I forget, here is the contents of the layout file (design/adminhtml/default/default/layout/awesome.xml): We don’t need to define much in here. The reason I think that Admin Panel coding is a little more complicated is because there is a lot of things that happen behind the scenes that are not driven by the layout as we normally see it. Install Script For testing/example purposes, I also created an install script to create a table and load up some data. In the sql/awesome_setup/mysql4-install-0.1.0.php file, I have: |
|