1. 定义一个新的block文件:
app\code\core\Mage\Customer\Block\Form\Register1.php
class Mage_Customer_Block_Form_Register1 extends Mage_Directory_Block_Data{
public function getHello(){
return "Hello Block";
}
}
2. 定义template文件:
app\design\frontend\default\default\template\customer\form\register1.phtml
Html代码:
<?php echo $this->getHello(); ?>
3. 修改customer.xml配置
将Xml代码
<block type="customer/form_register" name="customer_form_register" template="customer/form/register.phtml"/>
修改为:
<block type="customer/form_register1" name="customer_form_register1" template="customer/form/register1.phtml"/>
时间: 2024-11-06 12:25:31