<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MeeDNite</id>
	<title>Joomla! Documentation - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MeeDNite"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/MeeDNite"/>
	<updated>2026-05-24T10:25:07Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Using_nested_sets&amp;diff=161225</id>
		<title>Using nested sets</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Using_nested_sets&amp;diff=161225"/>
		<updated>2015-03-03T14:55:53Z</updated>

		<summary type="html">&lt;p&gt;MeeDNite: /* Adding a root node */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Starting with version 11.1 the Joomla Platform now includes native support for storing and retrieving hierarchical information in the form of &amp;quot;nested sets&amp;quot; in database tables.  This support is used in the implementation of menus and categories in the core Joomla CMS from version 1.6 onwards, but can of course be used in your own extensions too.  This document assumes that you are already familiar with using the [[:Category:JTable|JTable]], [[:Category:JDatabase|JDatabase]] and JDatabaseQuery classes to interact with a database, either the Joomla database itself, or some external database.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
In the nested sets model each data item is stored as a row in the database table in the normal manner.  However, additional columns are present in the table to express the hierarchical relationship between the data items.  Each data item is referred to as a node and the collection of nodes can be thought of as forming a tree.  Nodes can have zero, one or many child nodes.  A node that has no children is referred to as a leaf node.  A child node can itself have children and this nesting can carry on to arbitrary depth.  The table is assumed to hold a single tree with a single node being allocated as the root node.  If you need to be able to store multiple trees then simply make the root node of each such tree a child node under the single root node and adjust your code to take this into account.&lt;br /&gt;
&lt;br /&gt;
As each node contains columns labelled &amp;quot;lft&amp;quot; and &amp;quot;rgt&amp;quot; for &amp;quot;left&amp;quot; and &amp;quot;right&amp;quot; respectively, it is tempting to think that the data structure is a binary tree.  However, these columns do not store node ids as they are not links to other nodes in the tree, but instead store sequence information.  More information can be found on the theory behind nested sets here&amp;lt;ref&amp;gt;[[wikipedia:Nested set model]].&amp;lt;/ref&amp;gt;  The term &amp;quot;nested sets&amp;quot; is a little inaccurate as a set is, stricly speaking, an unordered collection of objects.  In the Joomla implementation the order of nodes under a parent node is preserved and API calls are available to manipulate the order.  A better term would perhaps be &amp;quot;nested ordered sets&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
It should be noted that certain operations, such as inserting a new node, can be expensive in terms of disk access when dealing with a large tree and applications should be designed with this in mind.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
The essential class is JTableNested, which extends the base JTable class, so instead of extending JTable you should extend your table class from JTableNested instead.&lt;br /&gt;
&lt;br /&gt;
Your table must include a number of standard columns that are required for JTableNested to maintain the tree structure successfully.  These are:-&lt;br /&gt;
&lt;br /&gt;
* id (primary key)&lt;br /&gt;
* parent_id&lt;br /&gt;
* lft&lt;br /&gt;
* rgt&lt;br /&gt;
* level&lt;br /&gt;
* title&lt;br /&gt;
* alias&lt;br /&gt;
* access&lt;br /&gt;
* path&lt;br /&gt;
&lt;br /&gt;
The primary key does not need to be called &amp;quot;id&amp;quot;, but it is required.  Other columns must have the names listed above.&lt;br /&gt;
&lt;br /&gt;
For example, a suitable MySQL command to create a basic table compatible with JTableNested would be&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
CREATE TABLE IF NOT EXISTS `#__nestedsets` (&lt;br /&gt;
  `id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
  `parent_id` int(10) unsigned NOT NULL DEFAULT &#039;0&#039;,&lt;br /&gt;
  `lft` int(11) NOT NULL DEFAULT &#039;0&#039;,&lt;br /&gt;
  `rgt` int(11) NOT NULL DEFAULT &#039;0&#039;,&lt;br /&gt;
  `level` int(10) unsigned NOT NULL DEFAULT &#039;0&#039;,&lt;br /&gt;
  `title` varchar(255) NOT NULL,&lt;br /&gt;
  `alias` varchar(255) NOT NULL DEFAULT &#039;&#039;,&lt;br /&gt;
  `access` tinyint(3) unsigned NOT NULL DEFAULT &#039;0&#039;,&lt;br /&gt;
  `path` varchar(255) NOT NULL DEFAULT &#039;&#039;,&lt;br /&gt;
  PRIMARY KEY (`id`),&lt;br /&gt;
  KEY `idx_left_right` (`lft`,`rgt`)&lt;br /&gt;
) DEFAULT CHARSET=utf8;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You will, of course, need to add further columns for your specific data requirements.  For the purposes of this documentation a column called &amp;quot;payload&amp;quot; will be used to indicate this custom data.&lt;br /&gt;
&lt;br /&gt;
==Instantiating the table object==&lt;br /&gt;
You instantiate the nested sets table object in exactly the same way as you would for a regular table object.  For example, if your table class file is located in a &amp;lt;tt&amp;gt;/tables&amp;lt;/tt&amp;gt; directory in your component area, you could use code like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JTable::addIncludePath(JPATH_COMPONENT . &#039;/tables&#039;);&lt;br /&gt;
$table = JTable::getInstance(&#039;nestedsets&#039;, &#039;Table&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will instantiate your table class called &#039;TableNestedSets&#039; in the file &#039;nestedsets.php&#039;.  Remember to extend from JTableNested instead of JTable:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class TableNestedSets extends JTableNested&lt;br /&gt;
{&lt;br /&gt;
    // Your properties and methods go here.&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adding a root node==&lt;br /&gt;
The quickest way to add a root node to an otherwise empty table is to use code like this, which can be added to your table class:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Add the root node to an empty table.&lt;br /&gt;
 *&lt;br /&gt;
 * @return    mixed  The id of the new root node or false on error.&lt;br /&gt;
 */&lt;br /&gt;
public function addRoot()&lt;br /&gt;
{&lt;br /&gt;
    $db = JFactory::getDbo();&lt;br /&gt;
&lt;br /&gt;
    $query = $db-&amp;gt;getQuery(true)&lt;br /&gt;
        -&amp;gt;insert(&#039;#__profiles&#039;)&lt;br /&gt;
        -&amp;gt;set(&#039;parent_id = 0&#039;)&lt;br /&gt;
        -&amp;gt;set(&#039;lft = 0&#039;)&lt;br /&gt;
        -&amp;gt;set(&#039;rgt = 1&#039;)&lt;br /&gt;
        -&amp;gt;set(&#039;level = 0&#039;)&lt;br /&gt;
        -&amp;gt;set(&#039;title = &#039; . $db-&amp;gt;quote(&#039;root&#039;))&lt;br /&gt;
        -&amp;gt;set(&#039;alias = &#039; . $db-&amp;gt;quote(&#039;root&#039;))&lt;br /&gt;
        -&amp;gt;set(&#039;access = 1&#039;)&lt;br /&gt;
        -&amp;gt;set(&#039;path = &#039; . $db-&amp;gt;quote(&#039;&#039;));&lt;br /&gt;
    $db-&amp;gt;setQuery($query);&lt;br /&gt;
&lt;br /&gt;
    if(!$db-&amp;gt;execute())&lt;br /&gt;
    {&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return $db-&amp;gt;insertid();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is perfectly reasonable to store payload data in the root node.  For example, you might like to store component configuration data in the payload column of the root node.&lt;br /&gt;
&lt;br /&gt;
==Getting the root node id==&lt;br /&gt;
To determine the id of the root node use the &amp;lt;tt&amp;gt;getRootId&amp;lt;/tt&amp;gt; method.  For example, in this example if the root node is not found, it is created.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$rootId = $table-&amp;gt;getRootId();&lt;br /&gt;
&lt;br /&gt;
if ($rootId === false)&lt;br /&gt;
{&lt;br /&gt;
    $rootId = $table-&amp;gt;addRoot();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Updating a node==&lt;br /&gt;
Updating the payload data in a node is done in exactly the same way as you would update a record in a regular database table using the JTable class.  Given an array of data fields, this code binds it to the table object, checks its validity then stores it in the database table.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$table-&amp;gt;bind($data_array);&lt;br /&gt;
$table-&amp;gt;check();&lt;br /&gt;
$table-&amp;gt;store();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Updating a node in such a way that it alters the structure of the tree, for example, by moving a node from one location to another, is a little more involved and is described below.  There are also some convenience methods for publishing/unpublished a node and these are also described in more detail below.&lt;br /&gt;
&lt;br /&gt;
==Adding a new node==&lt;br /&gt;
Adding a new node to the table is done in a similar way to adding a row to a normal Joomla table.  Data is bound to the Joomla table object using the bind method, followed by calls to check and store.  These methods have been overridden in the JTableNested class to provide the additional functionality required for storing nested sets.&lt;br /&gt;
&lt;br /&gt;
However, in order to determine where in the tree the new node is to be inserted, you need to make a call to the &amp;lt;tt&amp;gt;setLocation&amp;lt;/tt&amp;gt; method.  The setLocation method takes two arguments, the first is the id of a &amp;quot;reference&amp;quot; node in the tree.  The new node will be inserted relative to this node with the relationship being specified by the second argument.  Possible values for this relationship are:&lt;br /&gt;
* &#039;&#039;&#039;before&#039;&#039;&#039; - the new node will be inserted before the reference node but at the same level.&lt;br /&gt;
* &#039;&#039;&#039;after&#039;&#039;&#039; - the new node will be inserted after the reference node but at the same level.&lt;br /&gt;
* &#039;&#039;&#039;first-child&#039;&#039;&#039; - the new node will be inserted as the first child node of the reference node.&lt;br /&gt;
* &#039;&#039;&#039;last-child&#039;&#039;&#039; - the new node will be inserted as the last child node of the reference node.&lt;br /&gt;
&lt;br /&gt;
In this example a new node is inserted as the first child of the reference node.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Given an array of data fields in $data_array and a reference node id in $reference_id,&lt;br /&gt;
// this code will add the new node as the first child of the reference node.&lt;br /&gt;
&lt;br /&gt;
// Get the table object.&lt;br /&gt;
// Note that in a model you can replace this with $table = $this-&amp;gt;getTable();&lt;br /&gt;
$table = JTable::getInstance(&#039;yourtable&#039;);&lt;br /&gt;
&lt;br /&gt;
// Specify where to insert the new node.&lt;br /&gt;
$table-&amp;gt;setLocation($reference_id, &#039;first-child&#039;);&lt;br /&gt;
&lt;br /&gt;
// Bind data to the table object.&lt;br /&gt;
$table-&amp;gt;bind($data_array);&lt;br /&gt;
&lt;br /&gt;
// Force a new node to be created.&lt;br /&gt;
$table-&amp;gt;id = 0;&lt;br /&gt;
&lt;br /&gt;
// Check that the node data is valid.&lt;br /&gt;
$table-&amp;gt;check();&lt;br /&gt;
&lt;br /&gt;
// Store the node in the database table.&lt;br /&gt;
$table-&amp;gt;store();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
In order to maintain the integrity of the data structure, the table is locked during a node insertion operation.  Bear in mind that adding a new node to a large table is an expensive operation so the table could potentially be locked for a considerable period.  You may need to take this into account when designing your application.&lt;br /&gt;
&lt;br /&gt;
==Retrieving a single node by id==&lt;br /&gt;
If you know the id of a node then retrieving it can be done in the same way that you would retrieve a row in a regular Joomla table.  For example,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Get the node id from the request.&lt;br /&gt;
$id = JRequest::getInt(&#039;id&#039;);&lt;br /&gt;
&lt;br /&gt;
// Get the node from the table.&lt;br /&gt;
$table-&amp;gt;load($id);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Is it a leaf node?==&lt;br /&gt;
A leaf node is one that has no child nodes beneath it.  To determine if a node is a leaf node you can use code like the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// If $id is the id of a node, determine if it is a leaf node.&lt;br /&gt;
if ($table-&amp;gt;isLeaf($id))&lt;br /&gt;
{&lt;br /&gt;
  echo &#039;This is a leaf node&#039;;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
  echo &#039;This is NOT a leaf node&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Retrieving a subtree==&lt;br /&gt;
To retrieve an entire subtree given the id of the base node of the subtree, you can use code like the following&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// If $id is the id of a node, retrieve the subtree with this node as its root.&lt;br /&gt;
$subtree = $table-&amp;gt;getTree($id);&lt;br /&gt;
print_r($subtree);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will retrieve an array of all the nodes in the subtree.  The array is one-dimensional and lists the nodes in preorder traversal order&amp;lt;ref&amp;gt;[[wikipedia:Tree traversal]]&amp;lt;/ref&amp;gt;.  Note that if your table is large calling getTree() from the root node will retrieve the entire table and very likely run you out of memory, so use it with caution.&lt;br /&gt;
&lt;br /&gt;
==Retrieving a path==&lt;br /&gt;
To retrieve all the nodes along the path leading to a specified node, you can use code like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pathNodes = $table-&amp;gt;getPath($id);&lt;br /&gt;
print_r($pathNodes);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will retrieve a one-dimensional array of all the nodes from the root node along the path leading to the specified node.&lt;br /&gt;
&lt;br /&gt;
==Publish or unpublish a node or an entire branch==&lt;br /&gt;
Supporting the publish/unpublish feature is a little more involved than with a regular flat database table as the state of parent and child nodes must also be taken into account.  Fortunately, the overridden publish and unpublish methods provided by JTableNested make the management of publish/unpublish almost transparent.&lt;br /&gt;
&lt;br /&gt;
To publish or unpublish one or more nodes use code like the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// $ids can be a single node id, or an array of node ids.&lt;br /&gt;
// 0 = unpublish, 1 = publish&lt;br /&gt;
$state = 1;&lt;br /&gt;
$userId = JFactory::getUser()-&amp;gt;id;&lt;br /&gt;
&lt;br /&gt;
if ($table-&amp;gt;publish($id, $state, $userId))&lt;br /&gt;
{&lt;br /&gt;
    echo &#039;State changed successfully&#039;;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
    echo &#039;State not changed&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The publish method respects rows checked out by other users and will attempt to checkin rows that it can after adjustments are made. The method will not allow you to set a publishing state higher than any ancestor node and will not allow you to set a publishing state on a node with a checked out child.&lt;br /&gt;
&lt;br /&gt;
TODO: Using publish/unpublish with checkin/out requires some additional columns in the table.  The documentation should be updated to reflect that.&lt;br /&gt;
&lt;br /&gt;
==Changing the order of nodes in a branch==&lt;br /&gt;
There are a number of different ways of moving a node to a new location in the tree.&lt;br /&gt;
&lt;br /&gt;
To move a node one position before or after its current position, but keeping it at the same level, you can use the orderUp or orderDown methods using code like the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
if ($table-&amp;gt;orderUp($id))&lt;br /&gt;
{&lt;br /&gt;
    echo &#039;Success&#039;;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
    echo &#039;Failed to move node&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More generally, you can move a node by more than one position at a time using the &amp;lt;tt&amp;gt;move&amp;lt;/tt&amp;gt; method.  For example, the following code moves the node 2 positions before its current position, at the same level.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Get the node id to be moved from the request.&lt;br /&gt;
$key = $this-&amp;gt;_tbl_key;&lt;br /&gt;
$this-&amp;gt;$key = JRequest::getInt(&#039;id&#039;);&lt;br /&gt;
&lt;br /&gt;
// Set the direction and magnitude of the move.&lt;br /&gt;
// Negative indicates &amp;quot;before&amp;quot;, positive &amp;quot;after&amp;quot;&lt;br /&gt;
$delta = -2;&lt;br /&gt;
&lt;br /&gt;
// Do the move.&lt;br /&gt;
// Notice that the node id is not passed as an argument to&lt;br /&gt;
// move; it must already be set in the table object.&lt;br /&gt;
if ($table-&amp;gt;move($delta))&lt;br /&gt;
{&lt;br /&gt;
    echo &#039;Success&#039;;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
    echo &#039;Failed to move node&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the most general case, a node can be moved to an arbitrary position in the tree using the &amp;lt;tt&amp;gt;moveByReference&amp;lt;/tt&amp;gt; method.  This is very similar to adding a completely new node to the tree in that you need to specify the location to move the node to by reference to some other node.&lt;br /&gt;
&lt;br /&gt;
In this example a new node is inserted as the last child of the reference node.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Determine the reference node id.&lt;br /&gt;
$reference_id = JRequest::getInt(&#039;reference&#039;);&lt;br /&gt;
&lt;br /&gt;
// Determine the relationship with the reference node.  Possible values are:-&lt;br /&gt;
// before - the new node will be inserted before the reference node but at the same level.&lt;br /&gt;
// after - the new node will be inserted after the reference node but at the same level.&lt;br /&gt;
// first-child - the new node will be inserted as the first child node of the reference node.&lt;br /&gt;
// last-child  - the new node will be inserted as the last child node of the reference node.&lt;br /&gt;
$relation = &#039;last-child&#039;;&lt;br /&gt;
&lt;br /&gt;
// Determine the node to be moved.&lt;br /&gt;
$node_id = JRequest::getInt(&#039;id&#039;);&lt;br /&gt;
&lt;br /&gt;
// Do the move.&lt;br /&gt;
if ($table-&amp;gt;moveByReference($reference_id, $relation, $node_id))&lt;br /&gt;
{&lt;br /&gt;
    echo &#039;Success&#039;;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
    echo &#039;Failed to move node&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Deleting a node==&lt;br /&gt;
Deleting a node given its node id is very simple as the following example illustrates:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Determine the node id from the request.&lt;br /&gt;
$node_id = JRequest::getInt(&#039;id&#039;);&lt;br /&gt;
&lt;br /&gt;
// Delete the node.&lt;br /&gt;
if ($table-&amp;gt;delete($node_id))&lt;br /&gt;
{&lt;br /&gt;
    echo &#039;Node deleted&#039;;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
    echo &#039;Failed to delete node&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that this operation will also delete all child nodes of the node being deleted, if any are present.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Platform 11.1]][[Category:Development Tips and Tricks]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>MeeDNite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Supporting_plugins_in_your_component&amp;diff=149745</id>
		<title>Supporting plugins in your component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Supporting_plugins_in_your_component&amp;diff=149745"/>
		<updated>2015-01-07T13:58:43Z</updated>

		<summary type="html">&lt;p&gt;MeeDNite: /* How To Become A Communicator */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version|2.5,3.x}}&lt;br /&gt;
{{dablink|&#039;&#039;&#039;Version Note:&#039;&#039;&#039; While this document pertains to Joomla! 2.5 and 3.x, JEventDispatcher does not exist in Joomla 2.5. In that case, change JEventDispatcher to JDispatcher. Using JDispatcher is possible in Joomla 3.x but will generate a deprecated notice.}}&lt;br /&gt;
&lt;br /&gt;
The event system in Joomla! allows for a flexible method for components, modules and plug-ins to communicate with other plug-ins by following the [[wikipedia:Observer_pattern|Observer pattern]]. This pattern is most easily described as a simple communication mechanism. The basic premise is that zero or more &amp;quot;observers&amp;quot; or &amp;quot;listeners&amp;quot; register themselves with the system for a certain, known event. During a specific point in an application&#039;s lifecycle, the &amp;quot;communicator&amp;quot; (in our case a component, module or plug-in) fires the event, passing some information to all the observers. The observers can then act on the information passed to them and optionally return a result to the communicator.&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== Joomla! Observer Implementation ===&lt;br /&gt;
Joomla! implements the Observer pattern at a global level through the [http://api.joomla.org/Joomla-Platform/Plugin/JPlugin.html JPlugin] (Observer) and [http://api.joomla.org/Joomla-Platform/Event/JEventDispatcher.html JEventDispatcher] (Observable) classes. Anyone wanting to receive notification of events will create a plug-in that extends the &amp;lt;code&amp;gt;JPlugin&amp;lt;/code&amp;gt; class. Subclasses of &amp;lt;code&amp;gt;JPlugin&amp;lt;/code&amp;gt; will automatically register themselves to the global JEventDispatcher class when their plug-in category has been loaded (more on that later). The &amp;lt;code&amp;gt;JEventDispatcher&amp;lt;/code&amp;gt; class is used as a dispatching mechanism that receives events from the communicators and forwards them on to the listeners that have been loaded. For a full explanation of this it is recommended to read the [[Plugin Developer Overview]]&lt;br /&gt;
&lt;br /&gt;
=== Why Become A Communicator ===&lt;br /&gt;
There may be times in your component&#039;s lifecycle when it would be nice to notify others that some action has taken place. For example, let&#039;s say you have a compact disk (CD) library component. You may decide that you would like to let others know when a new CD has been added to the library. In this case, you could document a well known event (&amp;lt;code&amp;gt;onCdAddedToLibrary&amp;lt;/code&amp;gt; for example) and at the appropriate time, &#039;&#039;trigger&#039;&#039; the event passing in information about the new CD that was added to the library. All plug-ins that have implemented that event will be notified with the information and can handle it as they see fit. Instant communication!&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== How To Become A Communicator ===&lt;br /&gt;
Since all the dispatching is handled by the Joomla! core, it is easy to become a communicator. In fact, it&#039;s really just a matter of loading a certain set of plug-ins and calling the trigger method of the &amp;lt;code&amp;gt;JEventDispatcher&amp;lt;/code&amp;gt; class.&lt;br /&gt;
&lt;br /&gt;
You may wonder how to know which set of plug-ins to load. That&#039;s up to you. Plug-ins are managed at a group level that is defined in the plug-in&#039;s XML deployment file. There are eight predefined plug-in groups and each plug-in group is meant to handle a different set of tasks. For example, there is a &amp;lt;tt&amp;gt;search&amp;lt;/tt&amp;gt; plug-in group that is meant to handle searching and a &amp;lt;tt&amp;gt;user&amp;lt;/tt&amp;gt; plug-in group meant to handle user specific functions such as adding and removing a user from the Joomla! system. These plug-in groups are only loaded when they are needed, namely by the communicator. So you can create your own plug-in group and call it whatever you want. Because your component is well-defined, all listeners will know exactly which plug-in group and events they should be listening for.&lt;br /&gt;
&lt;br /&gt;
=== How To Trigger Events ===&lt;br /&gt;
This leads us to the meat of this article: how to trigger events so implementing plug-ins can act on them. The first thing you need to do is to load your plug-in group. This is done via the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JPluginHelper::importPlugin( &#039;myplugingroup&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will load all enabled plug-ins that have defined themselves as part of your group. The next thing you need to do is get an instance of the &amp;lt;code&amp;gt;JEventDispatcher&amp;lt;/code&amp;gt; class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$dispatcher = JEventDispatcher::getInstance();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice two things here. First, we are using the &amp;lt;code&amp;gt;getInstance()&amp;lt;/code&amp;gt; method, not &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt;, to create a new instance. That is because we need to get the global singleton instance of the JEventDispatcher object that contains a list of all the plug-ins available.&lt;br /&gt;
&lt;br /&gt;
Next, we need to trigger our custom event:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$results = $dispatcher-&amp;gt;trigger( &#039;onCdAddedToLibrary&#039;, array( &amp;amp;$artist, &amp;amp;$title ) );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we have triggered the event &amp;lt;code&amp;gt;onCdAddedToLibrary&amp;lt;/code&amp;gt; and passed in the artist name and title of the track. Which and how many parameters you pass is up to you. Passing parameters by reference (using an &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt;) allows the plug-ins to change the variables passed in. All plug-ins will receive these parameters, process them and optionally pass back information. The calling code can access the returned values via the array &amp;lt;code&amp;gt;$results&amp;lt;/code&amp;gt; (each element corresponds to the result of one plugin).&lt;br /&gt;
&lt;br /&gt;
== Caveats ==&lt;br /&gt;
&lt;br /&gt;
=== You Are Defining An API ===&lt;br /&gt;
&lt;br /&gt;
By offering events for plugins to respond to, you are effectively creating an [[wikipedia:API|API]]. Proper planning is extremely important &amp;amp;ndash; once you release your code, other developers will start to depend on your events&#039; names and parameters. Changing them later will break compatibility with all the plugins that use them.&lt;br /&gt;
&lt;br /&gt;
=== Load The Right Plugin Group ===&lt;br /&gt;
One thing to notice about the trigger method is that there is nothing defining which group of plug-ins should be notified. In actuality, all plug-ins that have been loaded are notified regardless of the group they are in. It&#039;s important to make sure you have an event name that does not conflict with any other plug-in group&#039;s event name. Most of the time this is not an issue because your component is the one that is loading the plug-in group, so you know which ones are loaded. However be aware that the &amp;lt;tt&amp;gt;system&amp;lt;/tt&amp;gt; plug-in group is loaded very close to the beginning of the request. Make sure you don&#039;t have any event naming conflicts with the system events.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Plugin Development]]&lt;br /&gt;
[[Category:Development Recommended Reading]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>MeeDNite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Supporting_plugins_in_your_component&amp;diff=149728</id>
		<title>Supporting plugins in your component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Supporting_plugins_in_your_component&amp;diff=149728"/>
		<updated>2015-01-07T13:51:48Z</updated>

		<summary type="html">&lt;p&gt;MeeDNite: /* You Are Defining An API */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version|2.5,3.x}}&lt;br /&gt;
{{dablink|&#039;&#039;&#039;Version Note:&#039;&#039;&#039; While this document pertains to Joomla! 2.5 and 3.x, JEventDispatcher does not exist in Joomla 2.5. In that case, change JEventDispatcher to JDispatcher. Using JDispatcher is possible in Joomla 3.x but will generate a deprecated notice.}}&lt;br /&gt;
&lt;br /&gt;
The event system in Joomla! allows for a flexible method for components, modules and plug-ins to communicate with other plug-ins by following the [[wikipedia:Observer_pattern|Observer pattern]]. This pattern is most easily described as a simple communication mechanism. The basic premise is that zero or more &amp;quot;observers&amp;quot; or &amp;quot;listeners&amp;quot; register themselves with the system for a certain, known event. During a specific point in an application&#039;s lifecycle, the &amp;quot;communicator&amp;quot; (in our case a component, module or plug-in) fires the event, passing some information to all the observers. The observers can then act on the information passed to them and optionally return a result to the communicator.&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== Joomla! Observer Implementation ===&lt;br /&gt;
Joomla! implements the Observer pattern at a global level through the [http://api.joomla.org/Joomla-Platform/Plugin/JPlugin.html JPlugin] (Observer) and [http://api.joomla.org/Joomla-Platform/Event/JEventDispatcher.html JEventDispatcher] (Observable) classes. Anyone wanting to receive notification of events will create a plug-in that extends the &amp;lt;code&amp;gt;JPlugin&amp;lt;/code&amp;gt; class. Subclasses of &amp;lt;code&amp;gt;JPlugin&amp;lt;/code&amp;gt; will automatically register themselves to the global JEventDispatcher class when their plug-in category has been loaded (more on that later). The &amp;lt;code&amp;gt;JEventDispatcher&amp;lt;/code&amp;gt; class is used as a dispatching mechanism that receives events from the communicators and forwards them on to the listeners that have been loaded. For a full explanation of this it is recommended to read the [[Plugin Developer Overview]]&lt;br /&gt;
&lt;br /&gt;
=== Why Become A Communicator ===&lt;br /&gt;
There may be times in your component&#039;s lifecycle when it would be nice to notify others that some action has taken place. For example, let&#039;s say you have a compact disk (CD) library component. You may decide that you would like to let others know when a new CD has been added to the library. In this case, you could document a well known event (&amp;lt;code&amp;gt;onCdAddedToLibrary&amp;lt;/code&amp;gt; for example) and at the appropriate time, &#039;&#039;trigger&#039;&#039; the event passing in information about the new CD that was added to the library. All plug-ins that have implemented that event will be notified with the information and can handle it as they see fit. Instant communication!&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== How To Become A Communicator ===&lt;br /&gt;
Since all the dispatching is handled by the Joomla! core, it is easy to become a communicator. In fact, it&#039;s really just a matter of loading a certain set of plug-ins and calling the trigger method of the &amp;lt;code&amp;gt;JEventDispatcher&amp;lt;/code&amp;gt; class.&lt;br /&gt;
&lt;br /&gt;
You may wonder how to know which set of plug-ins to load. That&#039;s up to you. Plug-ins are managed at a group level that is defined in the plug-in&#039;s XML deployment file. There are eight predefined plug-in groups and each plug-in group is meant to handle a different set of tasks. For example, there is a &amp;lt;tt&amp;gt;search&amp;lt;/tt&amp;gt; plug-in group that is meant to handle searching and an &amp;lt;tt&amp;gt;user&amp;lt;/tt&amp;gt; plug-in group meant to handle user specific functions such as adding and removing a user from the Joomla! system. These plug-in groups are only loaded when they are needed, namely by the communicator. So you can create your own plug-in group and call it whatever you want. Because your component is well-defined, all listeners will know exactly which plug-in group and events they should be listening for.&lt;br /&gt;
&lt;br /&gt;
=== How To Trigger Events ===&lt;br /&gt;
This leads us to the meat of this article: how to trigger events so implementing plug-ins can act on them. The first thing you need to do is to load your plug-in group. This is done via the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JPluginHelper::importPlugin( &#039;myplugingroup&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will load all enabled plug-ins that have defined themselves as part of your group. The next thing you need to do is get an instance of the &amp;lt;code&amp;gt;JEventDispatcher&amp;lt;/code&amp;gt; class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$dispatcher = JEventDispatcher::getInstance();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice two things here. First, we are using the &amp;lt;code&amp;gt;getInstance()&amp;lt;/code&amp;gt; method, not &amp;lt;code&amp;gt;new&amp;lt;/code&amp;gt;, to create a new instance. That is because we need to get the global singleton instance of the JEventDispatcher object that contains a list of all the plug-ins available.&lt;br /&gt;
&lt;br /&gt;
Next, we need to trigger our custom event:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$results = $dispatcher-&amp;gt;trigger( &#039;onCdAddedToLibrary&#039;, array( &amp;amp;$artist, &amp;amp;$title ) );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we have triggered the event &amp;lt;code&amp;gt;onCdAddedToLibrary&amp;lt;/code&amp;gt; and passed in the artist name and title of the track. Which and how many parameters you pass is up to you. Passing parameters by reference (using an &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt;) allows the plug-ins to change the variables passed in. All plug-ins will receive these parameters, process them and optionally pass back information. The calling code can access the returned values via the array &amp;lt;code&amp;gt;$results&amp;lt;/code&amp;gt; (each element corresponds to the result of one plugin).&lt;br /&gt;
&lt;br /&gt;
== Caveats ==&lt;br /&gt;
&lt;br /&gt;
=== You Are Defining An API ===&lt;br /&gt;
&lt;br /&gt;
By offering events for plugins to respond to, you are effectively creating an [[wikipedia:API|API]]. Proper planning is extremely important &amp;amp;ndash; once you release your code, other developers will start to depend on your events&#039; names and parameters. Changing them later will break compatibility with all the plugins that use them.&lt;br /&gt;
&lt;br /&gt;
=== Load The Right Plugin Group ===&lt;br /&gt;
One thing to notice about the trigger method is that there is nothing defining which group of plug-ins should be notified. In actuality, all plug-ins that have been loaded are notified regardless of the group they are in. It&#039;s important to make sure you have an event name that does not conflict with any other plug-in group&#039;s event name. Most of the time this is not an issue because your component is the one that is loading the plug-in group, so you know which ones are loaded. However be aware that the &amp;lt;tt&amp;gt;system&amp;lt;/tt&amp;gt; plug-in group is loaded very close to the beginning of the request. Make sure you don&#039;t have any event naming conflicts with the system events.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Plugin Development]]&lt;br /&gt;
[[Category:Development Recommended Reading]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>MeeDNite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Plugin/Events/System&amp;diff=76441</id>
		<title>J1.5:Plugin/Events/System</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Plugin/Events/System&amp;diff=76441"/>
		<updated>2012-10-13T13:26:10Z</updated>

		<summary type="html">&lt;p&gt;MeeDNite: /* Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightTOC}}&lt;br /&gt;
&lt;br /&gt;
In a standard installation of Joomla! 1.5 we have several predefined events which, when triggered, call functions in the associated plugins.  For more information on plugins, check [[Plugin]], [[Creating a Plugin for Joomla 1.5]], [[How to create a content plugin]] etc.&lt;br /&gt;
&lt;br /&gt;
This topic is aimed at &amp;quot;global&amp;quot; system events, including those triggered on every page load (onAfterInitialise, onAfterRoute, onAfterDispatch, onAfterRender), those supporting search within multiple plugins (onSearch, onSearchArea) and those supporting the presentation of web services (onGetWebServices). Visit [[Plugin]] for a complete list over available core events.&lt;br /&gt;
&lt;br /&gt;
== onAfterInitialise ==&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
This event is triggered after the framework has loaded and the application initialise method has been called.&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
=== Return Value ===&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
=== Called in files ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;tt&amp;gt;index.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
*&amp;lt;tt&amp;gt;administrator/index.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== onAfterRoute ==&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
This event is triggered after the framework has loaded and initialised and the router has routed the client request.&lt;br /&gt;
&lt;br /&gt;
Routing is the process of examining the request environment to determine which component should receive the request. The component optional parameters are then set in the request object that will be processed when the application is being dispatched.&lt;br /&gt;
&lt;br /&gt;
When this event triggers, the router has parsed the route and pushed the request parameters into JRequest to be retrieved by the application.&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
=== Return Value ===&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
=== Used in files ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;index.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;administrator/index.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==onAfterDispatch==&lt;br /&gt;
=== Description ===&lt;br /&gt;
This event is triggered after the framework has dispatched the application.&lt;br /&gt;
&lt;br /&gt;
Dispatching is the process of pulling the option from the request object and mapping them to a component. If the component does not exist, it handles determining a default component to dispatch.&lt;br /&gt;
&lt;br /&gt;
When this event is triggered the output of the component is available in the document buffer.&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
=== Return Value ===&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
=== Used in files ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;index.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;administrator/index.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==onBeforeRender==&lt;br /&gt;
=== Description ===&lt;br /&gt;
&#039;&#039;&#039;This event is not in available in Joomla 1.5. It&#039;s available in Joomla 1.6 and above.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This event is triggered immediately before the framework has rendered the application.&lt;br /&gt;
&lt;br /&gt;
Rendering is the process of pushing the document buffers into the template placeholders, retrieving data from the document and pushing it into the into the JResponse buffer.&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
=== Return Value ===&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
=== Used in files ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;includes/application.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;administrator/includes/application.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==onAfterRender==&lt;br /&gt;
=== Description ===&lt;br /&gt;
This event is triggered after the framework has rendered the application.&lt;br /&gt;
&lt;br /&gt;
Rendering is the process of pushing the document buffers into the template placeholders, retrieving data from the document and pushing it into the into the JResponse buffer.&lt;br /&gt;
&lt;br /&gt;
When this event is triggered the output of the application is available in the response buffer.&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
=== Return Value ===&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
=== Used in files ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;includes/application.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;administrator/includes/application.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==onBeforeCompileHead==&lt;br /&gt;
=== Description ===&lt;br /&gt;
This event is triggered before the framework creates the Head section of the Document.&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
===Return Value===&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
===Used in files===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;libraries/joomla/document/html/renderer/head.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==onSearch==&lt;br /&gt;
===Description===&lt;br /&gt;
&lt;br /&gt;
This event is triggered by a variety of search related operations. It is a request for a&lt;br /&gt;
plugin to return the result of a search request. The rows must return the following fields, which are used in a common display routine:&lt;br /&gt;
&lt;br /&gt;
* href&lt;br /&gt;
* title&lt;br /&gt;
* section&lt;br /&gt;
* created&lt;br /&gt;
* text&lt;br /&gt;
* browsernav&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
&lt;br /&gt;
* The target search string.&lt;br /&gt;
* A string matching option (exact|any|all).&lt;br /&gt;
* A string ordering option (newest|oldest|popular|alpha|category)&lt;br /&gt;
* An array if restricted to areas, null if search all.&lt;br /&gt;
&lt;br /&gt;
===Return Value===&lt;br /&gt;
&lt;br /&gt;
Array of stdClass objects with members as described above.&lt;br /&gt;
&lt;br /&gt;
===Used in files===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;administrator/components/com_statistics/admin.statistics.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;components/com_search/search.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;plugins/search/categories.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;plugins/search/contacts.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;plugins/search/content.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;plugins/search/newsfeeds.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;plugins/search/sections.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;plugins/search/weblinks.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;plugins/xmlrpc/joomla.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==onSearchAreas==&lt;br /&gt;
===Description===&lt;br /&gt;
&lt;br /&gt;
This appears to be a request for plugins to identify which &amp;quot;areas&amp;quot; they provide&lt;br /&gt;
search facilities for.&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
===Return Value===&lt;br /&gt;
&lt;br /&gt;
An associative array of area names, indexed by the area identifier. For example, array( &#039;categories&#039; =&amp;gt; &#039;Categories&#039; ).&lt;br /&gt;
&lt;br /&gt;
===Used in files===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;components/com_search/search.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;plugins/search/categories.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;plugins/search/contacts.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;plugins/search/content.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;plugins/search/newsfeeds.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;plugins/search/sections.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;plugins/search/weblinks.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==onGetWebServices==&lt;br /&gt;
&lt;br /&gt;
===Description===&lt;br /&gt;
&lt;br /&gt;
This is an introspection request for plugins that provide web services.&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
===Return Value===&lt;br /&gt;
&lt;br /&gt;
An array of associative arrays. The outer array is indexed by the service method name and&lt;br /&gt;
contains an array with the following elements:&lt;br /&gt;
&lt;br /&gt;
* [&#039;function&#039;] The method to be invoked, typically a string like &#039;ClassName::staticMethod&#039;&lt;br /&gt;
* [&#039;docstring&#039;] A human-readable definition of the method&#039;s purpose.&lt;br /&gt;
* [&#039;signature&#039;] An array identifying the types of the method&#039;s parameters. See the global variables $xmlrpc* for more information.&lt;br /&gt;
&lt;br /&gt;
===Used in files===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;plugins/xmlrpc/blogger.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;plugins/xmlrpc/joomla.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;xmlrpc/index.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
This is an example system plugin.  Please note that because system plugins are loaded before any other event group, they may also contain any other event.&lt;br /&gt;
&lt;br /&gt;
The following class would be located in the file &amp;lt;tt&amp;gt;/plugins/system/example/example.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
// no direct access&lt;br /&gt;
defined( &#039;_JEXEC&#039; ) or die( &#039;Restricted access&#039; );&lt;br /&gt;
&lt;br /&gt;
jimport( &#039;joomla.plugin.plugin&#039; );&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Example system plugin&lt;br /&gt;
 */&lt;br /&gt;
class plgSystemExample extends JPlugin&lt;br /&gt;
{&lt;br /&gt;
/**&lt;br /&gt;
* Constructor.&lt;br /&gt;
*&lt;br /&gt;
* @access protected&lt;br /&gt;
* @param object $subject The object to observe&lt;br /&gt;
* @param array   $config  An array that holds the plugin configuration&lt;br /&gt;
* @since 1.0&lt;br /&gt;
*/&lt;br /&gt;
public function __construct( &amp;amp;$subject, $config )&lt;br /&gt;
{&lt;br /&gt;
parent::__construct( $subject, $config );&lt;br /&gt;
&lt;br /&gt;
// Do some extra initialisation in this constructor if required&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
* Do something onAfterInitialise&lt;br /&gt;
*/&lt;br /&gt;
function onAfterInitialise()&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
* Do something onAfterRoute&lt;br /&gt;
*/&lt;br /&gt;
function onAfterRoute()&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
* Do something onAfterDispatch&lt;br /&gt;
*/&lt;br /&gt;
function onAfterDispatch()&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
* Do something onAfterRender&lt;br /&gt;
*/&lt;br /&gt;
function onAfterRender()&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following XML document would be located in the file &amp;lt;tt&amp;gt;/plugins/system/example/example.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;install version=&amp;quot;1.5&amp;quot; type=&amp;quot;plugin&amp;quot; group=&amp;quot;system&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;name&amp;gt;System - Example&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;lt;author&amp;gt;Author&amp;lt;/author&amp;gt;&lt;br /&gt;
&amp;lt;creationDate&amp;gt;Month 2008&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
&amp;lt;copyright&amp;gt;Copyright (C) 2008 Holder. All rights reserved.&amp;lt;/copyright&amp;gt;&lt;br /&gt;
&amp;lt;license&amp;gt;GNU General Public License&amp;lt;/license&amp;gt;&lt;br /&gt;
&amp;lt;authorEmail&amp;gt;email&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
&amp;lt;authorUrl&amp;gt;url&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
&amp;lt;version&amp;gt;1.0.1&amp;lt;/version&amp;gt;&lt;br /&gt;
&amp;lt;description&amp;gt;An example system plugin&amp;lt;/description&amp;gt;&lt;br /&gt;
&amp;lt;files&amp;gt;&lt;br /&gt;
&amp;lt;filename plugin=&amp;quot;example&amp;quot;&amp;gt;example.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;params&amp;gt;&lt;br /&gt;
  &amp;lt;param name=&amp;quot;example&amp;quot;&lt;br /&gt;
  type=&amp;quot;text&amp;quot;&lt;br /&gt;
  default=&amp;quot;&amp;quot;&lt;br /&gt;
  label=&amp;quot;Example&amp;quot;&lt;br /&gt;
  description=&amp;quot;An example text parameter&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/params&amp;gt;&lt;br /&gt;
&amp;lt;/install&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Plugin Development]][[Category:Specifications]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>MeeDNite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Adding_categories&amp;diff=75532</id>
		<title>Archived:Developing a MVC Component/Adding categories</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Adding_categories&amp;diff=75532"/>
		<updated>2012-09-21T10:58:21Z</updated>

		<summary type="html">&lt;p&gt;MeeDNite: /* Managing the submenu */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial is for {{JVer|1.6}} {{JVer|1.7}} {{JVer|2.5}}&lt;br /&gt;
{{Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Contents}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
The Joomla framework has implemented the use of categories for all components. Adding categorized ability to a component is fairly simple.&lt;br /&gt;
&lt;br /&gt;
== Modifying the SQL ==&lt;br /&gt;
In order to manage categories, we have to change the SQL tables.&lt;br /&gt;
&lt;br /&gt;
With your favorite editor, modify &#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039; and put these lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/install.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld` (&lt;br /&gt;
  `id` int(11) NOT NULL auto_increment,&lt;br /&gt;
  `greeting` varchar(25) NOT NULL,&lt;br /&gt;
  `catid` int(11) NOT NULL default &#039;0&#039;,&lt;br /&gt;
   PRIMARY KEY  (`id`)&lt;br /&gt;
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;&lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld` (`greeting`) VALUES&lt;br /&gt;
	(&#039;Hello World!&#039;),&lt;br /&gt;
	(&#039;Good bye World!&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/updates/mysql/0.0.12.sql&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/sql/updates/mysql/0.0.12.sql&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER TABLE `#__helloworld` ADD `catid` int(11) NOT NULL default &#039;0&#039; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modifying the form ==&lt;br /&gt;
A HelloWorld message can now belong to a category. We have to modify the editing form. In the &#039;&#039;admin/models/forms/helloworld.xml&#039;&#039; file, put these lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/forms/helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/models/forms/helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;form&lt;br /&gt;
	addrulepath=&amp;quot;/administrator/components/com_helloworld/models/rules&amp;quot;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset&amp;gt;&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
			name=&amp;quot;id&amp;quot;&lt;br /&gt;
			type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
		/&amp;gt;&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
			name=&amp;quot;greeting&amp;quot;&lt;br /&gt;
			type=&amp;quot;text&amp;quot;&lt;br /&gt;
			label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
			description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
			size=&amp;quot;40&amp;quot;&lt;br /&gt;
			class=&amp;quot;inputbox validate-greeting&amp;quot;&lt;br /&gt;
			validate=&amp;quot;greeting&amp;quot;&lt;br /&gt;
			required=&amp;quot;true&amp;quot;&lt;br /&gt;
			default=&amp;quot;&amp;quot;&lt;br /&gt;
		/&amp;gt;&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
			name=&amp;quot;catid&amp;quot;&lt;br /&gt;
			type=&amp;quot;category&amp;quot;&lt;br /&gt;
			extension=&amp;quot;com_helloworld&amp;quot;&lt;br /&gt;
			class=&amp;quot;inputbox&amp;quot;&lt;br /&gt;
			default=&amp;quot;&amp;quot;&lt;br /&gt;
			label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_CATID_LABEL&amp;quot;&lt;br /&gt;
			description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_CATID_DESC&amp;quot;&lt;br /&gt;
			required=&amp;quot;true&amp;quot;&lt;br /&gt;
		&amp;gt;&lt;br /&gt;
			&amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JOPTION_SELECT_CATEGORY&amp;lt;/option&amp;gt;&lt;br /&gt;
		&amp;lt;/field&amp;gt;&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the category can be 0 (representing no category).&lt;br /&gt;
&lt;br /&gt;
== Modifying the menu type ==&lt;br /&gt;
The HelloWorld menu type displays a drop down list of all messages. If the message is categorized, we have to add the category in this display.&lt;br /&gt;
&lt;br /&gt;
In the &#039;&#039;admin/models/fields/helloworld.php&#039;&#039; file, put these lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/fields/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/models/fields/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
// import the list field type&lt;br /&gt;
jimport(&#039;joomla.form.helper&#039;);&lt;br /&gt;
JFormHelper::loadFieldClass(&#039;list&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Form Field class for the HelloWorld component&lt;br /&gt;
 */&lt;br /&gt;
class JFormFieldHelloWorld extends JFormFieldList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The field type.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var		string&lt;br /&gt;
	 */&lt;br /&gt;
	protected $type = &#039;HelloWorld&#039;;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a list of options for a list input.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return	array		An array of JHtml options.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getOptions() &lt;br /&gt;
	{&lt;br /&gt;
		$db = JFactory::getDBO();&lt;br /&gt;
&lt;br /&gt;
		/// $query = new JDatabaseQuery; WARNING - There&#039;s an error in this line, JDatabaseQuery is an abstract class&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true); // THIS IS THE FIX, WARNING IT MUST BE FIXED IN THE ZIP FILES&lt;br /&gt;
&lt;br /&gt;
		$query-&amp;gt;select(&#039;#__helloworld.id as id,greeting,#__categories.title as category,catid&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		$query-&amp;gt;leftJoin(&#039;#__categories on catid=#__categories.id&#039;);&lt;br /&gt;
		$db-&amp;gt;setQuery((string)$query);&lt;br /&gt;
		$messages = $db-&amp;gt;loadObjectList();&lt;br /&gt;
		$options = array();&lt;br /&gt;
		if ($messages)&lt;br /&gt;
		{&lt;br /&gt;
			foreach($messages as $message) &lt;br /&gt;
			{&lt;br /&gt;
				$options[] = JHtml::_(&#039;select.option&#039;, $message-&amp;gt;id, $message-&amp;gt;greeting .&lt;br /&gt;
				                      ($message-&amp;gt;catid ? &#039; (&#039; . $message-&amp;gt;category . &#039;)&#039; : &#039;&#039;));&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		$options = array_merge(parent::getOptions(), $options);&lt;br /&gt;
		return $options;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It will now display the category between parenthesis.&lt;br /&gt;
&lt;br /&gt;
== Managing the submenu ==&lt;br /&gt;
The &#039;&#039;com_categories&#039;&#039; component allows to set the submenu using a helper file. With your favorite file manager and editor, put a &#039;&#039;admin/helpers/helloworld.php&#039;&#039; file containing these lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/helpers/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/helpers/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld component helper.&lt;br /&gt;
 */&lt;br /&gt;
abstract class HelloWorldHelper&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Configure the Linkbar.&lt;br /&gt;
	 */&lt;br /&gt;
	public static function addSubmenu($submenu) &lt;br /&gt;
	{&lt;br /&gt;
		JSubMenuHelper::addEntry(JText::_(&#039;COM_HELLOWORLD_SUBMENU_MESSAGES&#039;),&lt;br /&gt;
		                         &#039;index.php?option=com_helloworld&#039;, $submenu == &#039;messages&#039;);&lt;br /&gt;
		JSubMenuHelper::addEntry(JText::_(&#039;COM_HELLOWORLD_SUBMENU_CATEGORIES&#039;),&lt;br /&gt;
		                         &#039;index.php?option=com_categories&amp;amp;view=categories&amp;amp;extension=com_helloworld&#039;,&lt;br /&gt;
		                         $submenu == &#039;categories&#039;);&lt;br /&gt;
		// set some global property&lt;br /&gt;
		$document = JFactory::getDocument();&lt;br /&gt;
		$document-&amp;gt;addStyleDeclaration(&#039;.icon-48-helloworld &#039; .&lt;br /&gt;
		                               &#039;{background-image: url(../media/com_helloworld/images/tux-48x48.png);}&#039;);&lt;br /&gt;
		if ($submenu == &#039;categories&#039;) &lt;br /&gt;
		{&lt;br /&gt;
			$document-&amp;gt;setTitle(JText::_(&#039;COM_HELLOWORLD_ADMINISTRATION_CATEGORIES&#039;));&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function will be automatically called by the &#039;&#039;com_categories&#039;&#039; component. Note that it will&lt;br /&gt;
* change the submenu&lt;br /&gt;
* change some css properties (for displaying icons)&lt;br /&gt;
* change the browser title if the submenu is &#039;&#039;categories&#039;&#039;&lt;br /&gt;
* change the title and add a &#039;&#039;preferences&#039;&#039; button&lt;br /&gt;
&lt;br /&gt;
We have to change the general controller to call this function and modify the component entry point (the &#039;&#039;.icon-48-helloworld&#039;&#039; css class is now set in the &#039;&#039;addSubmenu&#039;&#039; function)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/controller.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/controller.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import Joomla controller library&lt;br /&gt;
jimport(&#039;joomla.application.component.controller&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * General Controller of HelloWorld component&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldController extends JController&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * display task&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return void&lt;br /&gt;
	 */&lt;br /&gt;
	function display($cachable = false) &lt;br /&gt;
	{&lt;br /&gt;
		// set default view if not set&lt;br /&gt;
		$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
		$input-&amp;gt;set(&#039;view&#039;, $input-&amp;gt;getCmd(&#039;view&#039;, &#039;HelloWorlds&#039;));&lt;br /&gt;
&lt;br /&gt;
		// call parent behavior&lt;br /&gt;
		parent::display($cachable);&lt;br /&gt;
&lt;br /&gt;
		// Set the submenu&lt;br /&gt;
		HelloWorldHelper::addSubmenu(&#039;messages&#039;);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// require helper file&lt;br /&gt;
JLoader::register(&#039;HelloWorldHelper&#039;, dirname(__FILE__) . DS . &#039;helpers&#039; . DS . &#039;helloworld.php&#039;);&lt;br /&gt;
&lt;br /&gt;
// import joomla controller library&lt;br /&gt;
jimport(&#039;joomla.application.component.controller&#039;);&lt;br /&gt;
&lt;br /&gt;
// Get an instance of the controller prefixed by HelloWorld&lt;br /&gt;
$controller = JController::getInstance(&#039;HelloWorld&#039;);&lt;br /&gt;
&lt;br /&gt;
// Perform the Request task&lt;br /&gt;
$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
$controller-&amp;gt;execute($input-&amp;gt;getCmd(&#039;task&#039;));&lt;br /&gt;
&lt;br /&gt;
// Redirect if set by the controller&lt;br /&gt;
$controller-&amp;gt;redirect();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding some translation strings ==&lt;br /&gt;
Some strings have to be translated. In the &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.ini&#039;&#039; file, put these lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/language/en-GB/en-GB.com_helloworld.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/language/en-GB/en-GB.com_helloworld.ini&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
COM_HELLOWORLD=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_ADMINISTRATION=&amp;quot;HelloWorld - Administration&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_ADMINISTRATION_CATEGORIES=&amp;quot;HelloWorld - Categories&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_CREATING=&amp;quot;HelloWorld - Creating&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_DETAILS=&amp;quot;Details&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_EDITING=&amp;quot;HelloWorld - Editing&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_ERROR_UNACCEPTABLE=&amp;quot;Some values are unacceptable&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_CATID_DESC=&amp;quot;The category the messages belongs to&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_CATID_LABEL=&amp;quot;Category&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC=&amp;quot;This message will be displayed&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL=&amp;quot;Message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_HEADING_GREETING=&amp;quot;Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_HEADING_ID=&amp;quot;Id&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MANAGER_HELLOWORLD_EDIT=&amp;quot;HelloWorld manager: Edit Message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MANAGER_HELLOWORLD_NEW=&amp;quot;HelloWorld manager: New Message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MANAGER_HELLOWORLDS=&amp;quot;HelloWorld manager&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_N_ITEMS_DELETED_1=&amp;quot;One message deleted&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_N_ITEMS_DELETED_MORE=&amp;quot;%d messages deleted&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_SUBMENU_MESSAGES=&amp;quot;Messages&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_SUBMENU_CATEGORIES=&amp;quot;Categories&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_04#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#site/language/en-GB/en-GB.com_helloworld.ini|site/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/updates/mysql/0.0.12.sql|admin/sql/updates/mysql/0.0.12.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/models/forms/helloworld.xml|admin/models/forms/helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/forms/helloworld.js|admin/models/forms/helloworld.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/rules/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/rules/greeting.php|admin/models/rules/greeting.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/helloworld.php|admin/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_09#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_10#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_09#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworld/view.html.php|admin/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworld/submitbutton.js|admin/views/helloworld/submitbutton.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworld/tmpl/edit.php|admin/views/helloworld/tmpl/edit.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/helpers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/helpers/helloworld.php|admin/helpers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/language/en-GB/en-GB.com_helloworld.ini|admin/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#admin/language/en-GB/en-GB.com_helloworld.menu.ini|admin/language/en-GB/en-GB.com_helloworld.menu.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/controllers/helloworld.php|admin/controllers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/controllers/helloworlds.php|admin/controllers/helloworldlist.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#language/en-GB/en-GB.ini|language/en-GB/en-GB.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/images/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-16x16.png&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-48x48.png&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [http://joomlacode.org/gf/download/frsrelease/11394/58410/com_helloworld-1.6-part12.zip archive] and install it using the extension manager of Joomla. You can add a menu item of this component using the menu manager in the backend.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;2.5.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;COM_HELLOWORLD&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;November 2009&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.12&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;COM_HELLOWORLD_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New in 2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;media destination=&amp;quot;com_helloworld&amp;quot; folder=&amp;quot;media&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;images&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/media&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu img=&amp;quot;../media/com_helloworld/images/tux-16x16.png&amp;quot;&amp;gt;COM_HELLOWORLD_MENU&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- views files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- controllers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- helpers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;helpers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;languages folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;/languages&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Zips ==&lt;br /&gt;
Download the zip file for this Part:&lt;br /&gt;
[https://github.com/downloads/rvsjoen/joomla-tutorials/com_helloworld-part12.zip]&lt;br /&gt;
&lt;br /&gt;
== Navigate ==&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 11|Prev: Adding verifications]]&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 13|Next: Adding configuration]]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User:Anibal.sanchez|Anibal Sanchez]] // Just a fix&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Joomla! 1.6]]&lt;br /&gt;
[[Category:Joomla! 1.7]]&lt;br /&gt;
[[Category:Joomla! 2.5]]&lt;br /&gt;
[[Category:Manual]]&lt;/div&gt;</summary>
		<author><name>MeeDNite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Adding_categories&amp;diff=75531</id>
		<title>Archived:Developing a MVC Component/Adding categories</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Adding_categories&amp;diff=75531"/>
		<updated>2012-09-21T10:57:22Z</updated>

		<summary type="html">&lt;p&gt;MeeDNite: /* Managing the submenu */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial is for {{JVer|1.6}} {{JVer|1.7}} {{JVer|2.5}}&lt;br /&gt;
{{Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Contents}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
The Joomla framework has implemented the use of categories for all components. Adding categorized ability to a component is fairly simple.&lt;br /&gt;
&lt;br /&gt;
== Modifying the SQL ==&lt;br /&gt;
In order to manage categories, we have to change the SQL tables.&lt;br /&gt;
&lt;br /&gt;
With your favorite editor, modify &#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039; and put these lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/install.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld` (&lt;br /&gt;
  `id` int(11) NOT NULL auto_increment,&lt;br /&gt;
  `greeting` varchar(25) NOT NULL,&lt;br /&gt;
  `catid` int(11) NOT NULL default &#039;0&#039;,&lt;br /&gt;
   PRIMARY KEY  (`id`)&lt;br /&gt;
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;&lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld` (`greeting`) VALUES&lt;br /&gt;
	(&#039;Hello World!&#039;),&lt;br /&gt;
	(&#039;Good bye World!&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/updates/mysql/0.0.12.sql&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/sql/updates/mysql/0.0.12.sql&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER TABLE `#__helloworld` ADD `catid` int(11) NOT NULL default &#039;0&#039; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modifying the form ==&lt;br /&gt;
A HelloWorld message can now belong to a category. We have to modify the editing form. In the &#039;&#039;admin/models/forms/helloworld.xml&#039;&#039; file, put these lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/forms/helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/models/forms/helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;form&lt;br /&gt;
	addrulepath=&amp;quot;/administrator/components/com_helloworld/models/rules&amp;quot;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset&amp;gt;&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
			name=&amp;quot;id&amp;quot;&lt;br /&gt;
			type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
		/&amp;gt;&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
			name=&amp;quot;greeting&amp;quot;&lt;br /&gt;
			type=&amp;quot;text&amp;quot;&lt;br /&gt;
			label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
			description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
			size=&amp;quot;40&amp;quot;&lt;br /&gt;
			class=&amp;quot;inputbox validate-greeting&amp;quot;&lt;br /&gt;
			validate=&amp;quot;greeting&amp;quot;&lt;br /&gt;
			required=&amp;quot;true&amp;quot;&lt;br /&gt;
			default=&amp;quot;&amp;quot;&lt;br /&gt;
		/&amp;gt;&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
			name=&amp;quot;catid&amp;quot;&lt;br /&gt;
			type=&amp;quot;category&amp;quot;&lt;br /&gt;
			extension=&amp;quot;com_helloworld&amp;quot;&lt;br /&gt;
			class=&amp;quot;inputbox&amp;quot;&lt;br /&gt;
			default=&amp;quot;&amp;quot;&lt;br /&gt;
			label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_CATID_LABEL&amp;quot;&lt;br /&gt;
			description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_CATID_DESC&amp;quot;&lt;br /&gt;
			required=&amp;quot;true&amp;quot;&lt;br /&gt;
		&amp;gt;&lt;br /&gt;
			&amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JOPTION_SELECT_CATEGORY&amp;lt;/option&amp;gt;&lt;br /&gt;
		&amp;lt;/field&amp;gt;&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the category can be 0 (representing no category).&lt;br /&gt;
&lt;br /&gt;
== Modifying the menu type ==&lt;br /&gt;
The HelloWorld menu type displays a drop down list of all messages. If the message is categorized, we have to add the category in this display.&lt;br /&gt;
&lt;br /&gt;
In the &#039;&#039;admin/models/fields/helloworld.php&#039;&#039; file, put these lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/fields/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/models/fields/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
// import the list field type&lt;br /&gt;
jimport(&#039;joomla.form.helper&#039;);&lt;br /&gt;
JFormHelper::loadFieldClass(&#039;list&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Form Field class for the HelloWorld component&lt;br /&gt;
 */&lt;br /&gt;
class JFormFieldHelloWorld extends JFormFieldList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The field type.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var		string&lt;br /&gt;
	 */&lt;br /&gt;
	protected $type = &#039;HelloWorld&#039;;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a list of options for a list input.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return	array		An array of JHtml options.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getOptions() &lt;br /&gt;
	{&lt;br /&gt;
		$db = JFactory::getDBO();&lt;br /&gt;
&lt;br /&gt;
		/// $query = new JDatabaseQuery; WARNING - There&#039;s an error in this line, JDatabaseQuery is an abstract class&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true); // THIS IS THE FIX, WARNING IT MUST BE FIXED IN THE ZIP FILES&lt;br /&gt;
&lt;br /&gt;
		$query-&amp;gt;select(&#039;#__helloworld.id as id,greeting,#__categories.title as category,catid&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		$query-&amp;gt;leftJoin(&#039;#__categories on catid=#__categories.id&#039;);&lt;br /&gt;
		$db-&amp;gt;setQuery((string)$query);&lt;br /&gt;
		$messages = $db-&amp;gt;loadObjectList();&lt;br /&gt;
		$options = array();&lt;br /&gt;
		if ($messages)&lt;br /&gt;
		{&lt;br /&gt;
			foreach($messages as $message) &lt;br /&gt;
			{&lt;br /&gt;
				$options[] = JHtml::_(&#039;select.option&#039;, $message-&amp;gt;id, $message-&amp;gt;greeting .&lt;br /&gt;
				                      ($message-&amp;gt;catid ? &#039; (&#039; . $message-&amp;gt;category . &#039;)&#039; : &#039;&#039;));&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		$options = array_merge(parent::getOptions(), $options);&lt;br /&gt;
		return $options;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It will now display the category between parenthesis.&lt;br /&gt;
&lt;br /&gt;
== Managing the submenu ==&lt;br /&gt;
The &#039;&#039;com_categories&#039;&#039; component allows to set the submenu using a helper file. With your favorite file manager and editor, put a &#039;&#039;admin/helpers/helloworld.php&#039;&#039; file containing these lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/helpers/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/helpers/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld component helper.&lt;br /&gt;
 */&lt;br /&gt;
abstract class HelloWorldHelper&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Configure the Linkbar.&lt;br /&gt;
	 */&lt;br /&gt;
	public static function addSubmenu($submenu) &lt;br /&gt;
	{&lt;br /&gt;
		JSubMenuHelper::addEntry(JText::_(&#039;COM_HELLOWORLD_SUBMENU_MESSAGES&#039;),&lt;br /&gt;
		                         &#039;index.php?option=com_helloworld&#039;, $submenu == &#039;messages&#039;);&lt;br /&gt;
		JSubMenuHelper::addEntry(JText::_(&#039;COM_HELLOWORLD_SUBMENU_CATEGORIES&#039;),&lt;br /&gt;
		                         &#039;index.php?option=com_categories&amp;amp;view=categories&amp;amp;extension=com_helloworld&#039;,&lt;br /&gt;
		                         $submenu == &#039;categories&#039;);&lt;br /&gt;
		// set some global property&lt;br /&gt;
		$document = JFactory::getDocument();&lt;br /&gt;
		$document-&amp;gt;addStyleDeclaration(&#039;.icon-48-helloworld &#039; .&lt;br /&gt;
		                               &#039;{background-image: url(../media/com_helloworld/images/tux-48x48.png);}&#039;);&lt;br /&gt;
		if ($submenu == &#039;categories&#039;) &lt;br /&gt;
		{&lt;br /&gt;
			$document-&amp;gt;setTitle(JText::_(&#039;COM_HELLOWORLD_ADMINISTRATION_CATEGORIES&#039;));&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function will be automatically called by the &#039;&#039;com_categories&#039;&#039; component. Note that it will&lt;br /&gt;
* change the submenu&lt;br /&gt;
* change some css properties (for displaying icons)&lt;br /&gt;
* change the browser title if the submenu is &#039;&#039;categories&#039;&#039;&lt;br /&gt;
* change the title and add a &#039;&#039;preferences&#039;&#039; button&lt;br /&gt;
&lt;br /&gt;
We have to change the general controller to call this function and modify the component entry point (the &#039;&#039;.icon-48-helloworld&#039;&#039; css class is now set in the &#039;&#039;addSubmenu&#039;&#039; function)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/controller.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/controller.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import Joomla controller library&lt;br /&gt;
jimport(&#039;joomla.application.component.controller&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * General Controller of HelloWorld component&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldController extends JController&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * display task&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return void&lt;br /&gt;
	 */&lt;br /&gt;
	function display($cachable = false) &lt;br /&gt;
	{&lt;br /&gt;
		// set default view if not set&lt;br /&gt;
		$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
		$input-&amp;gt;set(&#039;view&#039;, $input-&amp;gt;getCmd(&#039;view&#039;, &#039;HelloWorlds&#039;));&lt;br /&gt;
&lt;br /&gt;
		// call parent behavior&lt;br /&gt;
		parent::display($cachable);&lt;br /&gt;
&lt;br /&gt;
		// Set the submenu&lt;br /&gt;
		HelloWorldHelper::addSubmenu(&#039;messages&#039;);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// require helper file&lt;br /&gt;
JLoader::register(&#039;HelloWorldHelper&#039;, dirname(__FILE__) . DS . &#039;helpers&#039; . DS . &#039;helloworld.php&#039;);&lt;br /&gt;
&lt;br /&gt;
// Set some global property&lt;br /&gt;
$document = JFactory::getDocument();&lt;br /&gt;
$document-&amp;gt;addStyleDeclaration(&#039;.icon-48-helloworld {background-image: url(../media/com_helloworld/images/tux-48x48.png);}&#039;);&lt;br /&gt;
&lt;br /&gt;
// import joomla controller library&lt;br /&gt;
jimport(&#039;joomla.application.component.controller&#039;);&lt;br /&gt;
&lt;br /&gt;
// Get an instance of the controller prefixed by HelloWorld&lt;br /&gt;
$controller = JController::getInstance(&#039;HelloWorld&#039;);&lt;br /&gt;
&lt;br /&gt;
// Perform the Request task&lt;br /&gt;
$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
$controller-&amp;gt;execute($input-&amp;gt;getCmd(&#039;task&#039;));&lt;br /&gt;
&lt;br /&gt;
// Redirect if set by the controller&lt;br /&gt;
$controller-&amp;gt;redirect();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding some translation strings ==&lt;br /&gt;
Some strings have to be translated. In the &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.ini&#039;&#039; file, put these lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/language/en-GB/en-GB.com_helloworld.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/language/en-GB/en-GB.com_helloworld.ini&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
COM_HELLOWORLD=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_ADMINISTRATION=&amp;quot;HelloWorld - Administration&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_ADMINISTRATION_CATEGORIES=&amp;quot;HelloWorld - Categories&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_CREATING=&amp;quot;HelloWorld - Creating&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_DETAILS=&amp;quot;Details&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_EDITING=&amp;quot;HelloWorld - Editing&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_ERROR_UNACCEPTABLE=&amp;quot;Some values are unacceptable&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_CATID_DESC=&amp;quot;The category the messages belongs to&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_CATID_LABEL=&amp;quot;Category&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC=&amp;quot;This message will be displayed&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL=&amp;quot;Message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_HEADING_GREETING=&amp;quot;Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_HEADING_ID=&amp;quot;Id&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MANAGER_HELLOWORLD_EDIT=&amp;quot;HelloWorld manager: Edit Message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MANAGER_HELLOWORLD_NEW=&amp;quot;HelloWorld manager: New Message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MANAGER_HELLOWORLDS=&amp;quot;HelloWorld manager&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_N_ITEMS_DELETED_1=&amp;quot;One message deleted&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_N_ITEMS_DELETED_MORE=&amp;quot;%d messages deleted&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_SUBMENU_MESSAGES=&amp;quot;Messages&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_SUBMENU_CATEGORIES=&amp;quot;Categories&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_04#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#site/language/en-GB/en-GB.com_helloworld.ini|site/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/updates/mysql/0.0.12.sql|admin/sql/updates/mysql/0.0.12.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/models/forms/helloworld.xml|admin/models/forms/helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/forms/helloworld.js|admin/models/forms/helloworld.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/rules/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/rules/greeting.php|admin/models/rules/greeting.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/helloworld.php|admin/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_09#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_10#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_09#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworld/view.html.php|admin/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworld/submitbutton.js|admin/views/helloworld/submitbutton.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworld/tmpl/edit.php|admin/views/helloworld/tmpl/edit.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/helpers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/helpers/helloworld.php|admin/helpers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/language/en-GB/en-GB.com_helloworld.ini|admin/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#admin/language/en-GB/en-GB.com_helloworld.menu.ini|admin/language/en-GB/en-GB.com_helloworld.menu.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/controllers/helloworld.php|admin/controllers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/controllers/helloworlds.php|admin/controllers/helloworldlist.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#language/en-GB/en-GB.ini|language/en-GB/en-GB.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/images/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-16x16.png&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-48x48.png&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [http://joomlacode.org/gf/download/frsrelease/11394/58410/com_helloworld-1.6-part12.zip archive] and install it using the extension manager of Joomla. You can add a menu item of this component using the menu manager in the backend.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;2.5.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;COM_HELLOWORLD&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;November 2009&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.12&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;COM_HELLOWORLD_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New in 2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;media destination=&amp;quot;com_helloworld&amp;quot; folder=&amp;quot;media&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;images&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/media&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu img=&amp;quot;../media/com_helloworld/images/tux-16x16.png&amp;quot;&amp;gt;COM_HELLOWORLD_MENU&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- views files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- controllers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- helpers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;helpers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;languages folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;/languages&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Zips ==&lt;br /&gt;
Download the zip file for this Part:&lt;br /&gt;
[https://github.com/downloads/rvsjoen/joomla-tutorials/com_helloworld-part12.zip]&lt;br /&gt;
&lt;br /&gt;
== Navigate ==&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 11|Prev: Adding verifications]]&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 13|Next: Adding configuration]]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User:Anibal.sanchez|Anibal Sanchez]] // Just a fix&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Joomla! 1.6]]&lt;br /&gt;
[[Category:Joomla! 1.7]]&lt;br /&gt;
[[Category:Joomla! 2.5]]&lt;br /&gt;
[[Category:Manual]]&lt;/div&gt;</summary>
		<author><name>MeeDNite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Adding_categories&amp;diff=66313</id>
		<title>Archived:Developing a MVC Component/Adding categories</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Adding_categories&amp;diff=66313"/>
		<updated>2012-04-13T07:53:50Z</updated>

		<summary type="html">&lt;p&gt;MeeDNite: /* Managing the submenu */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial is for {{JVer|1.6}} {{JVer|1.7}} {{JVer|2.5}}&lt;br /&gt;
&lt;br /&gt;
== Articles in this series ==&lt;br /&gt;
{{Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Contents}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
The Joomla framework has implemented the use of categories for all components. Adding categorized ability to a component is fairly simple.&lt;br /&gt;
&lt;br /&gt;
== Modifying the SQL ==&lt;br /&gt;
In order to manage categories, we have to change the SQL tables.&lt;br /&gt;
&lt;br /&gt;
With your favorite editor, modify &#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039; and put these lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/install.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld` (&lt;br /&gt;
  `id` int(11) NOT NULL auto_increment,&lt;br /&gt;
  `greeting` varchar(25) NOT NULL,&lt;br /&gt;
  `catid` int(11) NOT NULL default &#039;0&#039;,&lt;br /&gt;
   PRIMARY KEY  (`id`)&lt;br /&gt;
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;&lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld` (`greeting`) VALUES&lt;br /&gt;
	(&#039;Hello World!&#039;),&lt;br /&gt;
	(&#039;Good bye World!&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/updates/mysql/0.0.12.sql&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/sql/updates/mysql/0.0.12.sql&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER TABLE `#__helloworld` ADD `catid` int(11) NOT NULL default &#039;0&#039; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modifying the form ==&lt;br /&gt;
A HelloWorld message can now belong to a category. We have to modify the editing form. In the &#039;&#039;admin/models/forms/helloworld.xml&#039;&#039; file, put these lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/forms/helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/models/forms/helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;form&lt;br /&gt;
	addrulepath=&amp;quot;/administrator/components/com_helloworld/models/rules&amp;quot;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset&amp;gt;&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
			name=&amp;quot;id&amp;quot;&lt;br /&gt;
			type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
		/&amp;gt;&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
			name=&amp;quot;greeting&amp;quot;&lt;br /&gt;
			type=&amp;quot;text&amp;quot;&lt;br /&gt;
			label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
			description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
			size=&amp;quot;40&amp;quot;&lt;br /&gt;
			class=&amp;quot;inputbox validate-greeting&amp;quot;&lt;br /&gt;
			validate=&amp;quot;greeting&amp;quot;&lt;br /&gt;
			required=&amp;quot;true&amp;quot;&lt;br /&gt;
			default=&amp;quot;&amp;quot;&lt;br /&gt;
		/&amp;gt;&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
			name=&amp;quot;catid&amp;quot;&lt;br /&gt;
			type=&amp;quot;category&amp;quot;&lt;br /&gt;
			extension=&amp;quot;com_helloworld&amp;quot;&lt;br /&gt;
			class=&amp;quot;inputbox&amp;quot;&lt;br /&gt;
			default=&amp;quot;&amp;quot;&lt;br /&gt;
			label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_CATID_LABEL&amp;quot;&lt;br /&gt;
			description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_CATID_DESC&amp;quot;&lt;br /&gt;
			required=&amp;quot;true&amp;quot;&lt;br /&gt;
		&amp;gt;&lt;br /&gt;
			&amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JOPTION_SELECT_CATEGORY&amp;lt;/option&amp;gt;&lt;br /&gt;
		&amp;lt;/field&amp;gt;&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the category can be 0 (representing no category).&lt;br /&gt;
&lt;br /&gt;
== Modifying the menu type ==&lt;br /&gt;
The HelloWorld menu type displays a drop down list of all messages. If the message is categorized, we have to add the category in this display.&lt;br /&gt;
&lt;br /&gt;
In the &#039;&#039;admin/models/fields/helloworld.php&#039;&#039; file, put these lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/fields/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/models/fields/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
// import the list field type&lt;br /&gt;
jimport(&#039;joomla.form.helper&#039;);&lt;br /&gt;
JFormHelper::loadFieldClass(&#039;list&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Form Field class for the HelloWorld component&lt;br /&gt;
 */&lt;br /&gt;
class JFormFieldHelloWorld extends JFormFieldList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The field type.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var		string&lt;br /&gt;
	 */&lt;br /&gt;
	protected $type = &#039;HelloWorld&#039;;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a list of options for a list input.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return	array		An array of JHtml options.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getOptions() &lt;br /&gt;
	{&lt;br /&gt;
		$db = JFactory::getDBO();&lt;br /&gt;
&lt;br /&gt;
		/// $query = new JDatabaseQuery; WARNING - There&#039;s an error in this line, JDatabaseQuery is an abstract class&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true); // THIS IS THE FIX, WARNING IT MUST BE FIXED IN THE ZIP FILES&lt;br /&gt;
&lt;br /&gt;
		$query-&amp;gt;select(&#039;#__helloworld.id as id,greeting,#__categories.title as category,catid&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		$query-&amp;gt;leftJoin(&#039;#__categories on catid=#__categories.id&#039;);&lt;br /&gt;
		$db-&amp;gt;setQuery((string)$query);&lt;br /&gt;
		$messages = $db-&amp;gt;loadObjectList();&lt;br /&gt;
		$options = array();&lt;br /&gt;
		if ($messages)&lt;br /&gt;
		{&lt;br /&gt;
			foreach($messages as $message) &lt;br /&gt;
			{&lt;br /&gt;
				$options[] = JHtml::_(&#039;select.option&#039;, $message-&amp;gt;id, $message-&amp;gt;greeting .&lt;br /&gt;
				                      ($message-&amp;gt;catid ? &#039; (&#039; . $message-&amp;gt;category . &#039;)&#039; : &#039;&#039;));&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		$options = array_merge(parent::getOptions(), $options);&lt;br /&gt;
		return $options;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It will now display the category between parenthesis.&lt;br /&gt;
&lt;br /&gt;
== Managing the submenu ==&lt;br /&gt;
The &#039;&#039;com_categories&#039;&#039; component allows to set the submenu using a helper file. With your favorite file manager and editor, put a &#039;&#039;admin/helpers/helloworld.php&#039;&#039; file containing these lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/helpers/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/helpers/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld component helper.&lt;br /&gt;
 */&lt;br /&gt;
abstract class HelloWorldHelper&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Configure the Linkbar.&lt;br /&gt;
	 */&lt;br /&gt;
	public static function addSubmenu($submenu) &lt;br /&gt;
	{&lt;br /&gt;
		JSubMenuHelper::addEntry(JText::_(&#039;COM_HELLOWORLD_SUBMENU_MESSAGES&#039;),&lt;br /&gt;
		                         &#039;index.php?option=com_helloworld&#039;, $submenu == &#039;messages&#039;);&lt;br /&gt;
		JSubMenuHelper::addEntry(JText::_(&#039;COM_HELLOWORLD_SUBMENU_CATEGORIES&#039;),&lt;br /&gt;
		                         &#039;index.php?option=com_categories&amp;amp;view=categories&amp;amp;extension=com_helloworld&#039;,&lt;br /&gt;
		                         $submenu == &#039;categories&#039;);&lt;br /&gt;
		// set some global property&lt;br /&gt;
		$document = JFactory::getDocument();&lt;br /&gt;
		$document-&amp;gt;addStyleDeclaration(&#039;.icon-48-helloworld &#039; .&lt;br /&gt;
		                               &#039;{background-image: url(../media/com_helloworld/images/tux-48x48.png);}&#039;);&lt;br /&gt;
		if ($submenu == &#039;categories&#039;) &lt;br /&gt;
		{&lt;br /&gt;
			$document-&amp;gt;setTitle(JText::_(&#039;COM_HELLOWORLD_ADMINISTRATION_CATEGORIES&#039;));&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function will be automatically called by the &#039;&#039;com_categories&#039;&#039; component. Note that it will&lt;br /&gt;
* change the submenu&lt;br /&gt;
* change some css properties (for displaying icons)&lt;br /&gt;
* change the browser title if the submenu is &#039;&#039;categories&#039;&#039;&lt;br /&gt;
* change the title and add a &#039;&#039;preferences&#039;&#039; button&lt;br /&gt;
&lt;br /&gt;
We have to change the general controller to call this function and modify the component entry point (the &#039;&#039;.icon-48-helloworld&#039;&#039; css class is now set in the &#039;&#039;addSubmenu&#039;&#039; function)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/controller.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/controller.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import Joomla controller library&lt;br /&gt;
jimport(&#039;joomla.application.component.controller&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * General Controller of HelloWorld component&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldController extends JController&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * display task&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return void&lt;br /&gt;
	 */&lt;br /&gt;
	function display($cachable = false) &lt;br /&gt;
	{&lt;br /&gt;
		// set default view if not set&lt;br /&gt;
		JRequest::setVar(&#039;view&#039;, JRequest::getCmd(&#039;view&#039;, &#039;HelloWorlds&#039;));&lt;br /&gt;
&lt;br /&gt;
		// call parent behavior&lt;br /&gt;
		parent::display($cachable);&lt;br /&gt;
&lt;br /&gt;
		// Set the submenu&lt;br /&gt;
		HelloWorldHelper::addSubmenu(&#039;messages&#039;);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// require helper file&lt;br /&gt;
JLoader::register(&#039;HelloWorldHelper&#039;, dirname(__FILE__) . DS . &#039;helpers&#039; . DS . &#039;helloworld.php&#039;);&lt;br /&gt;
&lt;br /&gt;
// import joomla controller library&lt;br /&gt;
jimport(&#039;joomla.application.component.controller&#039;);&lt;br /&gt;
&lt;br /&gt;
// Get an instance of the controller prefixed by HelloWorld&lt;br /&gt;
$controller = JController::getInstance(&#039;HelloWorld&#039;);&lt;br /&gt;
&lt;br /&gt;
// Perform the Request task&lt;br /&gt;
$controller-&amp;gt;execute(JRequest::getCmd(&#039;task&#039;));&lt;br /&gt;
&lt;br /&gt;
// Redirect if set by the controller&lt;br /&gt;
$controller-&amp;gt;redirect();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding some translation strings ==&lt;br /&gt;
Some strings have to be translated. In the &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.ini&#039;&#039; file, put these lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/language/en-GB/en-GB.com_helloworld.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/language/en-GB/en-GB.com_helloworld.ini&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
COM_HELLOWORLD=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_ADMINISTRATION=&amp;quot;HelloWorld - Administration&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_ADMINISTRATION_CATEGORIES=&amp;quot;HelloWorld - Categories&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_CREATING=&amp;quot;HelloWorld - Creating&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_DETAILS=&amp;quot;Details&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_EDITING=&amp;quot;HelloWorld - Editing&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_ERROR_UNACCEPTABLE=&amp;quot;Some values are unacceptable&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_CATID_DESC=&amp;quot;The category the messages belongs to&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_CATID_LABEL=&amp;quot;Category&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC=&amp;quot;This message will be displayed&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL=&amp;quot;Message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_HEADING_GREETING=&amp;quot;Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_HEADING_ID=&amp;quot;Id&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MANAGER_HELLOWORLD_EDIT=&amp;quot;HelloWorld manager: Edit Message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MANAGER_HELLOWORLD_NEW=&amp;quot;HelloWorld manager: New Message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MANAGER_HELLOWORLDS=&amp;quot;HelloWorld manager&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_N_ITEMS_DELETED_1=&amp;quot;One message deleted&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_N_ITEMS_DELETED_MORE=&amp;quot;%d messages deleted&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_SUBMENU_MESSAGES=&amp;quot;Messages&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_SUBMENU_CATEGORIES=&amp;quot;Categories&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_04#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#site/language/en-GB/en-GB.com_helloworld.ini|site/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/updates/mysql/0.0.12.sql|admin/sql/updates/mysql/0.0.12.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/models/forms/helloworld.xml|admin/models/forms/helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/forms/helloworld.js|admin/models/forms/helloworld.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/rules/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/rules/greeting.php|admin/models/rules/greeting.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/helloworld.php|admin/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_09#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_10#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_09#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworld/view.html.php|admin/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworld/submitbutton.js|admin/views/helloworld/submitbutton.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworld/tmpl/edit.php|admin/views/helloworld/tmpl/edit.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/helpers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/helpers/helloworld.php|admin/helpers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/language/en-GB/en-GB.com_helloworld.ini|admin/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#admin/language/en-GB/en-GB.com_helloworld.menu.ini|admin/language/en-GB/en-GB.com_helloworld.menu.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/controllers/helloworld.php|admin/controllers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/controllers/helloworlds.php|admin/controllers/helloworldlist.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#language/en-GB/en-GB.ini|language/en-GB/en-GB.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/images/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-16x16.png&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-48x48.png&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [http://joomlacode.org/gf/download/frsrelease/11394/58410/com_helloworld-1.6-part12.zip archive] and install it using the extension manager of Joomla. You can add a menu item of this component using the menu manager in the backend.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;2.5.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;COM_HELLOWORLD&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;November 2009&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.12&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;COM_HELLOWORLD_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New in 2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;media destination=&amp;quot;com_helloworld&amp;quot; folder=&amp;quot;media&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;images&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/media&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu img=&amp;quot;../media/com_helloworld/images/tux-16x16.png&amp;quot;&amp;gt;COM_HELLOWORLD_MENU&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- views files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- controllers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- helpers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;helpers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;languages folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;/languages&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Zips ==&lt;br /&gt;
Download the zip file for this Part:&lt;br /&gt;
[http://www.leyar.com/joomlaorg/part12.zip]&lt;br /&gt;
&lt;br /&gt;
== Navigate ==&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 11|Prev: Adding verifications]]&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 13|Next: Adding configuration]]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User:Anibal.sanchez|Anibal Sanchez]] // Just a fix&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[category:Joomla! 1.6]]&lt;br /&gt;
[[category:Joomla! 1.7]]&lt;br /&gt;
[[category:Joomla! 2.5]]&lt;br /&gt;
[[category:Manual]]&lt;/div&gt;</summary>
		<author><name>MeeDNite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Adding_decorations_to_the_backend&amp;diff=66311</id>
		<title>Archived:Developing a MVC Component/Adding decorations to the backend</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Adding_decorations_to_the_backend&amp;diff=66311"/>
		<updated>2012-04-13T06:29:03Z</updated>

		<summary type="html">&lt;p&gt;MeeDNite: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial is for {{JVer|1.6}} {{JVer|1.7}} {{JVer|2.5}}&lt;br /&gt;
&lt;br /&gt;
== Articles in this series ==&lt;br /&gt;
{{Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!1.7 - Contents}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Adding some icons ==&lt;br /&gt;
With your favorite file manager put a 16x16 image and a 48x48 image (I choose &#039;&#039;tux&#039;&#039;) in a &#039;&#039;media/images/&#039;&#039; folder and add a &#039;&#039;media&#039;&#039; tag in your [[#helloworld.xml|install file]]. Modify the &#039;&#039;menu&#039;&#039; tag in order to use the new icon.&lt;br /&gt;
&lt;br /&gt;
== Modifying the views ==&lt;br /&gt;
In the &#039;&#039;admin/views/helloworlds/view.html.php&#039;&#039; file put these lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/view.html.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworlds/view.html.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import Joomla view library&lt;br /&gt;
jimport(&#039;joomla.application.component.view&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorlds View&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorlds extends JView&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * HelloWorlds view display method&lt;br /&gt;
	 * @return void&lt;br /&gt;
	 */&lt;br /&gt;
	function display($tpl = null) &lt;br /&gt;
	{&lt;br /&gt;
		// Get data from the model&lt;br /&gt;
		$items = $this-&amp;gt;get(&#039;Items&#039;);&lt;br /&gt;
		$pagination = $this-&amp;gt;get(&#039;Pagination&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Check for errors.&lt;br /&gt;
		if (count($errors = $this-&amp;gt;get(&#039;Errors&#039;))) &lt;br /&gt;
		{&lt;br /&gt;
			JError::raiseError(500, implode(&#039;&amp;lt;br /&amp;gt;&#039;, $errors));&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		// Assign data to the view&lt;br /&gt;
		$this-&amp;gt;items = $items;&lt;br /&gt;
		$this-&amp;gt;pagination = $pagination;&lt;br /&gt;
&lt;br /&gt;
		// Set the toolbar&lt;br /&gt;
		$this-&amp;gt;addToolBar();&lt;br /&gt;
&lt;br /&gt;
		// Display the template&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
&lt;br /&gt;
		// Set the document&lt;br /&gt;
		$this-&amp;gt;setDocument();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Setting the toolbar&lt;br /&gt;
	 */&lt;br /&gt;
	protected function addToolBar() &lt;br /&gt;
	{&lt;br /&gt;
		JToolBarHelper::title(JText::_(&#039;COM_HELLOWORLD_MANAGER_HELLOWORLDS&#039;), &#039;helloworld&#039;);&lt;br /&gt;
		JToolBarHelper::deleteListX(&#039;&#039;, &#039;helloworlds.delete&#039;);&lt;br /&gt;
		JToolBarHelper::editListX(&#039;helloworld.edit&#039;);&lt;br /&gt;
		JToolBarHelper::addNewX(&#039;helloworld.add&#039;);&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to set up the document properties&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return void&lt;br /&gt;
	 */&lt;br /&gt;
	protected function setDocument() &lt;br /&gt;
	{&lt;br /&gt;
		$document = JFactory::getDocument();&lt;br /&gt;
		$document-&amp;gt;setTitle(JText::_(&#039;COM_HELLOWORLD_ADMINISTRATION&#039;));&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This view uses a second parameter for the &#039;&#039;JToolBarHelper::title&#039;&#039; function. It will be used to construct the css class for the title. The &#039;&#039;_setDocument&#039;&#039; method sets the browser title.&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;admin/views/helloworld/view.html.php&#039;&#039;, put these lines:&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworld/view.html.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworld/view.html.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import Joomla view library&lt;br /&gt;
jimport(&#039;joomla.application.component.view&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld View&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorld extends JView&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * View form&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var		form&lt;br /&gt;
	 */&lt;br /&gt;
	protected $form = null;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * display method of Hello view&lt;br /&gt;
	 * @return void&lt;br /&gt;
	 */&lt;br /&gt;
	public function display($tpl = null) &lt;br /&gt;
	{&lt;br /&gt;
		// get the Data&lt;br /&gt;
		$form = $this-&amp;gt;get(&#039;Form&#039;);&lt;br /&gt;
		$item = $this-&amp;gt;get(&#039;Item&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Check for errors.&lt;br /&gt;
		if (count($errors = $this-&amp;gt;get(&#039;Errors&#039;))) &lt;br /&gt;
		{&lt;br /&gt;
			JError::raiseError(500, implode(&#039;&amp;lt;br /&amp;gt;&#039;, $errors));&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		// Assign the Data&lt;br /&gt;
		$this-&amp;gt;form = $form;&lt;br /&gt;
		$this-&amp;gt;item = $item;&lt;br /&gt;
&lt;br /&gt;
		// Set the toolbar&lt;br /&gt;
		$this-&amp;gt;addToolBar();&lt;br /&gt;
&lt;br /&gt;
		// Display the template&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
&lt;br /&gt;
		// Set the document&lt;br /&gt;
		$this-&amp;gt;setDocument();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Setting the toolbar&lt;br /&gt;
	 */&lt;br /&gt;
	protected function addToolBar() &lt;br /&gt;
	{&lt;br /&gt;
		JRequest::setVar(&#039;hidemainmenu&#039;, true);&lt;br /&gt;
		$isNew = ($this-&amp;gt;item-&amp;gt;id == 0);&lt;br /&gt;
		JToolBarHelper::title($isNew ? JText::_(&#039;COM_HELLOWORLD_MANAGER_HELLOWORLD_NEW&#039;)&lt;br /&gt;
		                             : JText::_(&#039;COM_HELLOWORLD_MANAGER_HELLOWORLD_EDIT&#039;), &#039;helloworld&#039;);&lt;br /&gt;
		JToolBarHelper::save(&#039;helloworld.save&#039;);&lt;br /&gt;
		JToolBarHelper::cancel(&#039;helloworld.cancel&#039;, $isNew ? &#039;JTOOLBAR_CANCEL&#039; : &#039;JTOOLBAR_CLOSE&#039;);&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to set up the document properties&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return void&lt;br /&gt;
	 */&lt;br /&gt;
	protected function setDocument() &lt;br /&gt;
	{&lt;br /&gt;
		$isNew = ($this-&amp;gt;item-&amp;gt;id &amp;lt; 1);&lt;br /&gt;
		$document = JFactory::getDocument();&lt;br /&gt;
		$document-&amp;gt;setTitle($isNew ? JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_CREATING&#039;)&lt;br /&gt;
		                           : JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_EDITING&#039;));&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This view also uses the second parameter of the JToolBarHelper::title function and set the browser title&lt;br /&gt;
&lt;br /&gt;
== Modifying the main entry file ==&lt;br /&gt;
In the &#039;&#039;admin/helloworld.php&#039;&#039; file, put these lines in order to use the 48x48 icon:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// Set some global property&lt;br /&gt;
$document = JFactory::getDocument();&lt;br /&gt;
$document-&amp;gt;addStyleDeclaration(&#039;.icon-48-helloworld {background-image: url(../media/com_helloworld/images/tux-48x48.png);}&#039;);&lt;br /&gt;
&lt;br /&gt;
// import joomla controller library&lt;br /&gt;
jimport(&#039;joomla.application.component.controller&#039;);&lt;br /&gt;
&lt;br /&gt;
// Get an instance of the controller prefixed by HelloWorld&lt;br /&gt;
$controller = JController::getInstance(&#039;HelloWorld&#039;);&lt;br /&gt;
&lt;br /&gt;
// Perform the Request task&lt;br /&gt;
$controller-&amp;gt;execute(JRequest::getCmd(&#039;task&#039;));&lt;br /&gt;
&lt;br /&gt;
// Redirect if set by the controller&lt;br /&gt;
$controller-&amp;gt;redirect();&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding some strings in the language file==&lt;br /&gt;
Modify the &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.ini&#039;&#039; and put these lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/language/en-GB/en-GB.com_helloworld.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/language/en-GB/en-GB.com_helloworld.ini&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
COM_HELLOWORLD_ADMINISTRATION=&amp;quot;HelloWorld - Administration&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_CREATING=&amp;quot;HelloWorld - Creating&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_DETAILS=&amp;quot;Details&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_EDITING=&amp;quot;HelloWorld - Editing&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC=&amp;quot;This message will be displayed&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL=&amp;quot;Message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_HEADING_GREETING=&amp;quot;Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_HEADING_ID=&amp;quot;Id&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MANAGER_HELLOWORLD_EDIT=&amp;quot;HelloWorld manager: Edit Message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MANAGER_HELLOWORLD_NEW=&amp;quot;HelloWorld manager: New Message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MANAGER_HELLOWORLDS=&amp;quot;HelloWorld manager&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_N_ITEMS_DELETED_1=&amp;quot;One message deleted&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_N_ITEMS_DELETED_MORE=&amp;quot;%d messages deleted&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_04#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#site/language/en-GB/en-GB.com_helloworld.ini|site/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_09#admin/models/forms/helloworld.xml|admin/models/forms/helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_09#admin/models/helloworld.php|admin/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_09#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/views/helloworld/view.html.php|admin/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_09#admin/views/helloworld/tmpl/edit.php|admin/views/helloworld/tmpl/edit.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/language/en-GB/en-GB.com_helloworld.ini|admin/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#admin/language/en-GB/en-GB.com_helloworld.menu.ini|admin/language/en-GB/en-GB.com_helloworld.menu.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_09#admin/controllers/helloworld.php|admin/controllers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_09#admin/controllers/helloworlds.php|admin/controllers/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#language/en-GB/en-GB.ini|language/en-GB/en-GB.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/images/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-16x16.png&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-48x48.png&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [http://joomlacode.org/gf/download/frsrelease/11394/58408/com_helloworld-1.6-part10.zip archive] and install it using the extension manager of Joomla. You can add a menu item of this component using the menu manager in the backend.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;2.5.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;November 2009&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.10&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;COM_HELLOWORLD_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New in 2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;media destination=&amp;quot;com_helloworld&amp;quot; folder=&amp;quot;media&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;images&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/media&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu img=&amp;quot;../media/com_helloworld/images/tux-16x16.png&amp;quot;&amp;gt;COM_HELLOWORLD_MENU&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- views files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- controllers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;languages folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;/languages&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Zips ==&lt;br /&gt;
Download the zip file for this Part:&lt;br /&gt;
[http://www.leyar.com/joomlaorg/part10.zip]&lt;br /&gt;
&lt;br /&gt;
== Navigate ==&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 09|Prev: Adding backend actions]]&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 11|Next: Adding verifications]]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[category:Joomla! 1.6]]&lt;br /&gt;
[[category:Joomla! 1.7]]&lt;br /&gt;
[[category:Joomla! 2.5]]&lt;br /&gt;
[[category:Manual]]&lt;/div&gt;</summary>
		<author><name>MeeDNite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User_talk:Cdemko&amp;diff=61652</id>
		<title>User talk:Cdemko</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User_talk:Cdemko&amp;diff=61652"/>
		<updated>2011-08-30T05:51:04Z</updated>

		<summary type="html">&lt;p&gt;MeeDNite: /* Error in part17 file. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hey, your tutorial around part 10: http://docs.joomla.org/Developing_a_Model-View-Controller_%28MVC%29_Component_for_Joomla!1.6_-_Part_10&lt;br /&gt;
is breaking.&lt;br /&gt;
&lt;br /&gt;
Most notably some files such as admin/controllers/helloworldlist.php are extending HelloWorldController but they can not find the class. A simple fix which is working for me is to let them extend JController but I&#039;m unsure of what your intentions were/are with this as the archive source doesn&#039;t reflect this idea (although it did in an earlier page).&lt;br /&gt;
&lt;br /&gt;
== Excellent ==&lt;br /&gt;
&lt;br /&gt;
[[http://docs.joomla.org/Developing_a_Model-View-Controller_%28MVC%29_Component_for_Joomla!1.6_-_Part_15#Creating_the_extension_script_file]]http://docs.joomla.org/Developing_a_Model-View-Controller_%28MVC%29_Component_for_Joomla!1.6_-_Part_15#Creating_the_extension_script_file&lt;br /&gt;
&lt;br /&gt;
Have just created my first complex module that creates a dummy user as well as veiw level specific view levels. Can create them with an sql file and delete all (except the data for the jos_user_usergroup_map data) by title field with sql.  I needed to find a way to use a script to locate the id of the dummy user so that I cand delete the data from jos_user_usergroup_map by id.&lt;br /&gt;
&lt;br /&gt;
Reading your article I converted com_&#039;&#039;&#039;Component&#039;&#039;&#039;NameInstallerScript to mod_&#039;&#039;&#039;Module&#039;&#039;&#039;NameInstallerScript, it worked a treat.  Tested with a standard DELETE FROM ...&#039;, now all I have to do is write the script.&lt;br /&gt;
&lt;br /&gt;
Thank you very much for taking the time to write an excellent article.&lt;br /&gt;
&lt;br /&gt;
[[User:Topazgb|Webdongle]] 22:54, 5 July 2011 (CDT)&lt;br /&gt;
&lt;br /&gt;
== Error in part17 file. ==&lt;br /&gt;
&lt;br /&gt;
Ive found an Error in Part17.zip file,&lt;br /&gt;
in  administrator/components/com_helloworld/models/fields/helloworld.php line 29&lt;br /&gt;
you used :&lt;br /&gt;
&lt;br /&gt;
$query = new JDatabaseQuery;&lt;br /&gt;
&lt;br /&gt;
which returns the error:&lt;br /&gt;
&lt;br /&gt;
Fatal error: Cannot instantiate abstract class JDatabaseQuery in C:\wamp\www\j170test\administrator\components\com_helloworld\models\fields\helloworld.php on line 29&lt;br /&gt;
&lt;br /&gt;
But you used the correct line in this page: &lt;br /&gt;
[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_06]]&lt;br /&gt;
&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
&lt;br /&gt;
Could you please Correct the zip file?&lt;br /&gt;
[[User:MeeDNite]]&lt;/div&gt;</summary>
		<author><name>MeeDNite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User_talk:Cdemko&amp;diff=61651</id>
		<title>User talk:Cdemko</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User_talk:Cdemko&amp;diff=61651"/>
		<updated>2011-08-30T05:49:48Z</updated>

		<summary type="html">&lt;p&gt;MeeDNite: /* Error in part17 file. */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hey, your tutorial around part 10: http://docs.joomla.org/Developing_a_Model-View-Controller_%28MVC%29_Component_for_Joomla!1.6_-_Part_10&lt;br /&gt;
is breaking.&lt;br /&gt;
&lt;br /&gt;
Most notably some files such as admin/controllers/helloworldlist.php are extending HelloWorldController but they can not find the class. A simple fix which is working for me is to let them extend JController but I&#039;m unsure of what your intentions were/are with this as the archive source doesn&#039;t reflect this idea (although it did in an earlier page).&lt;br /&gt;
&lt;br /&gt;
== Excellent ==&lt;br /&gt;
&lt;br /&gt;
[[http://docs.joomla.org/Developing_a_Model-View-Controller_%28MVC%29_Component_for_Joomla!1.6_-_Part_15#Creating_the_extension_script_file]]http://docs.joomla.org/Developing_a_Model-View-Controller_%28MVC%29_Component_for_Joomla!1.6_-_Part_15#Creating_the_extension_script_file&lt;br /&gt;
&lt;br /&gt;
Have just created my first complex module that creates a dummy user as well as veiw level specific view levels. Can create them with an sql file and delete all (except the data for the jos_user_usergroup_map data) by title field with sql.  I needed to find a way to use a script to locate the id of the dummy user so that I cand delete the data from jos_user_usergroup_map by id.&lt;br /&gt;
&lt;br /&gt;
Reading your article I converted com_&#039;&#039;&#039;Component&#039;&#039;&#039;NameInstallerScript to mod_&#039;&#039;&#039;Module&#039;&#039;&#039;NameInstallerScript, it worked a treat.  Tested with a standard DELETE FROM ...&#039;, now all I have to do is write the script.&lt;br /&gt;
&lt;br /&gt;
Thank you very much for taking the time to write an excellent article.&lt;br /&gt;
&lt;br /&gt;
[[User:Topazgb|Webdongle]] 22:54, 5 July 2011 (CDT)&lt;br /&gt;
&lt;br /&gt;
== Error in part17 file. ==&lt;br /&gt;
&lt;br /&gt;
Ive found an Error in Part17.zip file,&lt;br /&gt;
in  administrator/components/com_helloworld/models/fields/helloworld.php line 29&lt;br /&gt;
you used :&lt;br /&gt;
&lt;br /&gt;
$query = new JDatabaseQuery;&lt;br /&gt;
&lt;br /&gt;
which returns the error:&lt;br /&gt;
&lt;br /&gt;
Fatal error: Cannot instantiate abstract class JDatabaseQuery in C:\wamp\www\j170test\administrator\components\com_helloworld\models\fields\helloworld.php on line 29&lt;br /&gt;
&lt;br /&gt;
But you used the correct line in this page: &lt;br /&gt;
[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_06]]&lt;br /&gt;
&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
&lt;br /&gt;
Could you please Correct the zip file?&lt;/div&gt;</summary>
		<author><name>MeeDNite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Adding_a_variable_request_in_the_menu_type&amp;diff=61650</id>
		<title>Archived:Developing a MVC Component/Adding a variable request in the menu type</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Adding_a_variable_request_in_the_menu_type&amp;diff=61650"/>
		<updated>2011-08-30T03:43:52Z</updated>

		<summary type="html">&lt;p&gt;MeeDNite: /* Adding a variable request in the menu type */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial is for {{JVer|1.6}}&lt;br /&gt;
&lt;br /&gt;
== Articles in this series ==&lt;br /&gt;
{{Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Contents}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[Developing a Model-View-Controller (MVC) Component for Joomla!1.6]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Adding a variable request in the menu type ==&lt;br /&gt;
For the moment, the displayed message is always &#039;&#039;Hello World!&#039;&#039;. Joomla!1.6 gives the possibility to add parameters to menu types. In our case, this is done in the &#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039; file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
				name=&amp;quot;id&amp;quot;&lt;br /&gt;
				type=&amp;quot;list&amp;quot;&lt;br /&gt;
				label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
				description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
				default=&amp;quot;1&amp;quot;&lt;br /&gt;
			&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;Hello World!&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&amp;quot;2&amp;quot;&amp;gt;Good bye World!&amp;lt;/option&amp;gt;&lt;br /&gt;
			&amp;lt;/field&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two important things to note:&lt;br /&gt;
* the &#039;&#039;request&#039;&#039; group of fields indicates mandatory fields&lt;br /&gt;
* &amp;lt;span style=&amp;quot;text-decoration:line-through;&amp;quot;&amp;gt;the &#039;&#039;array&#039;&#039; parameter that indicates that these parameters will be added in the request URL&amp;lt;/span&amp;gt; [??]&amp;lt;!-- What??? Where? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The model has to be modified in order to switch between the two different messages (which is chosen by the user with the field defined above):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/models/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import Joomla modelitem library&lt;br /&gt;
jimport(&#039;joomla.application.component.modelitem&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var string msg&lt;br /&gt;
	 */&lt;br /&gt;
	protected $msg;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 * @return string The message to be displayed to the user&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg() &lt;br /&gt;
	{&lt;br /&gt;
		if (!isset($this-&amp;gt;msg)) &lt;br /&gt;
		{&lt;br /&gt;
			$id = JRequest::getInt(&#039;id&#039;);&lt;br /&gt;
			switch ($id) &lt;br /&gt;
			{&lt;br /&gt;
				case 2:&lt;br /&gt;
					$this-&amp;gt;msg = &#039;Good bye World!&#039;;&lt;br /&gt;
					break;&lt;br /&gt;
				default:&lt;br /&gt;
				case 1:&lt;br /&gt;
					$this-&amp;gt;msg = &#039;Hello World!&#039;;&lt;br /&gt;
					break;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		return $this-&amp;gt;msg;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also modify your &#039;&#039;helloworld.xml&#039;&#039; file to indicate the new version:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;1.6.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;November 2009&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.5&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New in 1.6 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can test this variable request by putting &#039;&#039;index.php?option=com_helloworld&amp;amp;id=1&#039;&#039; or &#039;&#039;index.php?option=com_helloworld&amp;amp;id=2&#039;&#039; in your browser address.&lt;br /&gt;
&lt;br /&gt;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_04#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_02#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [http://joomlacode.org/gf/download/frsrelease/11394/58229/com_helloworld-1.6-part05.zip archive] and install it using the extension manager of Joomla!1.6. You can add a menu item of this component using the menu manager in the backend.&lt;br /&gt;
&lt;br /&gt;
== Zips ==&lt;br /&gt;
Download the zip file for this Part:&lt;br /&gt;
[http://www.leyar.com/joomlaorg/part05.zip]&lt;br /&gt;
&lt;br /&gt;
== Navigate ==&lt;br /&gt;
&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Part 04|Prev: Adding a model to the site part]]&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Part 06|Next: Using the database]]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[category:Joomla! 1.6]]&lt;br /&gt;
[[category:Manual]]&lt;/div&gt;</summary>
		<author><name>MeeDNite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_JPagination_in_your_component&amp;diff=37668</id>
		<title>J1.5:Using JPagination in your component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_JPagination_in_your_component&amp;diff=37668"/>
		<updated>2011-03-01T13:05:03Z</updated>

		<summary type="html">&lt;p&gt;MeeDNite: /* Changes to the Template */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete}}&lt;br /&gt;
&lt;br /&gt;
{{RightTOC}}&lt;br /&gt;
==Class Overview==&lt;br /&gt;
The JPagination class, introduced in Joomla! 1.5, allows developers to reliably and consistently add pagination to the Front-end and Back-end display of their components.  The file containing the class can be found at /libraries/joomla/html/pagination.php.  &lt;br /&gt;
&lt;br /&gt;
====Variables====&lt;br /&gt;
The construct function of the class requires three variables:&lt;br /&gt;
* $total - the total number of items in a list,&lt;br /&gt;
* $limitstart - the offset of the item at which to start, and&lt;br /&gt;
* $limit - the number of items to display per page.&lt;br /&gt;
&lt;br /&gt;
====Static Class Methods====&lt;br /&gt;
=====getRowOffset($index)=====&lt;br /&gt;
&lt;br /&gt;
=====getData()=====&lt;br /&gt;
&lt;br /&gt;
=====getPagesCounter()=====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
	/**&lt;br /&gt;
	 * Create and return the pagination pages counter string&lt;br /&gt;
	 *&lt;br /&gt;
	 * @access	public&lt;br /&gt;
	 * @return	string	Pagination pages counter string&lt;br /&gt;
	 * @since	1.5&lt;br /&gt;
	 */&lt;br /&gt;
	function getPagesCounter()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a string containing the current page and total pages as [[image:pagescounter.png]]&lt;br /&gt;
&lt;br /&gt;
=====getResultsCounter()=====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
	/**&lt;br /&gt;
	 * Create and return the pagination result set counter string&lt;br /&gt;
	 *&lt;br /&gt;
	 * @access	public&lt;br /&gt;
	 * @return	string	Pagination result set counter string&lt;br /&gt;
	 * @since	1.5&lt;br /&gt;
	 */&lt;br /&gt;
	function getResultsCounter()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a string containing the results currently being displayed as [[image:resultscounter.png]]&lt;br /&gt;
&lt;br /&gt;
=====getPagesLinks()=====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
	/**&lt;br /&gt;
	 * Create and return the pagination page list string, ie. Previous, Next, 1 2 3 ... x&lt;br /&gt;
	 *&lt;br /&gt;
	 * @access	public&lt;br /&gt;
	 * @return	string	Pagination page list string&lt;br /&gt;
	 * @since	1.0&lt;br /&gt;
	 */&lt;br /&gt;
	function getPagesLinks()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an HTML string to display the Pages Links as [[image:pageslinks.png]]&lt;br /&gt;
&lt;br /&gt;
=====getListFooter()=====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
	/**&lt;br /&gt;
	 * Return the pagination footer&lt;br /&gt;
	 *&lt;br /&gt;
	 * @access	public&lt;br /&gt;
	 * @return	string	Pagination footer&lt;br /&gt;
	 * @since	1.0&lt;br /&gt;
	 */&lt;br /&gt;
	function getListFooter()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a combination of the several page-related elements, including: the Display Limit dropdown, the Pages Links and the Pages Counter.  Appearance differs in the Front-end and Back-end due to additional CSS formatting applied with the Khepri template.&lt;br /&gt;
&lt;br /&gt;
Front-end: [[image:listfooter-front.png]]&lt;br /&gt;
&lt;br /&gt;
Back-end: [[image:pagination.png]]&lt;br /&gt;
&lt;br /&gt;
=====getLimitBox()=====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
	/**&lt;br /&gt;
	 * Creates a dropdown box for selecting how many records to show per page&lt;br /&gt;
	 *&lt;br /&gt;
	 * @access	public&lt;br /&gt;
	 * @return	string	The html for the limit # input box&lt;br /&gt;
	 * @since	1.0&lt;br /&gt;
	 */&lt;br /&gt;
	function getLimitBox()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an HTML string that will output the Display Limit dropdown as [[image:limitbox.png]]&lt;br /&gt;
&lt;br /&gt;
=====orderUpIcon()=====&lt;br /&gt;
&lt;br /&gt;
=====orderDownIcon()=====&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
===with JDatabase===&lt;br /&gt;
Here is a nice method that uses the strength of mysql who knows pagination too.  Really!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Most developers don&#039;t use the SQL_CALC_FOUND_ROWS and just double the query without limit.  Just don&#039;t!! ;-)&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$db =&amp;amp; JFactory::getDBO();&lt;br /&gt;
$lim	= $mainframe-&amp;gt;getUserStateFromRequest(&amp;quot;$option.limit&amp;quot;, &#039;limit&#039;, 14, &#039;int&#039;); //I guess getUserStateFromRequest is for session or different reasons&lt;br /&gt;
$lim0	= JRequest::getVar(&#039;limitstart&#039;, 0, &#039;&#039;, &#039;int&#039;);&lt;br /&gt;
$db-&amp;gt;setQuery(&#039;SELECT SQL_CALC_FOUND_ROWS x, y, z FROM jos_content WHERE x&#039;,$lim0, $lim);&lt;br /&gt;
$rL=&amp;amp;$db-&amp;gt;loadAssocList();&lt;br /&gt;
if (empty($rL)) {$jAp-&amp;gt;enqueueMessage($db-&amp;gt;getErrorMsg(),&#039;error&#039;); return;}	&lt;br /&gt;
else {&lt;br /&gt;
////Here the beauty starts&lt;br /&gt;
$db-&amp;gt;setQuery(&#039;SELECT FOUND_ROWS();&#039;);  //no reloading the query! Just asking for total without limit&lt;br /&gt;
jimport(&#039;joomla.html.pagination&#039;);&lt;br /&gt;
$pageNav = new JPagination( $db-&amp;gt;loadResult(), $lim0, $lim );&lt;br /&gt;
foreach($rL as $r) {&lt;br /&gt;
//your display code here&lt;br /&gt;
}&lt;br /&gt;
echo $pageNav-&amp;gt;getListFooter(  ); //Displays a nice footer&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
====Changes to the Model====&lt;br /&gt;
Declare $_total and $_pagination variables in the model; these will be returned by the functions getTotal() and getPagination(), respectively.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
  /**&lt;br /&gt;
   * Items total&lt;br /&gt;
   * @var integer&lt;br /&gt;
   */&lt;br /&gt;
  var $_total = null;&lt;br /&gt;
&lt;br /&gt;
  /**&lt;br /&gt;
   * Pagination object&lt;br /&gt;
   * @var object&lt;br /&gt;
   */&lt;br /&gt;
  var $_pagination = null;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add to or create a __construct() function that will establish values for the $limitstart and $limit variables as these are needed by the JPagination class.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
  function __construct()&lt;br /&gt;
  {&lt;br /&gt;
 	parent::__construct();&lt;br /&gt;
&lt;br /&gt;
	global $mainframe, $option;&lt;br /&gt;
&lt;br /&gt;
	// Get pagination request variables&lt;br /&gt;
	$limit = $mainframe-&amp;gt;getUserStateFromRequest(&#039;global.list.limit&#039;, &#039;limit&#039;, $mainframe-&amp;gt;getCfg(&#039;list_limit&#039;), &#039;int&#039;);&lt;br /&gt;
	$limitstart = JRequest::getVar(&#039;limitstart&#039;, 0, &#039;&#039;, &#039;int&#039;);&lt;br /&gt;
&lt;br /&gt;
	// In case limit has been changed, adjust it&lt;br /&gt;
	$limitstart = ($limit != 0 ? (floor($limitstart / $limit) * $limit) : 0);&lt;br /&gt;
&lt;br /&gt;
	$this-&amp;gt;setState(&#039;limit&#039;, $limit);&lt;br /&gt;
	$this-&amp;gt;setState(&#039;limitstart&#039;, $limitstart);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Revise the getData() function, adding the $limitstart and $limit values to the _getList() query.  This causes only the needed rows to be returned, rather than all rows. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
  function getData() &lt;br /&gt;
  {&lt;br /&gt;
 	// if data hasn&#039;t already been obtained, load it&lt;br /&gt;
 	if (empty($this-&amp;gt;_data)) {&lt;br /&gt;
 	    $query = $this-&amp;gt;_buildQuery();&lt;br /&gt;
 	    $this-&amp;gt;_data = $this-&amp;gt;_getList($query, $this-&amp;gt;getState(&#039;limitstart&#039;), $this-&amp;gt;getState(&#039;limit&#039;));	&lt;br /&gt;
 	}&lt;br /&gt;
 	return $this-&amp;gt;_data;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a getTotal() function.  This function uses the _getListCount() method from JModel to return the total number of rows in the query.  The value returned will be used by the getPagination() function.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
  function getTotal()&lt;br /&gt;
  {&lt;br /&gt;
 	// Load the content if it doesn&#039;t already exist&lt;br /&gt;
 	if (empty($this-&amp;gt;_total)) {&lt;br /&gt;
 	    $query = $this-&amp;gt;_buildQuery();&lt;br /&gt;
 	    $this-&amp;gt;_total = $this-&amp;gt;_getListCount($query);	&lt;br /&gt;
 	}&lt;br /&gt;
 	return $this-&amp;gt;_total;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a getPagination() function.  The function will create and return a new Pagination object that can be accessed by the View.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
  function getPagination()&lt;br /&gt;
  {&lt;br /&gt;
 	// Load the content if it doesn&#039;t already exist&lt;br /&gt;
 	if (empty($this-&amp;gt;_pagination)) {&lt;br /&gt;
 	    jimport(&#039;joomla.html.pagination&#039;);&lt;br /&gt;
 	    $this-&amp;gt;_pagination = new JPagination($this-&amp;gt;getTotal(), $this-&amp;gt;getState(&#039;limitstart&#039;), $this-&amp;gt;getState(&#039;limit&#039;) );&lt;br /&gt;
 	}&lt;br /&gt;
 	return $this-&amp;gt;_pagination;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Changes to the View====&lt;br /&gt;
Revise the View to obtain the pagination object created in the Model and assign it for use in the template.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  	// Get data from the model&lt;br /&gt;
 	$items =&amp;amp; $this-&amp;gt;get(&#039;Data&#039;);	&lt;br /&gt;
 	$pagination =&amp;amp; $this-&amp;gt;get(&#039;Pagination&#039;);&lt;br /&gt;
&lt;br /&gt;
	// push data into the template&lt;br /&gt;
	$this-&amp;gt;assignRef(&#039;items&#039;, $items);	&lt;br /&gt;
	$this-&amp;gt;assignRef(&#039;pagination&#039;, $pagination);&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Changes to the Template====&lt;br /&gt;
Add a footer area to the display table in the template which holds the pagination object.  The method getListFooter() from the JPagination class generates the buttons and their next/previous functionality as shown in the image above.  Edit colspan=&amp;quot;9&amp;quot; to reflect the number of columns in the table.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;tfoot&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
      &amp;lt;td colspan=&amp;quot;9&amp;quot;&amp;gt;&amp;lt;?php echo $this-&amp;gt;pagination-&amp;gt;getListFooter(); ?&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;/tfoot&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you have to put another hidden input in your adminform.&lt;br /&gt;
in your &amp;quot;default.php&amp;quot; add this to form:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;view&amp;quot; value=&amp;quot;your_view_name&amp;quot; /&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This is to tell joomla! to redirect to &amp;quot;your_view_name&amp;quot; view after changing pagination.&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>MeeDNite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_JTable_class&amp;diff=31503</id>
		<title>J1.5:Using the JTable class</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_JTable_class&amp;diff=31503"/>
		<updated>2010-10-21T07:31:31Z</updated>

		<summary type="html">&lt;p&gt;MeeDNite: Undo revision 31502 by MeeDNite (Talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Development]]&lt;br /&gt;
== Writing an extension of JTable ==&lt;br /&gt;
&lt;br /&gt;
The JTable class is an implementation of the [http://en.wikipedia.org/wiki/Active_record_pattern Active Record] design pattern. It is used throughout Joomla! for [http://en.wikipedia.org/wiki/Create,_read,_update_and_delete creating, reading, updating, and deleting] records in the database table.&lt;br /&gt;
&lt;br /&gt;
To use JTable, create an extension of the class. In this example, we have a database table containing recipes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die();&lt;br /&gt;
&lt;br /&gt;
class TableRecipes extends JTable&lt;br /&gt;
{&lt;br /&gt;
	var $id = null;&lt;br /&gt;
	var $ingredients = null;&lt;br /&gt;
	var $instructions = null;&lt;br /&gt;
	var $serves = null;&lt;br /&gt;
	var $difficulty = null;&lt;br /&gt;
	var $prep_time = null;&lt;br /&gt;
	var $cook_time = null;&lt;br /&gt;
	var $published = 0;&lt;br /&gt;
	&lt;br /&gt;
	function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct( &#039;#__recipes&#039;, &#039;id&#039;, $db );&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When naming your class extension, the convention is to prefix it with &#039;Table&#039;, then follow with a [http://en.wikipedia.org/wiki/CamelCase CamelCased] version of the table&#039;s name. All of the member variables of your class should match the column names in the database. The default values should be valid according to the table schema For instance, if you have columns that are NOT NULL, you must use a value other than &#039;null&#039; as the default.&lt;br /&gt;
&lt;br /&gt;
Finally,  create a constructor for the class that accepts a reference to the current database instance. This will call the parent constructor which needs the name of the table, the name of the primary key column, and the database instance. The name of the table uses #__ instead of jos_, as the administrator can pick any table prefix desired during Joomla! installation.&lt;br /&gt;
&lt;br /&gt;
If you were using this class as a part of a component called &#039;Recipes&#039;, you would place this code in the file /administrator/components/com_recipes/tables/recipes.php.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Using a JTable class extension ==&lt;br /&gt;
&lt;br /&gt;
Once the table class is in place, you can use it in any Joomla! extension. To include the file, place this line in your extension&#039;s source code (use com_nameofyourcomponent in place of com_recipes):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.&#039;components&#039;.DS.&#039;com_recipes&#039;.DS.&#039;tables&#039;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get an instance of the object, use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$row =&amp;amp; JTable::getInstance(&#039;recipes&#039;, &#039;Table&#039;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the lowercase version of the suffix of your class name is used as the first parameter, with the prefix &#039;Table&#039; as the second. Also, the getInstance() member function of JTable returns the object by reference instead of value; use =&amp;amp; to enforce this. &lt;br /&gt;
&lt;br /&gt;
In a model class (extends JModel) you can also use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$row =&amp;amp; $this-&amp;gt;getTable(&#039;recipes&#039;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that if you have not used the standard naming convention, you can supply the class prefix as the optional second parameter.&lt;br /&gt;
&lt;br /&gt;
=== Create/Update ===&lt;br /&gt;
In a typical situation, you will have an HTML form submitted by the user which will PHP will interpret for you as an associative array. The JRequest class in Joomla! has functions ready to assist with retrieving this data safely. Use JRequest::get(&#039;post&#039;) to retrieve all of the elements in the HTTP POST request as a sanitized array.&lt;br /&gt;
&lt;br /&gt;
Once you have this array, you can pass it into the bind() method of JTable. Doing this will match the associated items of the array with member variables of the class. In the following example, the array is retrieved from JRequest::get(&#039;post&#039;) and immediately passed into bind(). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if (!$row-&amp;gt;bind( JRequest::get( &#039;post&#039; ) )) {&lt;br /&gt;
	return JError::raiseWarning( 500, $row-&amp;gt;getError() );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If bind() fails, you want to stop the application and explain the failure before your extension attempts to send the data. The raiseWarning() function of JError allows you to stop Joomla!, while the getError() function returns the error message stored in the JTable object.&lt;br /&gt;
&lt;br /&gt;
When binding succeeds and your object is ready, call the store() function. Again, if something goes wrong, stop the application and explain why.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if (!$row-&amp;gt;store()) {&lt;br /&gt;
	JError::raiseError(500, $row-&amp;gt;getError() );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* If any member variables of your JTable object are null when store() is called, they are ignored by default. This allows you to update specific columns of your table, while leaving the others untouched. If you wish to override this behavior to ensure that all columns have a value, pass true into store().&lt;br /&gt;
* The JTable::bind() and JRequest::get() functions do not enforce data types. If you need a column to be a specific type (for instance, integer), you need to add this logic to your code before calling store().&lt;br /&gt;
&lt;br /&gt;
=== Read ===&lt;br /&gt;
To load a specific row of the database with JTable, pass the key into the load() member function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$row-&amp;gt;load( $id );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This relies on the key column you specified in the second parameter of parent::__construct() when you extended JTable.&lt;br /&gt;
&lt;br /&gt;
=== Delete ===&lt;br /&gt;
Like read(), delete() allows you to destroy a specific row in the table based on the key specified earlier.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$row-&amp;gt;delete( $id );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to delete multiple rows at once, you will need to write the query manually.&lt;br /&gt;
&lt;br /&gt;
== Member Functions ==&lt;br /&gt;
{{jfr summary|class=JTable|methods=yes}}&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
When properly extended, JTable gives you all of the basic functions you need for managing and retrieving records in a database table. Member functions take care of the rest when you add member variables, the table name, and the key column.&lt;/div&gt;</summary>
		<author><name>MeeDNite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_JTable_class&amp;diff=31502</id>
		<title>J1.5:Using the JTable class</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_JTable_class&amp;diff=31502"/>
		<updated>2010-10-21T07:06:41Z</updated>

		<summary type="html">&lt;p&gt;MeeDNite: /* Using a JTable class extension */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Development]]&lt;br /&gt;
== Writing an extension of JTable ==&lt;br /&gt;
&lt;br /&gt;
The JTable class is an implementation of the [http://en.wikipedia.org/wiki/Active_record_pattern Active Record] design pattern. It is used throughout Joomla! for [http://en.wikipedia.org/wiki/Create,_read,_update_and_delete creating, reading, updating, and deleting] records in the database table.&lt;br /&gt;
&lt;br /&gt;
To use JTable, create an extension of the class. In this example, we have a database table containing recipes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die();&lt;br /&gt;
&lt;br /&gt;
class TableRecipes extends JTable&lt;br /&gt;
{&lt;br /&gt;
	var $id = null;&lt;br /&gt;
	var $ingredients = null;&lt;br /&gt;
	var $instructions = null;&lt;br /&gt;
	var $serves = null;&lt;br /&gt;
	var $difficulty = null;&lt;br /&gt;
	var $prep_time = null;&lt;br /&gt;
	var $cook_time = null;&lt;br /&gt;
	var $published = 0;&lt;br /&gt;
	&lt;br /&gt;
	function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct( &#039;#__recipes&#039;, &#039;id&#039;, $db );&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When naming your class extension, the convention is to prefix it with &#039;Table&#039;, then follow with a [http://en.wikipedia.org/wiki/CamelCase CamelCased] version of the table&#039;s name. All of the member variables of your class should match the column names in the database. The default values should be valid according to the table schema For instance, if you have columns that are NOT NULL, you must use a value other than &#039;null&#039; as the default.&lt;br /&gt;
&lt;br /&gt;
Finally,  create a constructor for the class that accepts a reference to the current database instance. This will call the parent constructor which needs the name of the table, the name of the primary key column, and the database instance. The name of the table uses #__ instead of jos_, as the administrator can pick any table prefix desired during Joomla! installation.&lt;br /&gt;
&lt;br /&gt;
If you were using this class as a part of a component called &#039;Recipes&#039;, you would place this code in the file /administrator/components/com_recipes/tables/recipes.php.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Using a JTable class extension ==&lt;br /&gt;
&lt;br /&gt;
Once the table class is in place, you can use it in any Joomla! extension. To include the file, place this line in your extension&#039;s source code (use com_nameofyourcomponent in place of com_recipes):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.&#039;components&#039;.DS.&#039;com_recipes&#039;.DS.&#039;tables&#039;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get an instance of the object, use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$row =&amp;amp; JTable::getInstance(&#039;recipes&#039;, &#039;Table&#039;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the lowercase version of the suffix of your class name is used as the first parameter, with the prefix &#039;Table&#039; as the second. Also, the getInstance() member function of JTable returns the object by reference instead of value; use =&amp;amp; to enforce this. &lt;br /&gt;
&lt;br /&gt;
In a model class (extends JModel) or any class or method ( like helpers when you do not have an instance of the class ) where you imported JTable class using this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
jimport( &#039;joomla.database.table&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you can also use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$row =&amp;amp; $this-&amp;gt;getTable(&#039;recipes&#039;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that if you have not used the standard naming convention, you can supply the class prefix as the optional second parameter.&lt;br /&gt;
&lt;br /&gt;
=== Create/Update ===&lt;br /&gt;
In a typical situation, you will have an HTML form submitted by the user which will PHP will interpret for you as an associative array. The JRequest class in Joomla! has functions ready to assist with retrieving this data safely. Use JRequest::get(&#039;post&#039;) to retrieve all of the elements in the HTTP POST request as a sanitized array.&lt;br /&gt;
&lt;br /&gt;
Once you have this array, you can pass it into the bind() method of JTable. Doing this will match the associated items of the array with member variables of the class. In the following example, the array is retrieved from JRequest::get(&#039;post&#039;) and immediately passed into bind(). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if (!$row-&amp;gt;bind( JRequest::get( &#039;post&#039; ) )) {&lt;br /&gt;
	return JError::raiseWarning( 500, $row-&amp;gt;getError() );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If bind() fails, you want to stop the application and explain the failure before your extension attempts to send the data. The raiseWarning() function of JError allows you to stop Joomla!, while the getError() function returns the error message stored in the JTable object.&lt;br /&gt;
&lt;br /&gt;
When binding succeeds and your object is ready, call the store() function. Again, if something goes wrong, stop the application and explain why.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if (!$row-&amp;gt;store()) {&lt;br /&gt;
	JError::raiseError(500, $row-&amp;gt;getError() );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* If any member variables of your JTable object are null when store() is called, they are ignored by default. This allows you to update specific columns of your table, while leaving the others untouched. If you wish to override this behavior to ensure that all columns have a value, pass true into store().&lt;br /&gt;
* The JTable::bind() and JRequest::get() functions do not enforce data types. If you need a column to be a specific type (for instance, integer), you need to add this logic to your code before calling store().&lt;br /&gt;
&lt;br /&gt;
=== Read ===&lt;br /&gt;
To load a specific row of the database with JTable, pass the key into the load() member function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$row-&amp;gt;load( $id );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This relies on the key column you specified in the second parameter of parent::__construct() when you extended JTable.&lt;br /&gt;
&lt;br /&gt;
=== Delete ===&lt;br /&gt;
Like read(), delete() allows you to destroy a specific row in the table based on the key specified earlier.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$row-&amp;gt;delete( $id );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to delete multiple rows at once, you will need to write the query manually.&lt;br /&gt;
&lt;br /&gt;
== Member Functions ==&lt;br /&gt;
{{jfr summary|class=JTable|methods=yes}}&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
When properly extended, JTable gives you all of the basic functions you need for managing and retrieving records in a database table. Member functions take care of the rest when you add member variables, the table name, and the key column.&lt;/div&gt;</summary>
		<author><name>MeeDNite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_JToolBar_class_in_the_frontend&amp;diff=29722</id>
		<title>J1.5:Using the JToolBar class in the frontend</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_JToolBar_class_in_the_frontend&amp;diff=29722"/>
		<updated>2010-08-09T07:35:32Z</updated>

		<summary type="html">&lt;p&gt;MeeDNite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Anyone whom has used the very useful JToolbarHelper class in an administration component has probably already realised that there is nothing quite so useful for the frontend. The good news is that we can create our own very simply using the JToolbar class.&lt;br /&gt;
&lt;br /&gt;
First lets create the helper class. I tend to make a different helper class for each component as they will each have a different toolbar. I like to keep all my helpers in the administration end as they can often be used for both sides of the component. So firstly create a helpers directory in your component.&lt;br /&gt;
&lt;br /&gt;
/administrator/components/com_yourcom/helpers&lt;br /&gt;
&lt;br /&gt;
and create a file called toolbar.php&lt;br /&gt;
&lt;br /&gt;
The following is an example of a very simple toolbar helper class. Copy and paste this into your toolbar.php file. Don&#039;t forget to change &#039;yourcom&#039; to the name of your component. Notice also that we&#039;ve included the Jtoolbar class at the top of the file.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 // no direct access&lt;br /&gt;
 defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 jimport(&#039;joomla.html.toolbar&#039;);&lt;br /&gt;
 &lt;br /&gt;
 class YourcomHelperToolbar extends JObject&lt;br /&gt;
 {	&lt;br /&gt;
 	function getToolbar() {&lt;br /&gt;
 		&lt;br /&gt;
 		&lt;br /&gt;
 		$bar =&amp;amp; new JToolBar( &#039;My Toolbar&#039; );&lt;br /&gt;
 		$bar-&amp;gt;appendButton( &#039;Standard&#039;, &#039;new&#039;, &#039;New Record&#039;, &#039;new&#039;, false );&lt;br /&gt;
 		$bar-&amp;gt;appendButton( &#039;Separator&#039; );&lt;br /&gt;
 		$bar-&amp;gt;appendButton( &#039;Standard&#039;, &#039;delete&#039;, &#039;Delete Record&#039;, &#039;delete&#039;, false );&lt;br /&gt;
 		&lt;br /&gt;
 		&lt;br /&gt;
 		return $bar-&amp;gt;render();&lt;br /&gt;
 	&lt;br /&gt;
 	}&lt;br /&gt;
 	&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Lets look at this code. When the &#039;getToolbar&#039; function is called it creates a new instance of the JToolbar class.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 $bar =&amp;amp; new JToolBar( &#039;Associations Toolbar&#039; );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We can then add buttons to this object.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 $bar-&amp;gt;appendButton( &#039;Standard&#039;, &#039;new&#039;, &#039;New Record&#039;, &#039;new&#039;, false );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The first parameter is the button type. have a look a the JToolbar or JButton docs for a full list of these.&lt;br /&gt;
&lt;br /&gt;
The second parameter is the class to apply to the button ( this will help us to apply an image to it as in the backend )&lt;br /&gt;
&lt;br /&gt;
The third parameter is the text to display on the button.&lt;br /&gt;
&lt;br /&gt;
The fourth is the task to set. When the button is pressed the javascript submitButton function is called and the hidden field &#039;task&#039; is set to this value. We will see this later in our template file.&lt;br /&gt;
&lt;br /&gt;
The fifth states whether a selection must be made from an admin list before continuing.&lt;br /&gt;
&lt;br /&gt;
we then simply return our bar object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We now have a choice of where to render this bar object. You can create it in a view and apply it to a template if you wish. I personally prefer to render it in the entry point file. In this example this would be yourcom.php and would look something like this. Notice that we have also included our helper file here.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 // no direct access&lt;br /&gt;
 defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 &lt;br /&gt;
 // Require the base controller&lt;br /&gt;
 require_once (JPATH_COMPONENT.DS.&#039;controller.php&#039;);&lt;br /&gt;
 &lt;br /&gt;
 // Require specific controller if requested&lt;br /&gt;
 if($controller = JRequest::getVar(&#039;controller&#039;)) {&lt;br /&gt;
 	require_once (JPATH_COMPONENT.DS.&#039;controllers&#039;.DS.$controller.&#039;.php&#039;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // Component Helper&lt;br /&gt;
 jimport(&#039;joomla.application.component.helper&#039;);&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // Load the toolbar helper&lt;br /&gt;
 require_once( JPATH_COMPONENT_ADMINISTRATOR.DS.&#039;helpers&#039;.DS.&#039;toolbar.php&#039; );&lt;br /&gt;
 &lt;br /&gt;
 // render the toolbar on the page. rendering it here means that it is displayed on every view of your component.&lt;br /&gt;
 echo YourcomHelperToolbar::getToolbar();&lt;br /&gt;
 &lt;br /&gt;
 // Create the controller&lt;br /&gt;
 $classname	= &#039;YourcomController&#039;.$controller;&lt;br /&gt;
 $controller = new $classname( );&lt;br /&gt;
 &lt;br /&gt;
 // Perform the Request task&lt;br /&gt;
 $controller-&amp;gt;execute( JRequest::getVar(&#039;task&#039;));&lt;br /&gt;
 &lt;br /&gt;
 // Redirect if set by the controller&lt;br /&gt;
 $controller-&amp;gt;redirect();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Having created this the toolbar you created should render on the page but there are a few more things we need to do to make it work. We need to ensure that every view template page has an admin form for the submitButton function to work.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;form action = &amp;quot;index.php&amp;quot; method =  &amp;quot;post&amp;quot; id = &amp;quot;adminForm&amp;quot; name = &amp;quot;adminForm&amp;quot; /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;input type = &amp;quot;hidden&amp;quot; name = &amp;quot;task&amp;quot; value = &amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;input type = &amp;quot;hidden&amp;quot; name = &amp;quot;option&amp;quot; value = &amp;quot;com_yourcom&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now when one of the buttons is clicked the submitbutton function will set the hidden field &#039;task&#039; to the task identifier you specified in the toolbar class.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 $bar-&amp;gt;appendButton( &#039;Standard&#039;, &#039;delete&#039;, &#039;Delete Record&#039;, &#039;new&#039;, false );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
In the above button the task would be &#039;new&#039; ( the fourth parameter );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If this task is going to be run we had better make sure that it&#039;s available in our controller. Open up your controller.php and add the following.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 function new() &lt;br /&gt;
 	{&lt;br /&gt;
 		JRequest::setVar(&#039;view&#039; , &#039;new&#039;);&lt;br /&gt;
 		&lt;br /&gt;
 		parent::display();&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will display your &#039;new&#039; view assuming you&#039;ve already created one. You could put any code in here you like.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There we go that should create a nice easy to use toolbar class. There is one last thing though. You may have noticed that the icons are not displaying as they do in the backend. To make this work we have to &#039;steal&#039; some images and some CSS from the backend.&lt;br /&gt;
&lt;br /&gt;
open up the folder &lt;br /&gt;
&lt;br /&gt;
 administrator/templates/khepri/images &lt;br /&gt;
&lt;br /&gt;
and copy the directory &#039;toolbar&#039; directory to your frontend templates/rhuk_milkyway/images folder&lt;br /&gt;
&lt;br /&gt;
It should now look like this&lt;br /&gt;
&lt;br /&gt;
 templates/rhuk_milkyway/images/toolbar&lt;br /&gt;
&lt;br /&gt;
and be filled with png images&lt;br /&gt;
&lt;br /&gt;
Now you could hunt around through the backend css to find the correct code to display the buttons but I&#039;ve saved you the trouble. In your templates/css folder create a file called icon.css and paste in the following code.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 /* toolbar */&lt;br /&gt;
 div.toolbar { float: right; text-align: right; padding: 0; }&lt;br /&gt;
 &lt;br /&gt;
 table.toolbar    			 { border-collapse: collapse; padding: 0; margin: 0;	 }&lt;br /&gt;
 table.toolbar td 			 { padding: 1px 1px 1px 4px; text-align: center; color: #666; height: 48px; }&lt;br /&gt;
 table.toolbar td.spacer  { width: 10px; }&lt;br /&gt;
 table.toolbar td.divider { border-right: 1px solid #eee; width: 5px; } &lt;br /&gt;
 &lt;br /&gt;
 table.toolbar span { float: none; width: 32px; height: 32px; margin: 0 auto; display: block; }&lt;br /&gt;
 &lt;br /&gt;
 table.toolbar a {&lt;br /&gt;
    display: block; float: left;&lt;br /&gt;
 	white-space: nowrap;&lt;br /&gt;
 	border: 1px solid #fbfbfb;&lt;br /&gt;
 	padding: 1px 5px;&lt;br /&gt;
 	cursor: pointer;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 table.toolbar a:hover {&lt;br /&gt;
 	border-left: 1px solid #eee;&lt;br /&gt;
 	border-top: 1px solid #eee;&lt;br /&gt;
 	border-right: 1px solid #ccc;&lt;br /&gt;
 	border-bottom: 1px solid #ccc;&lt;br /&gt;
 	text-decoration: none;&lt;br /&gt;
 	color: #0B55C4;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 /** toolbar icons **/&lt;br /&gt;
 .icon-32-send 			{ background-image: url(../images/toolbar/icon-32-send.png); }&lt;br /&gt;
 .icon-32-delete 		{ background-image: url(../images/toolbar/icon-32-delete.png); }&lt;br /&gt;
 .icon-32-help 			{ background-image: url(../images/toolbar/icon-32-help.png); }&lt;br /&gt;
 .icon-32-cancel 		{ background-image: url(../images/toolbar/icon-32-cancel.png); }&lt;br /&gt;
 .icon-32-config 		{ background-image: url(../images/toolbar/icon-32-config.png); }&lt;br /&gt;
 .icon-32-apply 		{ background-image: url(../images/toolbar/icon-32-apply.png); }&lt;br /&gt;
 .icon-32-back			{ background-image: url(../images/toolbar/icon-32-back.png); }&lt;br /&gt;
 .icon-32-forward		{ background-image: url(../images/toolbar/icon-32-forward.png); }&lt;br /&gt;
 .icon-32-save 			{ background-image: url(../images/toolbar/icon-32-save.png); }&lt;br /&gt;
 .icon-32-edit 			{ background-image: url(../images/toolbar/icon-32-edit.png); }&lt;br /&gt;
 .icon-32-copy 			{ background-image: url(../images/toolbar/icon-32-copy.png); }&lt;br /&gt;
 .icon-32-move 			{ background-image: url(../images/toolbar/icon-32-move.png); }&lt;br /&gt;
 .icon-32-new 			{ background-image: url(../images/toolbar/icon-32-new.png); }&lt;br /&gt;
 .icon-32-upload 		{ background-image: url(../images/toolbar/icon-32-upload.png); }&lt;br /&gt;
 .icon-32-assign 		{ background-image: url(../images/toolbar/icon-32-publish.png); }&lt;br /&gt;
 .icon-32-html 			{ background-image: url(../images/toolbar/icon-32-html.png); }&lt;br /&gt;
 .icon-32-css 			{ background-image: url(../images/toolbar/icon-32-css.png); }&lt;br /&gt;
 .icon-32-menus 			{ background-image: url(../images/toolbar/icon-32-menu.png); }&lt;br /&gt;
 .icon-32-publish 		{ background-image: url(../images/toolbar/icon-32-publish.png); }&lt;br /&gt;
 .icon-32-unpublish 	{ background-image: url(../images/toolbar/icon-32-unpublish.png);}&lt;br /&gt;
 .icon-32-restore		{ background-image: url(../images/toolbar/icon-32-revert.png); }&lt;br /&gt;
 .icon-32-trash 		{ background-image: url(../images/toolbar/icon-32-trash.png); }&lt;br /&gt;
 .icon-32-archive 		{ background-image: url(../images/toolbar/icon-32-archive.png); }&lt;br /&gt;
 .icon-32-unarchive 	{ background-image: url(../images/toolbar/icon-32-unarchive.png); }&lt;br /&gt;
 .icon-32-preview 		{ background-image: url(../images/toolbar/icon-32-preview.png); }&lt;br /&gt;
 .icon-32-default 		{ background-image: url(../images/toolbar/icon-32-default.png); }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We now have to include this css in to your template so add the following line to the top of your template index.php&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;&amp;lt;?php echo $this-&amp;gt;baseurl ?&amp;gt;/templates/rhuk_milkyway/css/icon.css&amp;quot; type=&amp;quot;text/css&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
(if you are using the toolbar on a component that other people will be installing it would be better to use: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$mainframe-&amp;gt;addCustomHeadTag (&#039;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;&#039;.$this-&amp;gt;baseurl.&#039;/components/com_**yourcomponent**/filename.css&amp;quot; type=&amp;quot;text/css&amp;quot; media=&amp;quot;screen&amp;quot; /&amp;gt;&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
And finally - you will require the javascript file used in the backend to enable the buttons to work ;-)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$mainframe-&amp;gt;addCustomHeadTag (&#039;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/includes/js/joomla.javascript.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
And that&#039;s it. your toolbar should now render exactly as it does in the backend. This is a very simple toolbar helper. You could equally copy the JToolbarHelper class exactly in to your toolbar helper and use the functions in the same way as the backend. This would allow you to reuse your jtoolbar helper in multiple components.&lt;br /&gt;
&lt;br /&gt;
To use JToolbarHelper Class in frontend section of your component, add this code to your component&#039;s entry point ( components/com_yourcom/yourcom.php )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
require_once(JPATH_ADMINISTRATOR.DS.&#039;includes&#039;.DS.&#039;toolbar.php&#039;);&lt;br /&gt;
$doc =&amp;amp; JFactory::getDocument();&lt;br /&gt;
$doc-&amp;gt;addScript(&amp;quot;includes/js/joomla.javascript.js&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Development]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>MeeDNite</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Developing_a_Basic_Component&amp;diff=26722</id>
		<title>Archived:Developing a MVC Component/Developing a Basic Component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Developing_a_Basic_Component&amp;diff=26722"/>
		<updated>2010-04-16T21:16:07Z</updated>

		<summary type="html">&lt;p&gt;MeeDNite: /* The first basic component */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{underconstruction}}&lt;br /&gt;
{{future|1.6}}&lt;br /&gt;
&lt;br /&gt;
== Articles in this series ==&lt;br /&gt;
{{Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Contents}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[Developing a Model-View-Controller (MVC) Component for Joomla!1.6]] tutorial.&lt;br /&gt;
&lt;br /&gt;
== The first basic component ==&lt;br /&gt;
Let&#039;s create a &#039;&#039;Hello World!&#039;&#039; component.&lt;br /&gt;
=== Public display ===&lt;br /&gt;
With your favorite file manager and editor, create a file &#039;&#039;site/helloworld.php&#039;&#039; containing &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
Hello world&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can test this basic component by putting &#039;&#039;index.php?option=com_helloworld&#039;&#039; in your browser address (don&#039;t forget to prefix this address with your Joomla!1.6 installation path).&lt;br /&gt;
&lt;br /&gt;
=== Administrator management ===&lt;br /&gt;
With your favorite file manager and editor, create a file &#039;&#039;admin/helloworld.php&#039;&#039; containing &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
Hello world administration&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can test this basic component by putting &#039;&#039;administrator/index.php?option=com_helloworld&#039;&#039; in your browser address.&lt;br /&gt;
&lt;br /&gt;
=== Packaging an installation zip file ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Delete the &#039;&#039;components/com_helloworld&#039;&#039; and &#039;&#039;administrator/components/com_helloworld&#039;&#039; directories of your Joomla!1.6 installation.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager, create a directory (outside your Joomla!1.6 installation directory) containing&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [http://joomlacode.org/gf/download/frsrelease/11394/46139/com_helloworld-1.6-part01.zip archive] and install it using the extension manager of Joomla!1.6. You can test this basic component by putting &#039;&#039;index.php?option=com_helloworld&#039;&#039; or &#039;&#039;administrator/index.php?option=com_helloworld&#039;&#039; in your browser address. You can also notice that the &#039;&#039;Hello World!&#039;&#039; component is visible in the administrator site of your Joomla!1.6 installation under the &#039;&#039;Components&#039;&#039; menu.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;1.6.0&amp;quot; method=&amp;quot;install&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;name&amp;gt;com_helloworld&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;November 2009&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.1&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;		&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
Hello World&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
Hello World administration&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;index.html&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;index.html&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&amp;lt;body bgcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[category:Joomla! 1.6]]&lt;br /&gt;
[[category:Manual]]&lt;/div&gt;</summary>
		<author><name>MeeDNite</name></author>
	</entry>
</feed>