A beginner helloworld
The component is placed under the components directory.
1. You can create a new directory com_helloworld under the joomla root directory.
Note: All the created directories start with com.
2. Create helloworld. php In the com_helloworld directory.
Note: The name must be the same as the directory name!
Helloworld. php content:
hello world
Test:
Http: // localhost/index. php? Option = com_helloworld
This error is normal because we have not installed a proper method.
Continue to see the following
Ii. Perfection of helloworld
Use a regular method to develop an installable component, zip compressed file!
Create another folder com_helloworld.
Create in this folder:
Site/helloworld. php (front-end)
Site/index.html (front-end)
Admin/helloworld. php (background)
Admin/index.html (background)
Hellowold. XML (some configuration information for installing this component)
The following describes the content of each file:
Site/helloworld. php
Hello world
Admin/helloworld. php:
Hello World Administrator
Hellowold. xml
<?xml version="1.0" encoding="utf-8"?><install type="component" version="2.5"><name>helloworld</name><creationDate>2011-11-09</creationDate><author>gao tong</author><copyright>Copyright Info</copyright><license>License Info</license><version>1.01</version><description>Hello World Test Component ...</description><files folder="site"><filename>index.html</filename><filename>helloworld.php</filename></files><administration><menu img="components/com_proforms/images/love.png" >COM_HelloWorld</menu><files folder="admin"><filename>index.html</filename><filename>helloworld.php</filename></files></administration></install>
The above configuration is more important to specify all files, correct!
<Administration> required. components must be installed on both the foreground and background.
Index.html
Leave it blank! Or:
Finally, package it into a zip file and you can install it.
Install this component in the background. You can see this component in the background component.
After opening:
Front-End test: http: // localhost/Administrator/index. php? Option = com_helloworld