做一个在后台显示的内容的简单模块
2011-01-27 10:04
417 查看
在menu做好的基础上!!!!
1
app/etc/modules
2
app/code/community/AQ/Gao/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<AQ_Gao>
<version>0.1.21</version>
</AQ_Gao>
</modules>
<frontend>
<routers>
<gao>
<use>standard</use>
<args>
<module>AQ_Gao</module>
<frontName>gao</frontName>
</args>
</gao>
</routers>
</frontend>
<admin>
<routers>
<gao_admin>
<use>admin</use>
<args>
<module>AQ_Gao</module>
<frontName>gao_admin</frontName>
</args>
</gao_admin>
</routers>
</admin>
<adminhtml>
<layout>
<updates>
<gao>
<file>aq_gao.xml</file>
</gao>
</updates>
</layout>
</adminhtml>
<global>
<helpers>
<gao>
<class>AQ_Gao_Helper</class>
</gao>
</helpers>
<blocks>
<gao>
<class>AQ_Gao_Block</class>
</gao>
</blocks>
</global>
</config>
在此文件中,blocks,helps,adminhtml(xml文件),admin--routers都是必须要有的。
3
app/code/community/AQ/Gao/etc/adminhtml.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<menu>
<gao module="gao">
<title>TerryTest11</title>
<sort_order>51</sort_order>
<children>
<aa module="gao">
<title>Bao</title>
<sort_order>0</sort_order>
<action>gao_admin/index/bao</action>
</aa>
<posts module="gao">
<title>Kun</title>
<sort_order>1</sort_order>
<action>gao_admin/index/kun</action>
</posts>
</children>
</gao>
</menu>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<gao>
<title>TerryTest11</title>
<sort_order>51</sort_order>
<children>
<aa>
<title>Bao</title>
<sort_order>0</sort_order>
</aa>
<posts>
<title>Kun</title>
<sort_order>1</sort_order>
</posts>
</children>
</gao>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<gao>
<file>aq_gao.xml</file>
</gao>
</updates>
</layout>
</config>
配置好!
4
app/design/adminhtml/default/default/layout/aq_gao.xml
<?xml version="1.0" ?>
<layout version="0.1.0">
<default>
<reference name="head">
</reference>
</default>
<gao_admin_index_bao>
<update handle="editor" />
<reference name="content">
<block type="core/template" name="index" template="gao/terry.phtml" />
</reference>
</gao_admin_index_bao>
</layout>
5
app/design/adminhtml/default/default/template/gao/terry.phtml
<div>
good.very good!
</div>
进入后台访问,可以看到内容部分显示出来“good.very good!”,OK!
1
app/etc/modules
2
app/code/community/AQ/Gao/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<AQ_Gao>
<version>0.1.21</version>
</AQ_Gao>
</modules>
<frontend>
<routers>
<gao>
<use>standard</use>
<args>
<module>AQ_Gao</module>
<frontName>gao</frontName>
</args>
</gao>
</routers>
</frontend>
<admin>
<routers>
<gao_admin>
<use>admin</use>
<args>
<module>AQ_Gao</module>
<frontName>gao_admin</frontName>
</args>
</gao_admin>
</routers>
</admin>
<adminhtml>
<layout>
<updates>
<gao>
<file>aq_gao.xml</file>
</gao>
</updates>
</layout>
</adminhtml>
<global>
<helpers>
<gao>
<class>AQ_Gao_Helper</class>
</gao>
</helpers>
<blocks>
<gao>
<class>AQ_Gao_Block</class>
</gao>
</blocks>
</global>
</config>
在此文件中,blocks,helps,adminhtml(xml文件),admin--routers都是必须要有的。
3
app/code/community/AQ/Gao/etc/adminhtml.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<menu>
<gao module="gao">
<title>TerryTest11</title>
<sort_order>51</sort_order>
<children>
<aa module="gao">
<title>Bao</title>
<sort_order>0</sort_order>
<action>gao_admin/index/bao</action>
</aa>
<posts module="gao">
<title>Kun</title>
<sort_order>1</sort_order>
<action>gao_admin/index/kun</action>
</posts>
</children>
</gao>
</menu>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<gao>
<title>TerryTest11</title>
<sort_order>51</sort_order>
<children>
<aa>
<title>Bao</title>
<sort_order>0</sort_order>
</aa>
<posts>
<title>Kun</title>
<sort_order>1</sort_order>
</posts>
</children>
</gao>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<gao>
<file>aq_gao.xml</file>
</gao>
</updates>
</layout>
</config>
配置好!
4
app/design/adminhtml/default/default/layout/aq_gao.xml
<?xml version="1.0" ?>
<layout version="0.1.0">
<default>
<reference name="head">
</reference>
</default>
<gao_admin_index_bao>
<update handle="editor" />
<reference name="content">
<block type="core/template" name="index" template="gao/terry.phtml" />
</reference>
</gao_admin_index_bao>
</layout>
5
app/design/adminhtml/default/default/template/gao/terry.phtml
<div>
good.very good!
</div>
进入后台访问,可以看到内容部分显示出来“good.very good!”,OK!
相关文章推荐
- 做一个在后台显示的内容的简单模块
- 4-1:编写一个简单的留言簿,写入留言提交后显示留言内容。
- Android 关于在ScrollView中加上一个ListView,ListView内容显示不完全(总是显示第一项)的问题的两种简单的解决方案
- 一个具有简单的“删除整行”、“修改单元格内容”、“确定并显示修改过后的内容”的表格
- Android 关于在ScrollView中加上一个ListView,ListView内容显示不完全(总是显示第一项)的问题的两种简单的解决方案
- 最简单的一个网页倒计时代码 时间到期后会显示出提醒内容 收藏版
- 一个简单的用javascript实现的页面内容过滤显示小程序源码
- 一个简单的用javascript实现的页面内容过滤显示小程序源码
- 重新想象 Windows 8 Store Apps (64) - 后台任务: 开发一个简单的后台任务
- 概述如何实现一个简单的浏览器端js模块加载器
- 脚本复杂又简单--一个菜单模块
- 汇编语言:将一个数据段中的内容复制到另一个数据段 并显示出来
- 织梦后台内容编辑器不显示
- 更新模块通知栏显看不到当前进度,以及更新下载中可以清理通知问题,华为强制更新退出软件后台下载不显示通知问题
- 一个简单的后台与数据库交互的登录与注册[sql注入处理、以及MD5加密]
- 驱动开发之六 --- 一个简单的显示驱动之二 【译文】
- 通过js简单实现将一个文本内容转译成加密文本
- 编写一个简易的留言薄,实现添加留言和显示留言内容等功能
- aix英文版导出excel单元格内容显示不全简单解决方法
- 一个简单的可移植 模块/系统动态内存 跟踪方法