已调用Magento表单块,但无法在phtml中访问函数
我有一个街区已调用Magento表单块,但无法在phtml中访问函数,magento,Magento,我有一个街区 app/code/local/Company/Club/Block/Adminhtml/Edit/Form.php class Company_Club_Block_Adminhtml_Edit_Form extends Mage_Adminhtml_Block_Widget_Form { public function getSubmitUrl() { die; //this is never reached return $th
app/code/local/Company/Club/Block/Adminhtml/Edit/Form.php
class Company_Club_Block_Adminhtml_Edit_Form extends Mage_Adminhtml_Block_Widget_Form {
public function getSubmitUrl()
{
die; //this is never reached
return $this->getUrl('company_club/Customer/Save');
}
}
我在控制器中调用它:
public function AddAction()
{
$this->loadLayout();
$this->_addContent($this->getLayout()->createBlock('company_club/adminhtml_edit_form'));
$this->renderLayout();
}
它指的是一个布局
<company_club_customer_add>
<update handle="main_club_update"/>
<reference name="root">
<block type="company_club/adminhtml_edit_form" name="addClubCustomer"/>
<action method="setTemplate">
<template>Club/Customer/Add.phtml</template>
</action>
</reference>
</company_club_customer_add>
俱乐部/客户/Add.phtml
phtml显示良好并调用
<form action="<?php echo $this->getSubmitUrl(); ?>" method="POST" name="formCustomer" id="formCustomer">
我做了一个丑陋的修复,但我无法检测到控制器的修改:
$form = new Company_Club_Block_Adminhtml_Edit_Form();
<?php echo $form->getSubmitUrl(); ?>
$form=new Company\u Club\u Block\u Adminhtml\u Edit\u form();