eidt——grid ---使用bar,和form空间!!!总结---12.28

本文解析了Magento后台编辑配置的实现细节,包括区块定义、模板使用及类的继承关系等。通过对具体XML配置文件和PHP类的分析,帮助读者理解Magento中如何构建和组织表单及其相关组件。

edit grid

牵扯到form的问题,明晚在详细研究。今天吧结构理理。

1.

<profile_adminhtml_profile_edit>

<update handle="editor"/>

<reference name="content">

<block type="profile/adminhtml_profile_edit" name="profile_edit"></block>

</reference>

<reference name="left">

<block type="profile/adminhtml_profile_edit_tabs" name="profile_edit_tabs">

<block type="profile/adminhtml_profile_edit_tab_main" name="profile_edit_tab_main" />

<block type="profile/adminhtml_profile_edit_tab_meta" name="profile_edit_tab_meta" />

<action method="addTab"><name>main_section</name><block>profile_edit_tab_main</block></action>

<action method="addTab"><name>meta_section</name><block>profile_edit_tab_meta</block></action>

</block>

</reference>

</profile_adminhtml_profile_edit>

结构为:content(profile_edit)里面包含left(profile_edit_tabs) 和form,form是个空间,在content中存在

大致这样。

2

<block type="profile/adminhtml_profile_edit" name="profile_edit"></block>

template

widget/form/container.phtml

type对应的 RichardMason_Profile_Block_Adminhtml_Profile_Edit extends Mage_Adminhtml_Block_Widget_Form_Container

其实就是一个widget-form-container

3

RichardMason_Profile_Block_Adminhtml_Profile_Edit

public function __construct()

{

$this->_objectId = 'profile_id';

$this->_blockGroup = 'profile';

$this->_controller = 'adminhtml_profile';

parent::__construct();

$this->addButton();

public function getHeaderText()

protected function _isAllowedAction($action)

4

$this->getFormHtml()

<div class="entry-edit">

<?php echo $this->getFormHtml();?>

</div>

public function getFormHtml()

{ //$this->_children[$name];

$this->getChild('form')->setData('action', $this->getSaveUrl());

return $this->getChildHtml('form');

}

class RichardMason_Profile_Block_Adminhtml_Profile_Edit_Form extends Mage_Adminhtml_Block_Widget_Form

{

protected function _prepareForm()

{

$form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post', 'enctype' => 'multipart/form-data'));

$form->setUseContainer(true);

$this->setForm($form);

return parent::_prepareForm();

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值