接着上一篇內容,添加控制器,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