1. 定义一个新的block文件:
appcodecoreMageCustomerBlockFormRegister1.php
class Mage_Customer_Block_Form_Register1 extends Mage_Directory_Block_Data{
public function getHello(){
return "Hello Block";
}
}
2. 定义template文件:
appdesignfrontenddefaultdefault emplatecustomerform egister1.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"/>