Magento 开发 (二)

接着上一篇内容,添加控制器,php

一、新建文件以及文件夹:/app/code/local/Develop/News/controllers/IndexController.php浏览器

                                                  /app/code/local/Develop/News/etc/config.xmlapp

二、添加内容:IndexController.phpfrontend

<?php 
class Develop_News_IndexController extends Mage_Core_Controller_Front_Action {
    public function indexAction(){
        echo "Hello World!!!";
    }
}code

config.xmlrouter

<?xml version="1.0"?>
<config>
    <!--  -->
    <modules>
        <Develop_News>
            <version>0.1.0</version>
        </Develop_News>        
    </modules>
    
    <frontend>
        <routers>
            <news>
                <use>standard</use>
                <args>
                    <module>Develop_News</module>
                    <frontName>news</frontName>
                </args>
            </news>
        </routers>
    </frontend>
</config>xml

浏览器打开地址:magento.com/news
 io

相关文章
相关标签/搜索