joomla组件开发(一)Developing a Basic Component
来源:互联网 发布:h5棋牌源码下载 编辑:程序博客网 时间:2024/05/01 18:36
The first basic component
Let's create a Hello World! component.
Public display
With your favorite file manager and editor, create a fileyoursite/components/com_helloworld/helloworld.php containing
Hello world
You can test this basic component by putting index.php?option=com_helloworld in your browser address (don't forget to prefix this address with your Joomla! 3.x installation path) after installing this component.
Administrator management
With your favorite file manager and editor, create a fileyoursite/administrator/components/com_helloworld/helloworld.php containing
Hello world administration
You can test this basic component by putting administrator/index.php?option=com_helloworld in your browser address after installing the component.
Pack an installation zip file
If you have used Joomla! before reading this tutorial, you have noticed that extensions are installed using a compressed file containing all the things which are needed for installing and uninstalling them.
With your favorite file manager, create a directory (outside your Joomla! installation directory) containing
- helloworld.xml
- site/helloworld.php
- site/index.html
- admin/index.html
- admin/helloworld.php
- admin/sql/index.html
- admin/sql/updates/index.html
- admin/sql/updates/mysql/index.html
- admin/sql/updates/mysql/0.0.1.sql
Create a compressed file of this directory or directly download the archive and install it using the extension manager of Joomla. You can test this basic component by putting index.php?option=com_helloworld or administrator/index.php?option=com_helloworld in your browser address. You can also notice that the Hello World! component is visible in the administrator site of your Joomla installation under the Components menu.
File Details
admin/sql/updates/mysql/0.0.1.sql is an empty file allowing to initialise schema version of the com_helloworld component.
helloworld.xml
<?xml version="1.0" encoding="utf-8"?><extension type="component" version="3.2.0" method="upgrade"> <name>Hello World!</name><!-- The following elements are optional and free of formatting constraints --><creationDate>December 2013</creationDate><author>John Doe</author><authorEmail>john.doe@example.org</authorEmail><authorUrl>http://www.example.org</authorUrl><copyright>Copyright Info</copyright><license>License Info</license><!-- The version string is recorded in the components table --><version>0.0.1</version><!-- The description is optional and defaults to the name --><description>Description of the Hello World component ...</description> <update> <!-- Runs on update; New since J2.5 --><schemas><schemapath type="mysql">sql/updates/mysql</schemapath></schemas></update> <!-- Site Main File Copy Section --><!-- Note the folder attribute: This attribute describes the folderto copy FROM in the package to install therefore files copiedin this section are copied from /site/ in the package --><files folder="site"><filename>index.html</filename><filename>helloworld.php</filename></files> <administration><!-- Administration Menu Section --><menu link='index.php?option=com_helloworld'>Hello World!</menu><!-- Administration Main File Copy Section --><!-- Note the folder attribute: This attribute describes the folderto copy FROM in the package to install therefore files copiedin this section are copied from /admin/ in the package --><files folder="admin"><!-- Admin Main File Copy Section --><filename>index.html</filename><filename>helloworld.php</filename><!-- SQL files section --><folder>sql</folder></files></administration> </extension>
site/helloworld.php
Hello World
admin/helloworld.php
Hello World administration
index.html common to all folders
<html><body bgcolor="#FFFFFF"></body></html>
- joomla组件开发(一)Developing a Basic Component
- joomla component学习笔记(一)--创建自己的组件
- Joomla扩展组件开发文档(component)
- Joomla 组件开发 常见问题
- 如何开发Joomla组件
- How to creating a Component of Joomla
- joomla component学习笔记(二)--第一个组件helloworld研究
- joomla component学习笔记(三)--第一个组件helloworld研究
- Vue的组件component(一)
- joomla 3.6 component开发教程之一 component简介
- Joomla MVC 组件开发 (1)
- Component Development (组件开发)
- 在Joomla!的组件里创建web service - 03: Joomla!自身的Component设计
- 第四章 Joomla!扩展开发--前端开发(一)
- 第二章 Joomla 组件开发入门
- 组件(Component)映射
- 组件(Component)映射
- 组件(Component)
- RobotStudio5.14版本破解
- FPGA基础之异步复位和同步释放电路的详细解释
- 读(注释) "OSASK" II
- 【小白话通信】离散分布之间的关系
- Linux系统启动笔记
- joomla组件开发(一)Developing a Basic Component
- ZOJ 3768 Continuous Login(迭代搜索||夹逼)
- lintcode:Longest Substring with At Most K Distinct Characters
- 算法:常见的几种排序
- SQL之group by中Having与Where的区别
- Tomcat配置c3p0数据源
- uva 10453 Make Palindrome (区间DP + 递归输出)
- 动态规划算法求解0,1背包问题
- 用可变参数列表实现求n个数的平均值