码迷,mamicode.com
首页 > 其他好文 > 详细

下面我们实现一个新的block应用

时间:2017-03-07 12:45:24      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:hello   文件   xml配置   public   html   xtend   eth   name   htm   

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"/>

下面我们实现一个新的block应用

标签:hello   文件   xml配置   public   html   xtend   eth   name   htm   

原文地址:http://www.cnblogs.com/freeze89/p/6513942.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!