1.
Controller
Public Function editaction (){
$ Id = $ this-> getrequest ()-> getparam ('id ');
$ Model = Mage: GetModel ('blog/blog ')-> load ($ id );
If ($ model-> GETID () | $ id = 0 ){
$ DATA = Mage: getsingleton ('adminhtml/session')-> getformdata (true );
If (! Empty ($ data )){
$ Model-> setdata ($ data );
}
Mage: Register ('gao _ data', $ model );
$ This-> loadlayout ();
// $ This-> setactivemenu ('terrytest11/Bao ');
$ This-> _ addcontent ($ this-> getlayout ()-> createblock ('gao/manage_gao_edit '))
-> _ Addleft ($ this-> getlayout ()-> createblock ('gao/manage_gao_edit_tabs '));
$ This-> renderlayout ();
} Else {
Mage: getsingleton ('adminhtml/session')-> adderror (Mage: helper ('blog ')->__ ('Post does not
Exist '));
$ This-> _ redirect ('*/*/');
}
2.
And then the new feature block
AQ/GAO/block/manage/GAO/edit/TAB/form. php
AQ/GAO/block/manage/GAO/edit/TAB/options. php
Add it to the protected function _ prepareform () method.
If (Mage: getsingleton ('adminhtml/session')-> getgaodata ())
{
$ Form-> setvalues (Mage: getsingleton ('adminhtml/session')-> getgaodata ());
Mage: getsingleton ('adminhtml/session')-> setgaodata (null );
} Elseif (Mage: Registry ('gao _ data ')){
$ Form-> setvalues (Mage: Registry ('gao _ data')-> getdata ());
}