https://docs.joomla.org/J3.x:Creating_a_simple_module/Introduction
一、引言
模块的命名规则: mod_modulename/modulename.php
模块的文件结构,4个基本的文件:
- mod_helloworld.php,整个模块的入口,初始化路径、helper路径用例收集数据,包含模板等
- mod_helloworld.xml,模块信息,安装的文件和参数
- helper.php,包含一个helper类文件,获取数据用的
tmpl/default.php,模板文件
创建mod_helloworld.php文件
三个任务- 包含helper文件:
- invoke the appropriate helper class method to retrieve the data
- 包含模板文件
创建 helper.php
类名的命名规则一般是ModHelloWorldHelper,不是必须。如果用com_ajax插件的话就必须这么命名。
创建模板文件tmpl/default.php
创建mod_helloworld.xml
指导安装文件和参数,如果没有表格,参数行是空的
二、使用数据库
在xml文件中创建一个表。。。
三、添加表单