JOOMLA! Component Building

Submitted by Anonymous (not verified) on Sun, 10/28/2012 - 01:11

JOOMLA! Component Building

 

All Joomla! extensions must be packaged as a .zip installation file .According to the most common file arrangement, the package should contain at least the following two folders as a basic structure:

  • site
  • admin

If you set up your XML manifest file according to standard practice, the contents of site will be installed to /components/com_{componentname}, whereas the contents of admin will be installed to /administrator/components/com_{componentname}.

 

 

The /site folder

This folder keeps the files for the frontend part of the component.

/site/{componentname}.php
This is the component's main file and entry point for the frontend part.
/site/controller.php
This file holds the default frontend controller, which is a class called {ComponentName}Controller. This class must extend the base class JController.
/site/views
This folder holds the different views for the component.
/site/views/{viewname}
This folder holds the files for the view {ViewName}.
/site/views/{viewname}/view.html.php
This file is the entry point for the view {ViewName}. It should declare the class {ComponentName}View{ViewName}. This class must extend the base class JView. The .html section of the filename is related to the format the view will be loaded in. For example, if the format URL parameter is set to format=feed, the file view.feed.php will be loaded.
/site/views/{viewname}/tmpl
This folder holds the template files for the view {ViewName}.
/site/views/{viewname}/tmpl/default.php
This is the default template for the view {ViewName}. In this PHP file, the $this keyword refers to the view class that the template belongs to.
/site/models
This folder holds additional models, if needed by the application.
/site/models/{modelname}.php
This file holds the model class {ComponentName}Model{ModelName}. This class must extend the base class JModel. Note that the view named {ViewName} will by default load a model called {ViewName} if it exists. Most models are named after the view they are intended to be used with, but this is not a requirement. See Using multiple models in an MVC component for more information.
/site/controllers
This folder holds additional controllers, if needed by the application.
/site/controllers/{controllername}.php
This file holds the controller class {ComponentName}Controller{ControllerName}. This class must extend the base class JController.
 
 

The /admin folder

The file structure is exactly the same as in the /site folder.

 

 

Related Items

Website Building with JOOMLA!: A Complete Guide for the Beginner

Joomla is a popular content management system (CMS) . Using joomla package one can easily build website within two-three hours. Website build with joomla is dynamic and updateable . Joomla is conneted with MySQL data base and the script of package is build with PHP.