Introduction to joomla2.5 component development: helloworld!

Source: Internet
Author: User

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



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.