<?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=Betweenbrain</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=Betweenbrain"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Betweenbrain"/>
	<updated>2026-05-28T03:27:40Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Talk:How_to_use_the_filesystem_package&amp;diff=472810</id>
		<title>Talk:How to use the filesystem package</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Talk:How_to_use_the_filesystem_package&amp;diff=472810"/>
		<updated>2017-12-15T13:59:23Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: /* Use of JInput */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The example shows a terrible coding practice: nesting ifs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   if ( strtolower(JFile::getExt($filename) ) == &#039;jpg&#039;) {&lt;br /&gt;
      if ( JFile::upload($src, $dest) ) {&lt;br /&gt;
         //Redirect to a page of your choice&lt;br /&gt;
      } else {&lt;br /&gt;
         //Redirect and throw an error message&lt;br /&gt;
      }&lt;br /&gt;
   } else {&lt;br /&gt;
      //Redirect and notify user file is not right extension&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This sort of thing creates huge chains of if&#039;s that no knows how to look at. I think a better sample code would be:&lt;br /&gt;
&lt;br /&gt;
   if ( strtolower(JFile::getExt($filename) ) != &#039;jpg&#039;)&lt;br /&gt;
      //Redirect and notify user file is not right extension&lt;br /&gt;
   else if ( !JFile::upload($src, $dest) )&lt;br /&gt;
      //Redirect and throw an error message&lt;br /&gt;
   else&lt;br /&gt;
      //Redirect to a page of your choice&lt;br /&gt;
&lt;br /&gt;
(Ideally we&#039;d put this in a function and return after each if, but KISS :) )&lt;br /&gt;
&lt;br /&gt;
== Use of JInput ==&lt;br /&gt;
&lt;br /&gt;
According to https://docs.joomla.org/Retrieving_request_data_using_JInput, JFactory::getApplication()-&amp;gt;input-&amp;gt;get(&#039;file_upload&#039;); should be JFactory::getApplication()-&amp;gt;input-&amp;gt;files-&amp;gt;get(&#039;file_upload&#039;);&lt;br /&gt;
&lt;br /&gt;
Should the doc be changed for all versions of Joomla (e.g. the doc is incorrect), or is this change only applicable to 3.x?&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Selecting_data_using_JDatabase&amp;diff=179057</id>
		<title>Selecting data using JDatabase</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Selecting_data_using_JDatabase&amp;diff=179057"/>
		<updated>2015-05-07T16:42:38Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: /* loadAssocList($key, $column) */&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; Note many examples online use &amp;lt;code&amp;gt;$db-&amp;gt;query()&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;$db-&amp;gt;execute()&amp;lt;/code&amp;gt;. This was the old method in Joomla 1.5 and 2.5 and will throw a deprecated notice in Joomla 3.0+.}}&lt;br /&gt;
&lt;br /&gt;
This tutorial is split into two independent parts:&lt;br /&gt;
* Inserting, updating and removing data from the database.&lt;br /&gt;
* Selecting data from one or more tables and retrieving it in a variety of different forms&lt;br /&gt;
&lt;br /&gt;
This section of the documentation looks at selecting data from a database table and retrieving it in a variety of formats. To see the other part [[Inserting,_Updating_and_Removing_data_using_JDatabase|click here]]&lt;br /&gt;
&lt;br /&gt;
== Introduction==&lt;br /&gt;
Joomla provides a sophisticated database abstraction layer to simplify the usage for third party developers. New versions of the Joomla Platform API provide additional functionality which extends the database layer further, and includes features such as connectors to a greater variety of database servers and the query chaining to improve readability of connection code and simplify SQL coding.&lt;br /&gt;
&lt;br /&gt;
Joomla can use different kinds of SQL database systems and run in a variety of environments with different table-prefixes. In addition to these functions, the class automatically creates the database connection. Besides instantiating the object you need just two lines of code to get a result from the database in a variety of formats. Using the Joomla database layer ensures a maximum of compatibility and flexibility for your extension.&lt;br /&gt;
&lt;br /&gt;
==The Query==&lt;br /&gt;
&lt;br /&gt;
Joomla&#039;s database querying changed with the introduction of Joomla 1.6. The recommended way of building database queries is through &amp;quot;query chaining&amp;quot; (although string queries are still supported).&lt;br /&gt;
&lt;br /&gt;
Query chaining refers to a method of connecting a number of methods, one after the other, with each method returning an object that can support the next method, improving readability and simplifying code.&lt;br /&gt;
&lt;br /&gt;
To obtain a new instance of the JDatabaseQuery class we use the JDatabaseDriver getQuery method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The JDatabaseDriver::getQuery takes an optional argument, $new, which can be true or false (the default being false).&lt;br /&gt;
&lt;br /&gt;
To query our data source we can call a number of JDatabaseQuery methods; these methods encapsulate the data source&#039;s query language (in most cases SQL), hiding query-specific syntax from the developer and increasing the portability of the developer&#039;s source code. &lt;br /&gt;
&lt;br /&gt;
Some of the more frequently used methods include; select, from, join, where and order. There are also methods such as insert, update and delete for modifying records in the data store. By chaining these and other method calls, you can create almost any query against your data store without compromising portability of your code.&lt;br /&gt;
&lt;br /&gt;
==Selecting Records from a Single Table==&lt;br /&gt;
&lt;br /&gt;
Below is an example of creating a database query using the JDatabaseQuery class. Using the select, from, where and order methods, we can create queries which are flexible, easily readable and portable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Get a db connection.&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
&lt;br /&gt;
// Create a new query object.&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
&lt;br /&gt;
// Select all records from the user profile table where key begins with &amp;quot;custom.&amp;quot;.&lt;br /&gt;
// Order it by the ordering field.&lt;br /&gt;
$query-&amp;gt;select($db-&amp;gt;quoteName(array(&#039;user_id&#039;, &#039;profile_key&#039;, &#039;profile_value&#039;, &#039;ordering&#039;)));&lt;br /&gt;
$query-&amp;gt;from($db-&amp;gt;quoteName(&#039;#__user_profiles&#039;));&lt;br /&gt;
$query-&amp;gt;where($db-&amp;gt;quoteName(&#039;profile_key&#039;) . &#039; LIKE &#039;. $db-&amp;gt;quote(&#039;\&#039;custom.%\&#039;&#039;));&lt;br /&gt;
$query-&amp;gt;order(&#039;ordering ASC&#039;);&lt;br /&gt;
&lt;br /&gt;
// Reset the query using our newly populated query object.&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
&lt;br /&gt;
// Load the results as a list of stdClass objects (see later for more options on retrieving data).&lt;br /&gt;
$results = $db-&amp;gt;loadObjectList();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The query can also be chained to simplify further:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;user_id&#039;, &#039;profile_key&#039;, &#039;profile_value&#039;, &#039;ordering&#039;)))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__user_profiles&#039;))&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;profile_key&#039;) . &#039; LIKE &#039;. $db-&amp;gt;quote(&#039;\&#039;custom.%\&#039;&#039;))&lt;br /&gt;
    -&amp;gt;order(&#039;ordering ASC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Chaining can become useful when queries become longer and more complex.&lt;br /&gt;
&lt;br /&gt;
Grouping can be achieved simply too.  The following query would count the number of articles in each category&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select( array(&#039;catid&#039;, &#039;COUNT(*)&#039;) )&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;))&lt;br /&gt;
    -&amp;gt;group($db-&amp;gt;quoteName(&#039;catid&#039;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A limit can be set to a query using &amp;quot;setLimit&amp;quot;. For example in the following query, it would return up to 10 records.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;user_id&#039;, &#039;profile_key&#039;, &#039;profile_value&#039;, &#039;ordering&#039;)))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__user_profiles&#039;))&lt;br /&gt;
    -&amp;gt;setLimit(&#039;10&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Selecting Records from Multiple Tables==&lt;br /&gt;
&lt;br /&gt;
Using the JDatabaseQuery&#039;s [http://api.joomla.org/Joomla-Platform/Database/JDatabaseQuery.html#join join] methods, we can select records from multiple related tables. The generic &amp;quot;join&amp;quot; method takes two arguments; the join &amp;quot;type&amp;quot; (inner, outer, left, right) and the join condition. In the following example you will notice that we can use all of the keywords we would normally use if we were writing a native SQL query, including the AS keyword for aliasing tables and the ON keyword for creating relationships between tables. Also note that the table alias is used in all methods which reference table columns (I.e. select, where, order).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Get a db connection.&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
&lt;br /&gt;
// Create a new query object.&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
&lt;br /&gt;
// Select all articles for users who have a username which starts with &#039;a&#039;.&lt;br /&gt;
// Order it by the created date.&lt;br /&gt;
// Note by putting &#039;a&#039; as a second parameter will generate `#__content` AS `a`&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;a.*&#039;, &#039;b.username&#039;, &#039;b.name&#039;)))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;, &#039;a&#039;))&lt;br /&gt;
    -&amp;gt;join(&#039;INNER&#039;, $db-&amp;gt;quoteName(&#039;#__users&#039;, &#039;b&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.created_by&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;b.username&#039;) . &#039; LIKE \&#039;a%\&#039;&#039;)&lt;br /&gt;
    -&amp;gt;order($db-&amp;gt;quoteName(&#039;a.created&#039;) . &#039; DESC&#039;);&lt;br /&gt;
&lt;br /&gt;
// Reset the query using our newly populated query object.&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
&lt;br /&gt;
// Load the results as a list of stdClass objects (see later for more options on retrieving data).&lt;br /&gt;
$results = $db-&amp;gt;loadObjectList();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The join method above enables us to query both the content and user tables, retrieving articles with their author details. There are also convenience methods for joins:&lt;br /&gt;
* [http://api.joomla.org/cms-3/classes/JDatabaseQuery.html#method_innerJoin innerJoin()]&lt;br /&gt;
* [http://api.joomla.org/cms-3/classes/JDatabaseQuery.html#method_leftJoin leftJoin()]&lt;br /&gt;
* [http://api.joomla.org/cms-3/classes/JDatabaseQuery.html#method_rightJoin rightJoin()] &lt;br /&gt;
* [http://api.joomla.org/cms-3/classes/JDatabaseQuery.html#method_outerJoin outerJoin()]&lt;br /&gt;
&lt;br /&gt;
We can use multiple joins to query across more than two tables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;a.*&#039;, &#039;b.username&#039;, &#039;b.name&#039;, &#039;c.*&#039;, &#039;d.*&#039;)))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;, &#039;a&#039;))&lt;br /&gt;
    -&amp;gt;join(&#039;INNER&#039;, $db-&amp;gt;quoteName(&#039;#__users&#039;, &#039;b&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.created_by&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;join(&#039;LEFT&#039;, $db-&amp;gt;quoteName(&#039;#__user_profiles&#039;, &#039;c&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;c.user_id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;join(&#039;RIGHT&#039;, $db-&amp;gt;quoteName(&#039;#__categories&#039;, &#039;d&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.catid&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;d.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;b.username&#039;) . &#039; LIKE \&#039;a%\&#039;&#039;)&lt;br /&gt;
    -&amp;gt;order($db-&amp;gt;quoteName(&#039;a.created&#039;) . &#039; DESC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice how chaining makes the source code much more readable for these longer queries.&lt;br /&gt;
&lt;br /&gt;
In some cases, you will also need to use the AS clause when selecting items to avoid column name conflicts. In this case, multiple select statements can be chained in conjunction with using the second parameter of $db-&amp;gt;quoteName.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(&#039;a.*&#039;))&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(&#039;b.username&#039;, &#039;username&#039;))&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(&#039;b.name&#039;, &#039;name&#039;))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;, &#039;a&#039;))&lt;br /&gt;
    -&amp;gt;join(&#039;INNER&#039;, $db-&amp;gt;quoteName(&#039;#__users&#039;, &#039;b&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.created_by&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;b.username&#039;) . &#039; LIKE \&#039;a%\&#039;&#039;)&lt;br /&gt;
    -&amp;gt;order($db-&amp;gt;quoteName(&#039;a.created&#039;) . &#039; DESC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A second array can also be used as the second parameter of the select statement to populate the values of the AS clause. Remember to include nulls in the second array to correspond to columns in the first array that you don&#039;t want to use the AS clause for:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;a.*&#039;, &#039;b.username&#039;, &#039;b.name&#039;), array(&#039;&#039;, &#039;username&#039;, &#039;name&#039;))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;, &#039;a&#039;))&lt;br /&gt;
    -&amp;gt;join(&#039;INNER&#039;, $db-&amp;gt;quoteName(&#039;#__users&#039;, &#039;b&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.created_by&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;b.username&#039;) . &#039; LIKE \&#039;a%\&#039;&#039;)&lt;br /&gt;
    -&amp;gt;order($db-&amp;gt;quoteName(&#039;a.created&#039;) . &#039; DESC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Query Results ==&lt;br /&gt;
The database class contains many methods for working with a query&#039;s result set.&lt;br /&gt;
&lt;br /&gt;
=== Single Value Result ===&lt;br /&gt;
==== loadResult() ====&lt;br /&gt;
Use &#039;&#039;&#039;loadResult()&#039;&#039;&#039; when you expect just a single value back from your database query. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- &lt;br /&gt;
| 1 || style=&amp;quot;background:yellow&amp;quot; | John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is often the result of a &#039;count&#039; query to get a number of records:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
$query-&amp;gt;select(&#039;COUNT(*)&#039;);&lt;br /&gt;
$query-&amp;gt;from($db-&amp;gt;quoteName(&#039;#__my_table&#039;));&lt;br /&gt;
$query-&amp;gt;where($db-&amp;gt;quoteName(&#039;name&#039;).&amp;quot; = &amp;quot;.$db-&amp;gt;quote($value));&lt;br /&gt;
&lt;br /&gt;
// Reset the query using our newly populated query object.&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$count = $db-&amp;gt;loadResult();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or where you are just looking for a single field from a single row of the table (or possibly a single field from the first row returned).&lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
$query-&amp;gt;select(&#039;field_name&#039;);&lt;br /&gt;
$query-&amp;gt;from($db-&amp;gt;quoteName(&#039;#__my_table&#039;));&lt;br /&gt;
$query-&amp;gt;where($db-&amp;gt;quoteName(&#039;some_name&#039;).&amp;quot; = &amp;quot;.$db-&amp;gt;quote($some_value));&lt;br /&gt;
&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$result = $db-&amp;gt;loadResult();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Single Row Results ===&lt;br /&gt;
Each of these results functions will return a single record from the database even though there may be several records that meet the criteria that you have set. To get more records you need to call the function again.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 1 || John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== loadRow() ====&lt;br /&gt;
loadRow() returns an indexed array from a single record in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadRow();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; 1 [1] =&amp;gt; John Smith [2] =&amp;gt; johnsmith@domain.example [3] =&amp;gt; johnsmith ) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
# Whilst you can repeat the call to get further rows, one of the functions that returns multiple rows might be more useful.&lt;br /&gt;
&lt;br /&gt;
==== loadAssoc() ====&lt;br /&gt;
loadAssoc() returns an associated array from a single record in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadAssoc();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;name&#039;] // e.g. $row[&#039;name&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# Whilst you can repeat the call to get further rows, one of the functions that returns multiple rows might be more useful.&lt;br /&gt;
&lt;br /&gt;
==== loadObject() ====&lt;br /&gt;
loadObject returns a PHP object from a single record in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$result = $db-&amp;gt;loadObject();&lt;br /&gt;
print_r($result);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;stdClass Object ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$result-&amp;gt;index // e.g. $result-&amp;gt;email&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# Whilst you can repeat the call to get further rows, one of the functions that returns multiple rows might be more useful.&lt;br /&gt;
&lt;br /&gt;
===Single Column Results ===&lt;br /&gt;
Each of these results functions will return a single column from the database. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- &lt;br /&gt;
| 1 || style=&amp;quot;background:yellow&amp;quot; | John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|-&lt;br /&gt;
| 2 || style=&amp;quot;background:yellow&amp;quot; | Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|-&lt;br /&gt;
| 3 || style=&amp;quot;background:yellow&amp;quot; | Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== loadColumn() ====&lt;br /&gt;
loadColumn() returns an indexed array from a single column in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
$query-&amp;gt;select(&#039;name&#039;));&lt;br /&gt;
      -&amp;gt;from . . .&amp;quot;;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$column= $db-&amp;gt;loadColumn();&lt;br /&gt;
print_r($column);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; John Smith [1] =&amp;gt; Magda Hellman [2] =&amp;gt; Yvonne de Gaulle )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$column[&#039;index&#039;] // e.g. $column[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
# loadColumn() is equivalent to loadColumn(0).&lt;br /&gt;
&lt;br /&gt;
==== loadColumn($index) ====&lt;br /&gt;
loadColumn($index) returns an indexed array from a single column in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
$query-&amp;gt;select(array(&#039;name&#039;, &#039;email&#039;, &#039;username&#039;));&lt;br /&gt;
      -&amp;gt;from . . .&amp;quot;;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$column= $db-&amp;gt;loadColumn(1);&lt;br /&gt;
print_r($column);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; johnsmith@domain.example [1] =&amp;gt; magda_h@domain.example [2] =&amp;gt; ydg@domain.example )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$column[&#039;index&#039;] // e.g. $column[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
loadColumn($index) allows you to iterate through a series of columns in the results&lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
for ( $i = 0; $i &amp;lt;= 2; $i++ ) {&lt;br /&gt;
  $column= $db-&amp;gt;loadColumn($i);&lt;br /&gt;
  print_r($column);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; John Smith [1] =&amp;gt; Magda Hellman [2] =&amp;gt; Yvonne de Gaulle )&lt;br /&gt;
Array ( [0] =&amp;gt; johnsmith@domain.example [1] =&amp;gt; magda_h@domain.example [2] =&amp;gt; ydg@domain.example )&lt;br /&gt;
Array ( [0] =&amp;gt; johnsmith [1] =&amp;gt; magdah [2] =&amp;gt; ydegaulle )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
&lt;br /&gt;
=== Multi-Row Results ===&lt;br /&gt;
Each of these results functions will return multiple records from the database. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 1 || John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 2 || Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 3 || Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== loadRowList() ====&lt;br /&gt;
loadRowList() returns an indexed array of indexed arrays from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadRowList();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[0] =&amp;gt; Array ( [0] =&amp;gt; 1 [1] =&amp;gt; John Smith [2] =&amp;gt; johnsmith@domain.example [3] =&amp;gt; johnsmith ) &lt;br /&gt;
[1] =&amp;gt; Array ( [0] =&amp;gt; 2 [1] =&amp;gt; Magda Hellman [2] =&amp;gt; magda_h@domain.example [3] =&amp;gt; magdah ) &lt;br /&gt;
[2] =&amp;gt; Array ( [0] =&amp;gt; 3 [1] =&amp;gt; Yvonne de Gaulle [2] =&amp;gt; ydg@domain.example [3] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;][&#039;index&#039;] // e.g. $row[&#039;2&#039;][&#039;3&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
&lt;br /&gt;
==== loadAssocList() ====&lt;br /&gt;
loadAssocList() returns an indexed array of associated arrays from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadAssocList();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[0] =&amp;gt; Array ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[1] =&amp;gt; Array ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[2] =&amp;gt; Array ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;][&#039;column_name&#039;] // e.g. $row[&#039;2&#039;][&#039;email&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== loadAssocList($key) ====&lt;br /&gt;
loadAssocList(&#039;key&#039;) returns an associated array - indexed on &#039;key&#039; - of associated arrays from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadAssocList(&#039;username&#039;);&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[johnsmith] =&amp;gt; Array ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[magdah] =&amp;gt; Array ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[ydegaulle] =&amp;gt; Array ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;] // e.g. $row[&#039;johnsmith&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;][&#039;column_name&#039;] // e.g. $row[&#039;johnsmith&#039;][&#039;email&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Key must be a valid column name from the table; it does not have to be an Index or a Primary Key. But if it does not have a unique value you may not be able to retrieve results reliably.&lt;br /&gt;
&lt;br /&gt;
==== loadAssocList($key, $column) ====&lt;br /&gt;
loadAssocList(&#039;key&#039;, &#039;column&#039;) returns an associative array, indexed on &#039;key&#039;, of values from the column named &#039;column&#039; returned by the query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadAssocList(&#039;id&#039;, &#039;username&#039;);&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[1] =&amp;gt; John Smith &lt;br /&gt;
[2] =&amp;gt; Magda Hellman &lt;br /&gt;
[3] =&amp;gt; Yvonne de Gaulle&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Key must be a valid column name from the table; it does not have to be an Index or a Primary Key. But if it does not have a unique value you may not be able to retrieve results reliably.&lt;br /&gt;
&lt;br /&gt;
==== loadObjectList() ====&lt;br /&gt;
loadObjectList() returns an indexed array of PHP objects from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadObjectList();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[0] =&amp;gt; stdClass Object ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith &lt;br /&gt;
    [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[1] =&amp;gt; stdClass Object ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman &lt;br /&gt;
    [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[2] =&amp;gt; stdClass Object ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle &lt;br /&gt;
    [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;]-&amp;gt;name // e.g. $row[&#039;2&#039;]-&amp;gt;email&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== loadObjectList(&#039;key&#039;) ====&lt;br /&gt;
loadObjectList($key) returns an associated array - indexed on &#039;key&#039; - of objects from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadObjectList(&#039;username&#039;);&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[johnsmith] =&amp;gt; stdClass Object ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith &lt;br /&gt;
    [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[magdah] =&amp;gt; stdClass Object ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman &lt;br /&gt;
    [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[ydegaulle] =&amp;gt; stdClass Object ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle &lt;br /&gt;
    [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;] // e.g. $row[&#039;johnsmith&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;]-&amp;gt;column_name // e.g. $row[&#039;johnsmith&#039;]-&amp;gt;email&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Key must be a valid column name from the table; it does not have to be an Index or a Primary Key. But if it does not have a unique value you may not be able to retrieve results reliably.&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous Result Set Methods ===&lt;br /&gt;
==== getNumRows() ====&lt;br /&gt;
getNumRows() will return the number of result rows found by the last query and waiting to be read. To get a result from getNumRows() you have to run it &#039;&#039;&#039;after&#039;&#039;&#039; the query and &#039;&#039;&#039;before&#039;&#039;&#039; you have retrieved any results.  &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$db-&amp;gt;execute();&lt;br /&gt;
$num_rows = $db-&amp;gt;getNumRows();&lt;br /&gt;
print_r($num_rows);&lt;br /&gt;
$result = $db-&amp;gt;loadRowList();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will return &amp;lt;pre&amp;gt;3&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note: if you run getNumRows() after loadRowList() - or any other retrieval method - you may get a PHP Warning:&lt;br /&gt;
&amp;lt;pre&amp;gt;Warning: mysql_num_rows(): 80 is not a valid MySQL result resource &lt;br /&gt;
in libraries\joomla\database\database\mysql.php on line 344&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Extension development]]&lt;br /&gt;
[[Category:Database]]&lt;br /&gt;
[[Category:JFactory]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Selecting_data_using_JDatabase&amp;diff=179056</id>
		<title>Selecting data using JDatabase</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Selecting_data_using_JDatabase&amp;diff=179056"/>
		<updated>2015-05-07T16:15:30Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: /* loadAssocList($key, $column) */&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; Note many examples online use &amp;lt;code&amp;gt;$db-&amp;gt;query()&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;$db-&amp;gt;execute()&amp;lt;/code&amp;gt;. This was the old method in Joomla 1.5 and 2.5 and will throw a deprecated notice in Joomla 3.0+.}}&lt;br /&gt;
&lt;br /&gt;
This tutorial is split into two independent parts:&lt;br /&gt;
* Inserting, updating and removing data from the database.&lt;br /&gt;
* Selecting data from one or more tables and retrieving it in a variety of different forms&lt;br /&gt;
&lt;br /&gt;
This section of the documentation looks at selecting data from a database table and retrieving it in a variety of formats. To see the other part [[Inserting,_Updating_and_Removing_data_using_JDatabase|click here]]&lt;br /&gt;
&lt;br /&gt;
== Introduction==&lt;br /&gt;
Joomla provides a sophisticated database abstraction layer to simplify the usage for third party developers. New versions of the Joomla Platform API provide additional functionality which extends the database layer further, and includes features such as connectors to a greater variety of database servers and the query chaining to improve readability of connection code and simplify SQL coding.&lt;br /&gt;
&lt;br /&gt;
Joomla can use different kinds of SQL database systems and run in a variety of environments with different table-prefixes. In addition to these functions, the class automatically creates the database connection. Besides instantiating the object you need just two lines of code to get a result from the database in a variety of formats. Using the Joomla database layer ensures a maximum of compatibility and flexibility for your extension.&lt;br /&gt;
&lt;br /&gt;
==The Query==&lt;br /&gt;
&lt;br /&gt;
Joomla&#039;s database querying changed with the introduction of Joomla 1.6. The recommended way of building database queries is through &amp;quot;query chaining&amp;quot; (although string queries are still supported).&lt;br /&gt;
&lt;br /&gt;
Query chaining refers to a method of connecting a number of methods, one after the other, with each method returning an object that can support the next method, improving readability and simplifying code.&lt;br /&gt;
&lt;br /&gt;
To obtain a new instance of the JDatabaseQuery class we use the JDatabaseDriver getQuery method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The JDatabaseDriver::getQuery takes an optional argument, $new, which can be true or false (the default being false).&lt;br /&gt;
&lt;br /&gt;
To query our data source we can call a number of JDatabaseQuery methods; these methods encapsulate the data source&#039;s query language (in most cases SQL), hiding query-specific syntax from the developer and increasing the portability of the developer&#039;s source code. &lt;br /&gt;
&lt;br /&gt;
Some of the more frequently used methods include; select, from, join, where and order. There are also methods such as insert, update and delete for modifying records in the data store. By chaining these and other method calls, you can create almost any query against your data store without compromising portability of your code.&lt;br /&gt;
&lt;br /&gt;
==Selecting Records from a Single Table==&lt;br /&gt;
&lt;br /&gt;
Below is an example of creating a database query using the JDatabaseQuery class. Using the select, from, where and order methods, we can create queries which are flexible, easily readable and portable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Get a db connection.&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
&lt;br /&gt;
// Create a new query object.&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
&lt;br /&gt;
// Select all records from the user profile table where key begins with &amp;quot;custom.&amp;quot;.&lt;br /&gt;
// Order it by the ordering field.&lt;br /&gt;
$query-&amp;gt;select($db-&amp;gt;quoteName(array(&#039;user_id&#039;, &#039;profile_key&#039;, &#039;profile_value&#039;, &#039;ordering&#039;)));&lt;br /&gt;
$query-&amp;gt;from($db-&amp;gt;quoteName(&#039;#__user_profiles&#039;));&lt;br /&gt;
$query-&amp;gt;where($db-&amp;gt;quoteName(&#039;profile_key&#039;) . &#039; LIKE &#039;. $db-&amp;gt;quote(&#039;\&#039;custom.%\&#039;&#039;));&lt;br /&gt;
$query-&amp;gt;order(&#039;ordering ASC&#039;);&lt;br /&gt;
&lt;br /&gt;
// Reset the query using our newly populated query object.&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
&lt;br /&gt;
// Load the results as a list of stdClass objects (see later for more options on retrieving data).&lt;br /&gt;
$results = $db-&amp;gt;loadObjectList();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The query can also be chained to simplify further:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;user_id&#039;, &#039;profile_key&#039;, &#039;profile_value&#039;, &#039;ordering&#039;)))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__user_profiles&#039;))&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;profile_key&#039;) . &#039; LIKE &#039;. $db-&amp;gt;quote(&#039;\&#039;custom.%\&#039;&#039;))&lt;br /&gt;
    -&amp;gt;order(&#039;ordering ASC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Chaining can become useful when queries become longer and more complex.&lt;br /&gt;
&lt;br /&gt;
Grouping can be achieved simply too.  The following query would count the number of articles in each category&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select( array(&#039;catid&#039;, &#039;COUNT(*)&#039;) )&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;))&lt;br /&gt;
    -&amp;gt;group($db-&amp;gt;quoteName(&#039;catid&#039;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A limit can be set to a query using &amp;quot;setLimit&amp;quot;. For example in the following query, it would return up to 10 records.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;user_id&#039;, &#039;profile_key&#039;, &#039;profile_value&#039;, &#039;ordering&#039;)))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__user_profiles&#039;))&lt;br /&gt;
    -&amp;gt;setLimit(&#039;10&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Selecting Records from Multiple Tables==&lt;br /&gt;
&lt;br /&gt;
Using the JDatabaseQuery&#039;s [http://api.joomla.org/Joomla-Platform/Database/JDatabaseQuery.html#join join] methods, we can select records from multiple related tables. The generic &amp;quot;join&amp;quot; method takes two arguments; the join &amp;quot;type&amp;quot; (inner, outer, left, right) and the join condition. In the following example you will notice that we can use all of the keywords we would normally use if we were writing a native SQL query, including the AS keyword for aliasing tables and the ON keyword for creating relationships between tables. Also note that the table alias is used in all methods which reference table columns (I.e. select, where, order).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Get a db connection.&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
&lt;br /&gt;
// Create a new query object.&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
&lt;br /&gt;
// Select all articles for users who have a username which starts with &#039;a&#039;.&lt;br /&gt;
// Order it by the created date.&lt;br /&gt;
// Note by putting &#039;a&#039; as a second parameter will generate `#__content` AS `a`&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;a.*&#039;, &#039;b.username&#039;, &#039;b.name&#039;)))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;, &#039;a&#039;))&lt;br /&gt;
    -&amp;gt;join(&#039;INNER&#039;, $db-&amp;gt;quoteName(&#039;#__users&#039;, &#039;b&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.created_by&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;b.username&#039;) . &#039; LIKE \&#039;a%\&#039;&#039;)&lt;br /&gt;
    -&amp;gt;order($db-&amp;gt;quoteName(&#039;a.created&#039;) . &#039; DESC&#039;);&lt;br /&gt;
&lt;br /&gt;
// Reset the query using our newly populated query object.&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
&lt;br /&gt;
// Load the results as a list of stdClass objects (see later for more options on retrieving data).&lt;br /&gt;
$results = $db-&amp;gt;loadObjectList();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The join method above enables us to query both the content and user tables, retrieving articles with their author details. There are also convenience methods for joins:&lt;br /&gt;
* [http://api.joomla.org/cms-3/classes/JDatabaseQuery.html#method_innerJoin innerJoin()]&lt;br /&gt;
* [http://api.joomla.org/cms-3/classes/JDatabaseQuery.html#method_leftJoin leftJoin()]&lt;br /&gt;
* [http://api.joomla.org/cms-3/classes/JDatabaseQuery.html#method_rightJoin rightJoin()] &lt;br /&gt;
* [http://api.joomla.org/cms-3/classes/JDatabaseQuery.html#method_outerJoin outerJoin()]&lt;br /&gt;
&lt;br /&gt;
We can use multiple joins to query across more than two tables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;a.*&#039;, &#039;b.username&#039;, &#039;b.name&#039;, &#039;c.*&#039;, &#039;d.*&#039;)))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;, &#039;a&#039;))&lt;br /&gt;
    -&amp;gt;join(&#039;INNER&#039;, $db-&amp;gt;quoteName(&#039;#__users&#039;, &#039;b&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.created_by&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;join(&#039;LEFT&#039;, $db-&amp;gt;quoteName(&#039;#__user_profiles&#039;, &#039;c&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;c.user_id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;join(&#039;RIGHT&#039;, $db-&amp;gt;quoteName(&#039;#__categories&#039;, &#039;d&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.catid&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;d.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;b.username&#039;) . &#039; LIKE \&#039;a%\&#039;&#039;)&lt;br /&gt;
    -&amp;gt;order($db-&amp;gt;quoteName(&#039;a.created&#039;) . &#039; DESC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice how chaining makes the source code much more readable for these longer queries.&lt;br /&gt;
&lt;br /&gt;
In some cases, you will also need to use the AS clause when selecting items to avoid column name conflicts. In this case, multiple select statements can be chained in conjunction with using the second parameter of $db-&amp;gt;quoteName.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(&#039;a.*&#039;))&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(&#039;b.username&#039;, &#039;username&#039;))&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(&#039;b.name&#039;, &#039;name&#039;))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;, &#039;a&#039;))&lt;br /&gt;
    -&amp;gt;join(&#039;INNER&#039;, $db-&amp;gt;quoteName(&#039;#__users&#039;, &#039;b&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.created_by&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;b.username&#039;) . &#039; LIKE \&#039;a%\&#039;&#039;)&lt;br /&gt;
    -&amp;gt;order($db-&amp;gt;quoteName(&#039;a.created&#039;) . &#039; DESC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A second array can also be used as the second parameter of the select statement to populate the values of the AS clause. Remember to include nulls in the second array to correspond to columns in the first array that you don&#039;t want to use the AS clause for:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;a.*&#039;, &#039;b.username&#039;, &#039;b.name&#039;), array(&#039;&#039;, &#039;username&#039;, &#039;name&#039;))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;, &#039;a&#039;))&lt;br /&gt;
    -&amp;gt;join(&#039;INNER&#039;, $db-&amp;gt;quoteName(&#039;#__users&#039;, &#039;b&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.created_by&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;b.username&#039;) . &#039; LIKE \&#039;a%\&#039;&#039;)&lt;br /&gt;
    -&amp;gt;order($db-&amp;gt;quoteName(&#039;a.created&#039;) . &#039; DESC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Query Results ==&lt;br /&gt;
The database class contains many methods for working with a query&#039;s result set.&lt;br /&gt;
&lt;br /&gt;
=== Single Value Result ===&lt;br /&gt;
==== loadResult() ====&lt;br /&gt;
Use &#039;&#039;&#039;loadResult()&#039;&#039;&#039; when you expect just a single value back from your database query. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- &lt;br /&gt;
| 1 || style=&amp;quot;background:yellow&amp;quot; | John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is often the result of a &#039;count&#039; query to get a number of records:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
$query-&amp;gt;select(&#039;COUNT(*)&#039;);&lt;br /&gt;
$query-&amp;gt;from($db-&amp;gt;quoteName(&#039;#__my_table&#039;));&lt;br /&gt;
$query-&amp;gt;where($db-&amp;gt;quoteName(&#039;name&#039;).&amp;quot; = &amp;quot;.$db-&amp;gt;quote($value));&lt;br /&gt;
&lt;br /&gt;
// Reset the query using our newly populated query object.&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$count = $db-&amp;gt;loadResult();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or where you are just looking for a single field from a single row of the table (or possibly a single field from the first row returned).&lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
$query-&amp;gt;select(&#039;field_name&#039;);&lt;br /&gt;
$query-&amp;gt;from($db-&amp;gt;quoteName(&#039;#__my_table&#039;));&lt;br /&gt;
$query-&amp;gt;where($db-&amp;gt;quoteName(&#039;some_name&#039;).&amp;quot; = &amp;quot;.$db-&amp;gt;quote($some_value));&lt;br /&gt;
&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$result = $db-&amp;gt;loadResult();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Single Row Results ===&lt;br /&gt;
Each of these results functions will return a single record from the database even though there may be several records that meet the criteria that you have set. To get more records you need to call the function again.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 1 || John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== loadRow() ====&lt;br /&gt;
loadRow() returns an indexed array from a single record in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadRow();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; 1 [1] =&amp;gt; John Smith [2] =&amp;gt; johnsmith@domain.example [3] =&amp;gt; johnsmith ) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
# Whilst you can repeat the call to get further rows, one of the functions that returns multiple rows might be more useful.&lt;br /&gt;
&lt;br /&gt;
==== loadAssoc() ====&lt;br /&gt;
loadAssoc() returns an associated array from a single record in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadAssoc();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;name&#039;] // e.g. $row[&#039;name&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# Whilst you can repeat the call to get further rows, one of the functions that returns multiple rows might be more useful.&lt;br /&gt;
&lt;br /&gt;
==== loadObject() ====&lt;br /&gt;
loadObject returns a PHP object from a single record in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$result = $db-&amp;gt;loadObject();&lt;br /&gt;
print_r($result);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;stdClass Object ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$result-&amp;gt;index // e.g. $result-&amp;gt;email&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# Whilst you can repeat the call to get further rows, one of the functions that returns multiple rows might be more useful.&lt;br /&gt;
&lt;br /&gt;
===Single Column Results ===&lt;br /&gt;
Each of these results functions will return a single column from the database. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- &lt;br /&gt;
| 1 || style=&amp;quot;background:yellow&amp;quot; | John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|-&lt;br /&gt;
| 2 || style=&amp;quot;background:yellow&amp;quot; | Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|-&lt;br /&gt;
| 3 || style=&amp;quot;background:yellow&amp;quot; | Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== loadColumn() ====&lt;br /&gt;
loadColumn() returns an indexed array from a single column in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
$query-&amp;gt;select(&#039;name&#039;));&lt;br /&gt;
      -&amp;gt;from . . .&amp;quot;;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$column= $db-&amp;gt;loadColumn();&lt;br /&gt;
print_r($column);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; John Smith [1] =&amp;gt; Magda Hellman [2] =&amp;gt; Yvonne de Gaulle )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$column[&#039;index&#039;] // e.g. $column[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
# loadColumn() is equivalent to loadColumn(0).&lt;br /&gt;
&lt;br /&gt;
==== loadColumn($index) ====&lt;br /&gt;
loadColumn($index) returns an indexed array from a single column in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
$query-&amp;gt;select(array(&#039;name&#039;, &#039;email&#039;, &#039;username&#039;));&lt;br /&gt;
      -&amp;gt;from . . .&amp;quot;;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$column= $db-&amp;gt;loadColumn(1);&lt;br /&gt;
print_r($column);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; johnsmith@domain.example [1] =&amp;gt; magda_h@domain.example [2] =&amp;gt; ydg@domain.example )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$column[&#039;index&#039;] // e.g. $column[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
loadColumn($index) allows you to iterate through a series of columns in the results&lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
for ( $i = 0; $i &amp;lt;= 2; $i++ ) {&lt;br /&gt;
  $column= $db-&amp;gt;loadColumn($i);&lt;br /&gt;
  print_r($column);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; John Smith [1] =&amp;gt; Magda Hellman [2] =&amp;gt; Yvonne de Gaulle )&lt;br /&gt;
Array ( [0] =&amp;gt; johnsmith@domain.example [1] =&amp;gt; magda_h@domain.example [2] =&amp;gt; ydg@domain.example )&lt;br /&gt;
Array ( [0] =&amp;gt; johnsmith [1] =&amp;gt; magdah [2] =&amp;gt; ydegaulle )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
&lt;br /&gt;
=== Multi-Row Results ===&lt;br /&gt;
Each of these results functions will return multiple records from the database. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 1 || John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 2 || Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 3 || Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== loadRowList() ====&lt;br /&gt;
loadRowList() returns an indexed array of indexed arrays from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadRowList();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[0] =&amp;gt; Array ( [0] =&amp;gt; 1 [1] =&amp;gt; John Smith [2] =&amp;gt; johnsmith@domain.example [3] =&amp;gt; johnsmith ) &lt;br /&gt;
[1] =&amp;gt; Array ( [0] =&amp;gt; 2 [1] =&amp;gt; Magda Hellman [2] =&amp;gt; magda_h@domain.example [3] =&amp;gt; magdah ) &lt;br /&gt;
[2] =&amp;gt; Array ( [0] =&amp;gt; 3 [1] =&amp;gt; Yvonne de Gaulle [2] =&amp;gt; ydg@domain.example [3] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;][&#039;index&#039;] // e.g. $row[&#039;2&#039;][&#039;3&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
&lt;br /&gt;
==== loadAssocList() ====&lt;br /&gt;
loadAssocList() returns an indexed array of associated arrays from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadAssocList();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[0] =&amp;gt; Array ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[1] =&amp;gt; Array ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[2] =&amp;gt; Array ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;][&#039;column_name&#039;] // e.g. $row[&#039;2&#039;][&#039;email&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== loadAssocList($key) ====&lt;br /&gt;
loadAssocList(&#039;key&#039;) returns an associated array - indexed on &#039;key&#039; - of associated arrays from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadAssocList(&#039;username&#039;);&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[johnsmith] =&amp;gt; Array ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[magdah] =&amp;gt; Array ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[ydegaulle] =&amp;gt; Array ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;] // e.g. $row[&#039;johnsmith&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;][&#039;column_name&#039;] // e.g. $row[&#039;johnsmith&#039;][&#039;email&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Key must be a valid column name from the table; it does not have to be an Index or a Primary Key. But if it does not have a unique value you may not be able to retrieve results reliably.&lt;br /&gt;
&lt;br /&gt;
==== loadAssocList($key, $column) ====&lt;br /&gt;
loadAssocList(&#039;key&#039;, &#039;column&#039;) returns an associative array, indexed on &#039;key&#039;, of values from the column named &#039;column&#039; returned by the query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadAssocList(&#039;id&#039;, &#039;username);&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[1] =&amp;gt; John Smith &lt;br /&gt;
[2] =&amp;gt; Magda Hellman &lt;br /&gt;
[3] =&amp;gt; Yvonne de Gaulle&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Key must be a valid column name from the table; it does not have to be an Index or a Primary Key. But if it does not have a unique value you may not be able to retrieve results reliably.&lt;br /&gt;
&lt;br /&gt;
==== loadObjectList() ====&lt;br /&gt;
loadObjectList() returns an indexed array of PHP objects from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadObjectList();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[0] =&amp;gt; stdClass Object ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith &lt;br /&gt;
    [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[1] =&amp;gt; stdClass Object ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman &lt;br /&gt;
    [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[2] =&amp;gt; stdClass Object ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle &lt;br /&gt;
    [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;]-&amp;gt;name // e.g. $row[&#039;2&#039;]-&amp;gt;email&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== loadObjectList(&#039;key&#039;) ====&lt;br /&gt;
loadObjectList($key) returns an associated array - indexed on &#039;key&#039; - of objects from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadObjectList(&#039;username&#039;);&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[johnsmith] =&amp;gt; stdClass Object ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith &lt;br /&gt;
    [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[magdah] =&amp;gt; stdClass Object ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman &lt;br /&gt;
    [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[ydegaulle] =&amp;gt; stdClass Object ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle &lt;br /&gt;
    [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;] // e.g. $row[&#039;johnsmith&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;]-&amp;gt;column_name // e.g. $row[&#039;johnsmith&#039;]-&amp;gt;email&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Key must be a valid column name from the table; it does not have to be an Index or a Primary Key. But if it does not have a unique value you may not be able to retrieve results reliably.&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous Result Set Methods ===&lt;br /&gt;
==== getNumRows() ====&lt;br /&gt;
getNumRows() will return the number of result rows found by the last query and waiting to be read. To get a result from getNumRows() you have to run it &#039;&#039;&#039;after&#039;&#039;&#039; the query and &#039;&#039;&#039;before&#039;&#039;&#039; you have retrieved any results.  &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$db-&amp;gt;execute();&lt;br /&gt;
$num_rows = $db-&amp;gt;getNumRows();&lt;br /&gt;
print_r($num_rows);&lt;br /&gt;
$result = $db-&amp;gt;loadRowList();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will return &amp;lt;pre&amp;gt;3&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note: if you run getNumRows() after loadRowList() - or any other retrieval method - you may get a PHP Warning:&lt;br /&gt;
&amp;lt;pre&amp;gt;Warning: mysql_num_rows(): 80 is not a valid MySQL result resource &lt;br /&gt;
in libraries\joomla\database\database\mysql.php on line 344&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Extension development]]&lt;br /&gt;
[[Category:Database]]&lt;br /&gt;
[[Category:JFactory]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Selecting_data_using_JDatabase&amp;diff=179010</id>
		<title>Selecting data using JDatabase</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Selecting_data_using_JDatabase&amp;diff=179010"/>
		<updated>2015-05-07T14:59:01Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: /* Query Results */&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; Note many examples online use &amp;lt;code&amp;gt;$db-&amp;gt;query()&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;$db-&amp;gt;execute()&amp;lt;/code&amp;gt;. This was the old method in Joomla 1.5 and 2.5 and will throw a deprecated notice in Joomla 3.0+.}}&lt;br /&gt;
&lt;br /&gt;
This tutorial is split into two independent parts:&lt;br /&gt;
* Inserting, updating and removing data from the database.&lt;br /&gt;
* Selecting data from one or more tables and retrieving it in a variety of different forms&lt;br /&gt;
&lt;br /&gt;
This section of the documentation looks at selecting data from a database table and retrieving it in a variety of formats. To see the other part [[Inserting,_Updating_and_Removing_data_using_JDatabase|click here]]&lt;br /&gt;
&lt;br /&gt;
== Introduction==&lt;br /&gt;
Joomla provides a sophisticated database abstraction layer to simplify the usage for third party developers. New versions of the Joomla Platform API provide additional functionality which extends the database layer further, and includes features such as connectors to a greater variety of database servers and the query chaining to improve readability of connection code and simplify SQL coding.&lt;br /&gt;
&lt;br /&gt;
Joomla can use different kinds of SQL database systems and run in a variety of environments with different table-prefixes. In addition to these functions, the class automatically creates the database connection. Besides instantiating the object you need just two lines of code to get a result from the database in a variety of formats. Using the Joomla database layer ensures a maximum of compatibility and flexibility for your extension.&lt;br /&gt;
&lt;br /&gt;
==The Query==&lt;br /&gt;
&lt;br /&gt;
Joomla&#039;s database querying changed with the introduction of Joomla 1.6. The recommended way of building database queries is through &amp;quot;query chaining&amp;quot; (although string queries are still supported).&lt;br /&gt;
&lt;br /&gt;
Query chaining refers to a method of connecting a number of methods, one after the other, with each method returning an object that can support the next method, improving readability and simplifying code.&lt;br /&gt;
&lt;br /&gt;
To obtain a new instance of the JDatabaseQuery class we use the JDatabaseDriver getQuery method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The JDatabaseDriver::getQuery takes an optional argument, $new, which can be true or false (the default being false).&lt;br /&gt;
&lt;br /&gt;
To query our data source we can call a number of JDatabaseQuery methods; these methods encapsulate the data source&#039;s query language (in most cases SQL), hiding query-specific syntax from the developer and increasing the portability of the developer&#039;s source code. &lt;br /&gt;
&lt;br /&gt;
Some of the more frequently used methods include; select, from, join, where and order. There are also methods such as insert, update and delete for modifying records in the data store. By chaining these and other method calls, you can create almost any query against your data store without compromising portability of your code.&lt;br /&gt;
&lt;br /&gt;
==Selecting Records from a Single Table==&lt;br /&gt;
&lt;br /&gt;
Below is an example of creating a database query using the JDatabaseQuery class. Using the select, from, where and order methods, we can create queries which are flexible, easily readable and portable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Get a db connection.&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
&lt;br /&gt;
// Create a new query object.&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
&lt;br /&gt;
// Select all records from the user profile table where key begins with &amp;quot;custom.&amp;quot;.&lt;br /&gt;
// Order it by the ordering field.&lt;br /&gt;
$query-&amp;gt;select($db-&amp;gt;quoteName(array(&#039;user_id&#039;, &#039;profile_key&#039;, &#039;profile_value&#039;, &#039;ordering&#039;)));&lt;br /&gt;
$query-&amp;gt;from($db-&amp;gt;quoteName(&#039;#__user_profiles&#039;));&lt;br /&gt;
$query-&amp;gt;where($db-&amp;gt;quoteName(&#039;profile_key&#039;) . &#039; LIKE &#039;. $db-&amp;gt;quote(&#039;\&#039;custom.%\&#039;&#039;));&lt;br /&gt;
$query-&amp;gt;order(&#039;ordering ASC&#039;);&lt;br /&gt;
&lt;br /&gt;
// Reset the query using our newly populated query object.&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
&lt;br /&gt;
// Load the results as a list of stdClass objects (see later for more options on retrieving data).&lt;br /&gt;
$results = $db-&amp;gt;loadObjectList();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The query can also be chained to simplify further:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;user_id&#039;, &#039;profile_key&#039;, &#039;profile_value&#039;, &#039;ordering&#039;)))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__user_profiles&#039;))&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;profile_key&#039;) . &#039; LIKE &#039;. $db-&amp;gt;quote(&#039;\&#039;custom.%\&#039;&#039;))&lt;br /&gt;
    -&amp;gt;order(&#039;ordering ASC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Chaining can become useful when queries become longer and more complex.&lt;br /&gt;
&lt;br /&gt;
Grouping can be achieved simply too.  The following query would count the number of articles in each category&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select( array(&#039;catid&#039;, &#039;COUNT(*)&#039;) )&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;))&lt;br /&gt;
    -&amp;gt;group($db-&amp;gt;quoteName(&#039;catid&#039;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A limit can be set to a query using &amp;quot;setLimit&amp;quot;. For example in the following query, it would return up to 10 records.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;user_id&#039;, &#039;profile_key&#039;, &#039;profile_value&#039;, &#039;ordering&#039;)))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__user_profiles&#039;))&lt;br /&gt;
    -&amp;gt;setLimit(&#039;10&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Selecting Records from Multiple Tables==&lt;br /&gt;
&lt;br /&gt;
Using the JDatabaseQuery&#039;s [http://api.joomla.org/Joomla-Platform/Database/JDatabaseQuery.html#join join] methods, we can select records from multiple related tables. The generic &amp;quot;join&amp;quot; method takes two arguments; the join &amp;quot;type&amp;quot; (inner, outer, left, right) and the join condition. In the following example you will notice that we can use all of the keywords we would normally use if we were writing a native SQL query, including the AS keyword for aliasing tables and the ON keyword for creating relationships between tables. Also note that the table alias is used in all methods which reference table columns (I.e. select, where, order).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Get a db connection.&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
&lt;br /&gt;
// Create a new query object.&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
&lt;br /&gt;
// Select all articles for users who have a username which starts with &#039;a&#039;.&lt;br /&gt;
// Order it by the created date.&lt;br /&gt;
// Note by putting &#039;a&#039; as a second parameter will generate `#__content` AS `a`&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;a.*&#039;, &#039;b.username&#039;, &#039;b.name&#039;)))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;, &#039;a&#039;))&lt;br /&gt;
    -&amp;gt;join(&#039;INNER&#039;, $db-&amp;gt;quoteName(&#039;#__users&#039;, &#039;b&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.created_by&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;b.username&#039;) . &#039; LIKE \&#039;a%\&#039;&#039;)&lt;br /&gt;
    -&amp;gt;order($db-&amp;gt;quoteName(&#039;a.created&#039;) . &#039; DESC&#039;);&lt;br /&gt;
&lt;br /&gt;
// Reset the query using our newly populated query object.&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
&lt;br /&gt;
// Load the results as a list of stdClass objects (see later for more options on retrieving data).&lt;br /&gt;
$results = $db-&amp;gt;loadObjectList();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The join method above enables us to query both the content and user tables, retrieving articles with their author details. There are also convenience methods for joins:&lt;br /&gt;
* [http://api.joomla.org/cms-3/classes/JDatabaseQuery.html#method_innerJoin innerJoin()]&lt;br /&gt;
* [http://api.joomla.org/cms-3/classes/JDatabaseQuery.html#method_leftJoin leftJoin()]&lt;br /&gt;
* [http://api.joomla.org/cms-3/classes/JDatabaseQuery.html#method_rightJoin rightJoin()] &lt;br /&gt;
* [http://api.joomla.org/cms-3/classes/JDatabaseQuery.html#method_outerJoin outerJoin()]&lt;br /&gt;
&lt;br /&gt;
We can use multiple joins to query across more than two tables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;a.*&#039;, &#039;b.username&#039;, &#039;b.name&#039;, &#039;c.*&#039;, &#039;d.*&#039;)))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;, &#039;a&#039;))&lt;br /&gt;
    -&amp;gt;join(&#039;INNER&#039;, $db-&amp;gt;quoteName(&#039;#__users&#039;, &#039;b&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.created_by&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;join(&#039;LEFT&#039;, $db-&amp;gt;quoteName(&#039;#__user_profiles&#039;, &#039;c&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;c.user_id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;join(&#039;RIGHT&#039;, $db-&amp;gt;quoteName(&#039;#__categories&#039;, &#039;d&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.catid&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;d.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;b.username&#039;) . &#039; LIKE \&#039;a%\&#039;&#039;)&lt;br /&gt;
    -&amp;gt;order($db-&amp;gt;quoteName(&#039;a.created&#039;) . &#039; DESC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice how chaining makes the source code much more readable for these longer queries.&lt;br /&gt;
&lt;br /&gt;
In some cases, you will also need to use the AS clause when selecting items to avoid column name conflicts. In this case, multiple select statements can be chained in conjunction with using the second parameter of $db-&amp;gt;quoteName.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(&#039;a.*&#039;))&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(&#039;b.username&#039;, &#039;username&#039;))&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(&#039;b.name&#039;, &#039;name&#039;))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;, &#039;a&#039;))&lt;br /&gt;
    -&amp;gt;join(&#039;INNER&#039;, $db-&amp;gt;quoteName(&#039;#__users&#039;, &#039;b&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.created_by&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;b.username&#039;) . &#039; LIKE \&#039;a%\&#039;&#039;)&lt;br /&gt;
    -&amp;gt;order($db-&amp;gt;quoteName(&#039;a.created&#039;) . &#039; DESC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A second array can also be used as the second parameter of the select statement to populate the values of the AS clause. Remember to include nulls in the second array to correspond to columns in the first array that you don&#039;t want to use the AS clause for:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;a.*&#039;, &#039;b.username&#039;, &#039;b.name&#039;), array(&#039;&#039;, &#039;username&#039;, &#039;name&#039;))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;, &#039;a&#039;))&lt;br /&gt;
    -&amp;gt;join(&#039;INNER&#039;, $db-&amp;gt;quoteName(&#039;#__users&#039;, &#039;b&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.created_by&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;b.username&#039;) . &#039; LIKE \&#039;a%\&#039;&#039;)&lt;br /&gt;
    -&amp;gt;order($db-&amp;gt;quoteName(&#039;a.created&#039;) . &#039; DESC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Query Results ==&lt;br /&gt;
The database class contains many methods for working with a query&#039;s result set.&lt;br /&gt;
&lt;br /&gt;
=== Single Value Result ===&lt;br /&gt;
==== loadResult() ====&lt;br /&gt;
Use &#039;&#039;&#039;loadResult()&#039;&#039;&#039; when you expect just a single value back from your database query. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- &lt;br /&gt;
| 1 || style=&amp;quot;background:yellow&amp;quot; | John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is often the result of a &#039;count&#039; query to get a number of records:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
$query-&amp;gt;select(&#039;COUNT(*)&#039;);&lt;br /&gt;
$query-&amp;gt;from($db-&amp;gt;quoteName(&#039;#__my_table&#039;));&lt;br /&gt;
$query-&amp;gt;where($db-&amp;gt;quoteName(&#039;name&#039;).&amp;quot; = &amp;quot;.$db-&amp;gt;quote($value));&lt;br /&gt;
&lt;br /&gt;
// Reset the query using our newly populated query object.&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$count = $db-&amp;gt;loadResult();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or where you are just looking for a single field from a single row of the table (or possibly a single field from the first row returned).&lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
$query-&amp;gt;select(&#039;field_name&#039;);&lt;br /&gt;
$query-&amp;gt;from($db-&amp;gt;quoteName(&#039;#__my_table&#039;));&lt;br /&gt;
$query-&amp;gt;where($db-&amp;gt;quoteName(&#039;some_name&#039;).&amp;quot; = &amp;quot;.$db-&amp;gt;quote($some_value));&lt;br /&gt;
&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$result = $db-&amp;gt;loadResult();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Single Row Results ===&lt;br /&gt;
Each of these results functions will return a single record from the database even though there may be several records that meet the criteria that you have set. To get more records you need to call the function again.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 1 || John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== loadRow() ====&lt;br /&gt;
loadRow() returns an indexed array from a single record in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadRow();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; 1 [1] =&amp;gt; John Smith [2] =&amp;gt; johnsmith@domain.example [3] =&amp;gt; johnsmith ) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
# Whilst you can repeat the call to get further rows, one of the functions that returns multiple rows might be more useful.&lt;br /&gt;
&lt;br /&gt;
==== loadAssoc() ====&lt;br /&gt;
loadAssoc() returns an associated array from a single record in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadAssoc();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;name&#039;] // e.g. $row[&#039;name&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# Whilst you can repeat the call to get further rows, one of the functions that returns multiple rows might be more useful.&lt;br /&gt;
&lt;br /&gt;
==== loadObject() ====&lt;br /&gt;
loadObject returns a PHP object from a single record in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$result = $db-&amp;gt;loadObject();&lt;br /&gt;
print_r($result);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;stdClass Object ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$result-&amp;gt;index // e.g. $result-&amp;gt;email&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# Whilst you can repeat the call to get further rows, one of the functions that returns multiple rows might be more useful.&lt;br /&gt;
&lt;br /&gt;
===Single Column Results ===&lt;br /&gt;
Each of these results functions will return a single column from the database. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- &lt;br /&gt;
| 1 || style=&amp;quot;background:yellow&amp;quot; | John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|-&lt;br /&gt;
| 2 || style=&amp;quot;background:yellow&amp;quot; | Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|-&lt;br /&gt;
| 3 || style=&amp;quot;background:yellow&amp;quot; | Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== loadColumn() ====&lt;br /&gt;
loadColumn() returns an indexed array from a single column in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
$query-&amp;gt;select(&#039;name&#039;));&lt;br /&gt;
      -&amp;gt;from . . .&amp;quot;;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$column= $db-&amp;gt;loadColumn();&lt;br /&gt;
print_r($column);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; John Smith [1] =&amp;gt; Magda Hellman [2] =&amp;gt; Yvonne de Gaulle )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$column[&#039;index&#039;] // e.g. $column[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
# loadColumn() is equivalent to loadColumn(0).&lt;br /&gt;
&lt;br /&gt;
==== loadColumn($index) ====&lt;br /&gt;
loadColumn($index) returns an indexed array from a single column in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
$query-&amp;gt;select(array(&#039;name&#039;, &#039;email&#039;, &#039;username&#039;));&lt;br /&gt;
      -&amp;gt;from . . .&amp;quot;;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$column= $db-&amp;gt;loadColumn(1);&lt;br /&gt;
print_r($column);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; johnsmith@domain.example [1] =&amp;gt; magda_h@domain.example [2] =&amp;gt; ydg@domain.example )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$column[&#039;index&#039;] // e.g. $column[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
loadColumn($index) allows you to iterate through a series of columns in the results&lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
for ( $i = 0; $i &amp;lt;= 2; $i++ ) {&lt;br /&gt;
  $column= $db-&amp;gt;loadColumn($i);&lt;br /&gt;
  print_r($column);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; John Smith [1] =&amp;gt; Magda Hellman [2] =&amp;gt; Yvonne de Gaulle )&lt;br /&gt;
Array ( [0] =&amp;gt; johnsmith@domain.example [1] =&amp;gt; magda_h@domain.example [2] =&amp;gt; ydg@domain.example )&lt;br /&gt;
Array ( [0] =&amp;gt; johnsmith [1] =&amp;gt; magdah [2] =&amp;gt; ydegaulle )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
&lt;br /&gt;
=== Multi-Row Results ===&lt;br /&gt;
Each of these results functions will return multiple records from the database. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 1 || John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 2 || Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 3 || Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== loadRowList() ====&lt;br /&gt;
loadRowList() returns an indexed array of indexed arrays from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadRowList();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[0] =&amp;gt; Array ( [0] =&amp;gt; 1 [1] =&amp;gt; John Smith [2] =&amp;gt; johnsmith@domain.example [3] =&amp;gt; johnsmith ) &lt;br /&gt;
[1] =&amp;gt; Array ( [0] =&amp;gt; 2 [1] =&amp;gt; Magda Hellman [2] =&amp;gt; magda_h@domain.example [3] =&amp;gt; magdah ) &lt;br /&gt;
[2] =&amp;gt; Array ( [0] =&amp;gt; 3 [1] =&amp;gt; Yvonne de Gaulle [2] =&amp;gt; ydg@domain.example [3] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;][&#039;index&#039;] // e.g. $row[&#039;2&#039;][&#039;3&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
&lt;br /&gt;
==== loadAssocList() ====&lt;br /&gt;
loadAssocList() returns an indexed array of associated arrays from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadAssocList();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[0] =&amp;gt; Array ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[1] =&amp;gt; Array ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[2] =&amp;gt; Array ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;][&#039;column_name&#039;] // e.g. $row[&#039;2&#039;][&#039;email&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== loadAssocList($key) ====&lt;br /&gt;
loadAssocList(&#039;key&#039;) returns an associated array - indexed on &#039;key&#039; - of associated arrays from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadAssocList(&#039;username&#039;);&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[johnsmith] =&amp;gt; Array ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[magdah] =&amp;gt; Array ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[ydegaulle] =&amp;gt; Array ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;] // e.g. $row[&#039;johnsmith&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;][&#039;column_name&#039;] // e.g. $row[&#039;johnsmith&#039;][&#039;email&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Key must be a valid column name from the table; it does not have to be an Index or a Primary Key. But if it does not have a unique value you may not be able to retrieve results reliably.&lt;br /&gt;
&lt;br /&gt;
==== loadAssocList($key, $column) ====&lt;br /&gt;
loadAssocList(&#039;key&#039;, &#039;column&#039;) returns an associative array, indexed on &#039;key&#039;, of values from the &#039;column&#039; returned by the query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadAssocList(&#039;id&#039;, &#039;username);&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[1] =&amp;gt; John Smith &lt;br /&gt;
[2] =&amp;gt; Magda Hellman &lt;br /&gt;
[3] =&amp;gt; Yvonne de Gaulle&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Key must be a valid column name from the table; it does not have to be an Index or a Primary Key. But if it does not have a unique value you may not be able to retrieve results reliably.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== loadObjectList() ====&lt;br /&gt;
loadObjectList() returns an indexed array of PHP objects from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadObjectList();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[0] =&amp;gt; stdClass Object ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith &lt;br /&gt;
    [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[1] =&amp;gt; stdClass Object ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman &lt;br /&gt;
    [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[2] =&amp;gt; stdClass Object ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle &lt;br /&gt;
    [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;]-&amp;gt;name // e.g. $row[&#039;2&#039;]-&amp;gt;email&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== loadObjectList(&#039;key&#039;) ====&lt;br /&gt;
loadObjectList($key) returns an associated array - indexed on &#039;key&#039; - of objects from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadObjectList(&#039;username&#039;);&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[johnsmith] =&amp;gt; stdClass Object ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith &lt;br /&gt;
    [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[magdah] =&amp;gt; stdClass Object ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman &lt;br /&gt;
    [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[ydegaulle] =&amp;gt; stdClass Object ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle &lt;br /&gt;
    [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;] // e.g. $row[&#039;johnsmith&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;]-&amp;gt;column_name // e.g. $row[&#039;johnsmith&#039;]-&amp;gt;email&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Key must be a valid column name from the table; it does not have to be an Index or a Primary Key. But if it does not have a unique value you may not be able to retrieve results reliably.&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous Result Set Methods ===&lt;br /&gt;
==== getNumRows() ====&lt;br /&gt;
getNumRows() will return the number of result rows found by the last query and waiting to be read. To get a result from getNumRows() you have to run it &#039;&#039;&#039;after&#039;&#039;&#039; the query and &#039;&#039;&#039;before&#039;&#039;&#039; you have retrieved any results.  &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$db-&amp;gt;execute();&lt;br /&gt;
$num_rows = $db-&amp;gt;getNumRows();&lt;br /&gt;
print_r($num_rows);&lt;br /&gt;
$result = $db-&amp;gt;loadRowList();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will return &amp;lt;pre&amp;gt;3&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note: if you run getNumRows() after loadRowList() - or any other retrieval method - you may get a PHP Warning:&lt;br /&gt;
&amp;lt;pre&amp;gt;Warning: mysql_num_rows(): 80 is not a valid MySQL result resource &lt;br /&gt;
in libraries\joomla\database\database\mysql.php on line 344&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Extension development]]&lt;br /&gt;
[[Category:Database]]&lt;br /&gt;
[[Category:JFactory]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Migrating_a_Template_from_Joomla_1.5_to_3.x&amp;diff=152595</id>
		<title>Migrating a Template from Joomla 1.5 to 3.x</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Migrating_a_Template_from_Joomla_1.5_to_3.x&amp;diff=152595"/>
		<updated>2015-01-12T11:58:15Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: /* Bootstrap Styling and Joomla 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When considering a manual update to your 1.5 template there are a few considerations you need to think about. &lt;br /&gt;
&lt;br /&gt;
First, what skills do you need? To make template changes, minimally you need to be familiar with the basics of PHP, HTML, XML, CSS and possibly some Javascript. If you don’t have a basic grasp of these skills a lot of what you’ll be looking at will look foreign so either brush up on those skills or hire a professional.  &lt;br /&gt;
&lt;br /&gt;
Second, the extent that your template needs to change must be measured in terms of the new enhancements or design changes that have developed in planning your migration. Is the change going to take advantage of new Bootstrap framework styling that is available in Joomla 3? Or is it a strict move that mirrors the current site. While some of the changes that are new to Joomla 3 are mandatory ( meaning your template will not load ) others are enhancements and your template will load but might not look the way you want it to. &lt;br /&gt;
&lt;br /&gt;
For purposes of this document we will be assuming the simplest example and suggest a mirror image of the current 1.5 template. For more complex templates or for major enhancements you may need to do some research or hire someone who has more experience with templates. &lt;br /&gt;
&lt;br /&gt;
== Review the Basics of Templates ==&lt;br /&gt;
&lt;br /&gt;
Some things haven&#039;t changed. You still need to be familiar with the basics of a JoomlaTemplate: The folder directory structure is one of those things. Minimally at the root level you need 2 files: “index.php” and &amp;quot;templateDetails.xml&amp;quot; ( notice the case! ). Most templates include at least 2 folders: an images folder to hold all the graphics that your template uses and a folder for your css styling. More advanced templates might contain folders with names like these for example: “html” for component and module customization,  a “language” folder for custom language overrides, “javascript” to hold custom javascript routines.&lt;br /&gt;
&lt;br /&gt;
Just be sure if the folder is listed in the XML file it exists in the template you upload to Joomla. If you declare a file in the xml then it must exist or your template will not load.&lt;br /&gt;
&lt;br /&gt;
One example of an improvement in versions greater than 1.5, is the dropping of the requirement that all the subfolder filenames be listed. For templates in Joomla 3, you simply list the folder name.&lt;br /&gt;
&lt;br /&gt;
For more information on the basics of a template see this link: [[Creating a basic Joomla! template&lt;br /&gt;
&lt;br /&gt;
=== XML File Changes ===&lt;br /&gt;
What needs to change in the templateDetails.xml file ( Template Manifest File )&lt;br /&gt;
&lt;br /&gt;
The template manifest file provides the information Joomla needs to install your template. The XML manifest file has been almost completely modified since 1.5 so make sure you study up and are familiar with the basics and the modifications. Your template will not load if this file is not exactly right.&lt;br /&gt;
&lt;br /&gt;
==== Document Reference Type Tag &amp;amp; the Install/Extension Tag ==== &lt;br /&gt;
The XML Install tag is now an “extension” tag. Additionally, any reference in the DOCTYPE Tag  or version numbers now needs to refer to 3.0.&lt;br /&gt;
&lt;br /&gt;
The old lines are something like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE install PUBLIC &amp;quot;-//Joomla! 1.5//DTD template 1.0//EN&amp;quot; &amp;quot;http://dev.joomla.org/xml/1.5/template-install.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;install version=&amp;quot;1.5&amp;quot; type=&amp;quot;template&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This now needs to look like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE install PUBLIC &amp;quot;-//Joomla! 2.5//DTD template 1.0//EN&amp;quot; &amp;quot;http://www.joomla.org/xml/dtd/2.5/template-install.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;extension version=&amp;quot;3.1&amp;quot; type=&amp;quot;template&amp;quot; client=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Folder and File tags ====&lt;br /&gt;
This rule has always been true and still is: If you list the Filename or Folder in the XML it must exist in the uploaded template. This has not changed in Joomla 3. What did change is the 1.5 requirement that all the filenames in a folder be listed. Now you can refer to just the folder name. For example, previously in 1.5 your xml filenames were listed individually as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;images&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;images/arrow.png&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;images/arrow2.png&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;images/arrow3.png&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;images/author.gif&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/images&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a Joomla 3 template this statement suffices:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;folder&amp;gt;images&amp;lt;/folder&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Module Tags ====&lt;br /&gt;
For 1.5, module positions were defined in the template. This has not changed. They still need to be listed.&lt;br /&gt;
&lt;br /&gt;
==== Parameters ====&lt;br /&gt;
Parameters are an optional feature of templates that allow the template author to offer options for styling of the template in the Joomla Administrator. In Joomla 1.5 templates the parameters were listed in a &amp;quot;parameters.ini&amp;quot; file at the root level. This file has been eliminated and the parameters are now tags in the XML file.&lt;br /&gt;
&lt;br /&gt;
Here is an example of the contents of a parameters.ini file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
colorVariation=blue&lt;br /&gt;
backgroundVariation=blue&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To define the parameters in Joomla 3 you must add these lines to the XML file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;config&amp;gt;&lt;br /&gt;
		&amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
		     &amp;lt;fieldset name=&amp;quot;advanced&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;field name=&amp;quot;colorVariation&amp;quot; class=&amp;quot;&amp;quot; type=&amp;quot;color&amp;quot; default=&amp;quot;#08C&amp;quot;&lt;br /&gt;
					label=&amp;quot;TPL PROTOSTAR COLOR LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;TPL PROTOSTAR COLOR DESC&amp;quot; /&amp;gt;&lt;br /&gt;
				&amp;lt;field name=&amp;quot;backgroundVariation&amp;quot; class=&amp;quot;&amp;quot; type=&amp;quot;color&amp;quot; default=&amp;quot;#F4F6F7&amp;quot;&lt;br /&gt;
					label=&amp;quot;TPL PROTOSTAR BACKGROUND COLOR LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;TPL PROTOSTAR BACKGROUND COLOR DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		    &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
		&amp;lt;/fields&amp;gt;&lt;br /&gt;
     &amp;lt;/config&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more complex parameter XML tags you may have to refer to more complex documentation. Also note that the index.php that reference the parameter variables will also need to be changed.&lt;br /&gt;
&lt;br /&gt;
See these links for more information about: &lt;br /&gt;
*[[Standard form field and parameter types]]&lt;br /&gt;
*[[Creating a basic templateDetails.xml file]]&lt;br /&gt;
&lt;br /&gt;
=== index.php file ===&lt;br /&gt;
&lt;br /&gt;
What needs to change in the index.php file?&lt;br /&gt;
&lt;br /&gt;
Index.php files are as widely varied as there are designers and programmers that write them. The index.php in a template for Joomla 3 is the compilation of the many versions that came before including 1.5, 1.6, 1.7,2.5, etc. This template file is the &amp;quot;bloodstream&amp;quot; providing life to your skin, and it has access to every piece of Joomla&#039;s framework available and can use these pieces to manipulate what your site is going to look like to your users. This has always been true and still is. Template designers and programmers have taken advantage of this fact in previous versions and will continue to, so this file needs the most careful research and planning.&lt;br /&gt;
&lt;br /&gt;
Changes that were made to the framework for Joomla 3 may cause problems to some older templates and when rendered could produce errors. Other templates may not have referenced the same piece of framework at all and work fine with almost no changes. For example, a 1.5 template that accesses the variable value &amp;quot;frontpage&amp;quot; to determine if they are on the home page or not. This doesn&#039;t work in Joomla 3. (See table below for code ) If a template referenced a changed piece or not will be the determining factor of how many issues you will have when trying to implement your updated template.&lt;br /&gt;
&lt;br /&gt;
Be prepared to make some changes based on “best practices”. Although your index.php may function, it needs to be secure and execute efficiently. Consider that every page served to your audience uses the index.php file so make sure you are familiar with the recommended methods for the Joomla framework and building blocks for a template. A thorough study of the index.php file in both the Protostar Template and the Beez Template that is included with the Joomla 3 installation package can provide examples and best practices for more complex templates. &lt;br /&gt;
&lt;br /&gt;
==== Guidelines ====&lt;br /&gt;
Here are some guidelines for your Joomla 3 template index.php file: &lt;br /&gt;
&lt;br /&gt;
1. Again, some things haven&#039;t changed: all index.php templates need to start with this statement:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php defined( &#039; JEXEC&#039; ) or die( &#039;Restricted access&#039; );?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
True for Joomla 1.5 and still true for Joomla 3.&lt;br /&gt;
&lt;br /&gt;
2. For Joomla 3 the recommended DOCTYPE ( Document Type Declaration ) should be HTML5 as this is used throughout Joomla 3. Here is an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
    &amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; xml:lang=&amp;quot;en&amp;quot; lang=&amp;quot;en&amp;quot; dir=&amp;quot;ltr&amp;quot;&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. To make use of Joomla 3&#039;s application framework:&lt;br /&gt;
&lt;br /&gt;
In 1.5 access to the framework was done through the $mainframe variable. You might see something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php require_once (‘includes/../framework.php&#039; );&lt;br /&gt;
$mainframe =&amp;amp; JFactory::getApplication(&#039;site&#039;); ?&amp;gt;&amp;lt;/source&amp;gt; &lt;br /&gt;
:replace it with this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php $app = Jfactory::getApplication();?&amp;gt;&lt;br /&gt;
      &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. To retrieve the Heading code use this statement directly beneath your heading tag and follow it with your stylesheets. This has not changed with the Joomla 3 but always bears repeating: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;head&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. To retrieve the sitename in 1.5 you might see this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $mainframe-&amp;gt;getCfg(&#039;sitename&#039;);?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For Joomla 3 use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php  $app-&amp;gt;getCfg(&#039;sitename&#039;);?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. Error Codes and Messages:&lt;br /&gt;
&lt;br /&gt;
A better methodology for retrieving error codes is in place for Joomla 3. You might see this in your 1.5 template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php $this-&amp;gt;error-&amp;gt;code; ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
:replace it with this Joomla 3 convention:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php $this-&amp;gt;error-&amp;gt;getCode(); ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For error messages, this is a typical 1.5 statement:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php $this-&amp;gt;error-&amp;gt;message; ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Replace it with this statement for Joomla 3&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php $this-&amp;gt;error-&amp;gt;getMessage(); ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7. To access the template parameters in replace code that looks like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php $color = $this-&amp;gt;params-&amp;gt;get(&#039;colorVariation&#039;); ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:with this recommended methodology:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php $app = Jfactory::getApplication();&lt;br /&gt;
$template = $app-&amp;gt;getTemplate(true);&lt;br /&gt;
$params = $template-&amp;gt;params;&lt;br /&gt;
$color = $params-&amp;gt;get(&#039;colorVariation&#039;); ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will work equally well as an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php $app = Jfactory::getApplication();&lt;br /&gt;
$params = $app-&amp;gt;getParams();&lt;br /&gt;
$color = $this-&amp;gt;params-&amp;gt;get(&#039;colorVariation&#039;); ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. Access to the Global Document Object classes in the index.php template file is typically coded this way:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php $doc = Jfactory::getDocument(); ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This statement is the same in Joomla 3. However, it is valid to note that this statement is not necessary to access the page classes so it might be there or it might not depending on the original programmer. &lt;br /&gt;
For example: given the code: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php $doc =&amp;amp; JFactory::getDocument();&lt;br /&gt;
echo &#039;Current title is: &#039; . $doc-&amp;gt;getTitle(); ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
is equivalent to this code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php echo &#039;Current title is: &#039; . $this-&amp;gt;getTitle(); ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== In Summary ====&lt;br /&gt;
&lt;br /&gt;
{{:Template_Code_Comparison_of_J1.5_and_J3.x}}&lt;br /&gt;
&lt;br /&gt;
== Bootstrap Styling and Joomla 3 ==&lt;br /&gt;
&lt;br /&gt;
To incorporate the new Bootstrap Styling ( 2.3.2 ) into your updated template, include these statements in your index.php before the first &amp;lt;code&amp;gt;&amp;lt;html&amp;amp;gt;&amp;lt;/code&amp;gt; tag and after the opening statements of your index:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php defined( &#039; JEXEC&#039; ) or die();&lt;br /&gt;
JHtml:: (&#039;bootstrap.framework&#039;);&lt;br /&gt;
JHtml:: (&#039;bootstrap.loadCss&#039;, true, $this-&amp;gt;direction); ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After these statements, you can add Bootstrap (2.3.2 ) classes wherever you need to and take advantage of the Bootstrap Framework offered in Joomla 3.&lt;br /&gt;
&lt;br /&gt;
== This bears repeating... ==&lt;br /&gt;
&lt;br /&gt;
There are many variations of coding practices and your success with translating a 1.5 template into a template fit for Joomla 3 depends on the complexity of the old and new design, and the original coding. Your template might have been previously converted from Joomla 1.0! Your best strategy is to research the documentation available and become familiar with the Protostar and Beez templates in Joomla 3. Techniques for coding and structuring in these 2 templates have undergone the scrutiny of the Joomla community and volunteer developers – the true experts on how to best make your template secure and function reliably.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
*[[Creating a basic Joomla! template]]&lt;br /&gt;
*[[Creating a basic index file]]&lt;br /&gt;
*[[Creating a basic templateDetails.xml file]]&lt;br /&gt;
*[[Understanding Joomla! templates]]&lt;br /&gt;
*[[Standard form field and parameter types]]&lt;br /&gt;
*[[Talk:Creating a basic Joomla! template]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Migration]]&lt;br /&gt;
[[Category:Template Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Converting_A_Previous_Joomla!_Version_Template&amp;diff=152592</id>
		<title>J3.x:Converting A Previous Joomla! Version Template</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Converting_A_Previous_Joomla!_Version_Template&amp;diff=152592"/>
		<updated>2015-01-12T11:57:32Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Version/tutor|3.x}}&lt;br /&gt;
{{incomplete}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
Converting your template to work with the Joomla 3 release involves a number of steps.  Because Joomla 3 uses the [http://twitter.github.com/bootstrap/ Twitter Bootstrap framework] many class and id names have changed. Also to take advantage of Bootstrap you will want to include certain files.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
This is not going to give you the results you would get by fully incorporating JUI into a template, but it will do as a work around and give some time to transition or fully go in a different direction if you prefer not to incorporate it at all.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
In some cases where you have heavily styled a layout or relied on MooTools features you may want to use overrides with the 2.5 layouts as a temporary bridge.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== HTML == &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Class names=== &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Joomla! 2.5&lt;br /&gt;
! Joomla! 3.x&lt;br /&gt;
! notes&lt;br /&gt;
|- &lt;br /&gt;
| menu&lt;br /&gt;
| nav&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| pagnav&lt;br /&gt;
| pager&lt;br /&gt;
|&lt;br /&gt;
|- &lt;br /&gt;
| actions&lt;br /&gt;
| dropdown-menu&lt;br /&gt;
| &amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
This will give you text but no icons&amp;lt;/translate&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===Index.php=== &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
Add this code before including the head to load Bootstrap.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JHtml:: (&#039;bootstrap.framework&#039;);&lt;br /&gt;
JHtml:: (&#039;bootstrap.loadCss&#039;, true, $this-&amp;gt;direction); ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Editor views=== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
The front end editor views use tabs to separate editing areas and options. If you don&#039;t wish to use these you will need to make an override that does not include this block:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ul class=&amp;quot;nav nav-tabs&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;li class=&amp;quot;active&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;#editor&amp;quot; data-toggle=&amp;quot;tab&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;JEDITOR&#039;) ?&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;?php if ($params-&amp;gt;get(&#039;show_urls_images_frontend&#039;)) : ?&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#images&amp;quot; data-toggle=&amp;quot;tab&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;COM_CONTENT_IMAGES_AND_URLS&#039;) ?&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#publishing&amp;quot; data-toggle=&amp;quot;tab&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;COM_CONTENT_PUBLISHING&#039;) ?&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#language&amp;quot; data-toggle=&amp;quot;tab&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;JFIELD_LANGUAGE_LABEL&#039;) ?&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#metadata&amp;quot; data-toggle=&amp;quot;tab&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;COM_CONTENT_METADATA&#039;) ?&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
[[Category:Template Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Converting_A_Previous_Joomla!_Version_Template&amp;diff=152587</id>
		<title>J3.x:Converting A Previous Joomla! Version Template</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Converting_A_Previous_Joomla!_Version_Template&amp;diff=152587"/>
		<updated>2015-01-12T11:55:29Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Load Bootstrap the easy way&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Version/tutor|3.x}}&lt;br /&gt;
{{incomplete}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
Converting your template to work with the Joomla 3 release involves a number of steps.  Because Joomla 3 uses the [http://twitter.github.com/bootstrap/ Twitter Bootstrap framework] many class and id names have changed. Also to take advantage of Bootstrap you will want to include certain files.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
This is not going to give you the results you would get by fully incorporating JUI into a template, but it will do as a work around and give some time to transition or fully go in a different direction if you prefer not to incorporate it at all.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
In some cases where you have heavily styled a layout or relied on MooTools features you may want to use overrides with the 2.5 layouts as a temporary bridge.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== HTML == &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Class names=== &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Joomla! 2.5&lt;br /&gt;
! Joomla! 3.x&lt;br /&gt;
! notes&lt;br /&gt;
|- &lt;br /&gt;
| menu&lt;br /&gt;
| nav&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| pagnav&lt;br /&gt;
| pager&lt;br /&gt;
|&lt;br /&gt;
|- &lt;br /&gt;
| actions&lt;br /&gt;
| dropdown-menu&lt;br /&gt;
| &amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
This will give you text but no icons&amp;lt;/translate&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===Index.php=== &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
Add this code before including the head to load Bootstrap.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JHtml:: (&#039;bootstrap.framework&#039;);&lt;br /&gt;
JHtml:: (&#039;bootstrap.loadCss&#039;, false, $this-&amp;gt;direction); ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Editor views=== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
The front end editor views use tabs to separate editing areas and options. If you don&#039;t wish to use these you will need to make an override that does not include this block:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ul class=&amp;quot;nav nav-tabs&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;li class=&amp;quot;active&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;#editor&amp;quot; data-toggle=&amp;quot;tab&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;JEDITOR&#039;) ?&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;?php if ($params-&amp;gt;get(&#039;show_urls_images_frontend&#039;)) : ?&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#images&amp;quot; data-toggle=&amp;quot;tab&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;COM_CONTENT_IMAGES_AND_URLS&#039;) ?&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#publishing&amp;quot; data-toggle=&amp;quot;tab&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;COM_CONTENT_PUBLISHING&#039;) ?&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#language&amp;quot; data-toggle=&amp;quot;tab&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;JFIELD_LANGUAGE_LABEL&#039;) ?&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#metadata&amp;quot; data-toggle=&amp;quot;tab&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;COM_CONTENT_METADATA&#039;) ?&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
[[Category:Template Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Migrating_a_Template_from_Joomla_1.5_to_3.x&amp;diff=152575</id>
		<title>Migrating a Template from Joomla 1.5 to 3.x</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Migrating_a_Template_from_Joomla_1.5_to_3.x&amp;diff=152575"/>
		<updated>2015-01-12T11:51:34Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: defining $doc is not needed or relevant&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When considering a manual update to your 1.5 template there are a few considerations you need to think about. &lt;br /&gt;
&lt;br /&gt;
First, what skills do you need? To make template changes, minimally you need to be familiar with the basics of PHP, HTML, XML, CSS and possibly some Javascript. If you don’t have a basic grasp of these skills a lot of what you’ll be looking at will look foreign so either brush up on those skills or hire a professional.  &lt;br /&gt;
&lt;br /&gt;
Second, the extent that your template needs to change must be measured in terms of the new enhancements or design changes that have developed in planning your migration. Is the change going to take advantage of new Bootstrap framework styling that is available in Joomla 3? Or is it a strict move that mirrors the current site. While some of the changes that are new to Joomla 3 are mandatory ( meaning your template will not load ) others are enhancements and your template will load but might not look the way you want it to. &lt;br /&gt;
&lt;br /&gt;
For purposes of this document we will be assuming the simplest example and suggest a mirror image of the current 1.5 template. For more complex templates or for major enhancements you may need to do some research or hire someone who has more experience with templates. &lt;br /&gt;
&lt;br /&gt;
== Review the Basics of Templates ==&lt;br /&gt;
&lt;br /&gt;
Some things haven&#039;t changed. You still need to be familiar with the basics of a JoomlaTemplate: The folder directory structure is one of those things. Minimally at the root level you need 2 files: “index.php” and &amp;quot;templateDetails.xml&amp;quot; ( notice the case! ). Most templates include at least 2 folders: an images folder to hold all the graphics that your template uses and a folder for your css styling. More advanced templates might contain folders with names like these for example: “html” for component and module customization,  a “language” folder for custom language overrides, “javascript” to hold custom javascript routines.&lt;br /&gt;
&lt;br /&gt;
Just be sure if the folder is listed in the XML file it exists in the template you upload to Joomla. If you declare a file in the xml then it must exist or your template will not load.&lt;br /&gt;
&lt;br /&gt;
One example of an improvement in versions greater than 1.5, is the dropping of the requirement that all the subfolder filenames be listed. For templates in Joomla 3, you simply list the folder name.&lt;br /&gt;
&lt;br /&gt;
For more information on the basics of a template see this link: [[Creating a basic Joomla! template&lt;br /&gt;
&lt;br /&gt;
=== XML File Changes ===&lt;br /&gt;
What needs to change in the templateDetails.xml file ( Template Manifest File )&lt;br /&gt;
&lt;br /&gt;
The template manifest file provides the information Joomla needs to install your template. The XML manifest file has been almost completely modified since 1.5 so make sure you study up and are familiar with the basics and the modifications. Your template will not load if this file is not exactly right.&lt;br /&gt;
&lt;br /&gt;
==== Document Reference Type Tag &amp;amp; the Install/Extension Tag ==== &lt;br /&gt;
The XML Install tag is now an “extension” tag. Additionally, any reference in the DOCTYPE Tag  or version numbers now needs to refer to 3.0.&lt;br /&gt;
&lt;br /&gt;
The old lines are something like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE install PUBLIC &amp;quot;-//Joomla! 1.5//DTD template 1.0//EN&amp;quot; &amp;quot;http://dev.joomla.org/xml/1.5/template-install.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;install version=&amp;quot;1.5&amp;quot; type=&amp;quot;template&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This now needs to look like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE install PUBLIC &amp;quot;-//Joomla! 2.5//DTD template 1.0//EN&amp;quot; &amp;quot;http://www.joomla.org/xml/dtd/2.5/template-install.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;extension version=&amp;quot;3.1&amp;quot; type=&amp;quot;template&amp;quot; client=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Folder and File tags ====&lt;br /&gt;
This rule has always been true and still is: If you list the Filename or Folder in the XML it must exist in the uploaded template. This has not changed in Joomla 3. What did change is the 1.5 requirement that all the filenames in a folder be listed. Now you can refer to just the folder name. For example, previously in 1.5 your xml filenames were listed individually as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;images&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;images/arrow.png&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;images/arrow2.png&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;images/arrow3.png&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;images/author.gif&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/images&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a Joomla 3 template this statement suffices:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;folder&amp;gt;images&amp;lt;/folder&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Module Tags ====&lt;br /&gt;
For 1.5, module positions were defined in the template. This has not changed. They still need to be listed.&lt;br /&gt;
&lt;br /&gt;
==== Parameters ====&lt;br /&gt;
Parameters are an optional feature of templates that allow the template author to offer options for styling of the template in the Joomla Administrator. In Joomla 1.5 templates the parameters were listed in a &amp;quot;parameters.ini&amp;quot; file at the root level. This file has been eliminated and the parameters are now tags in the XML file.&lt;br /&gt;
&lt;br /&gt;
Here is an example of the contents of a parameters.ini file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
colorVariation=blue&lt;br /&gt;
backgroundVariation=blue&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To define the parameters in Joomla 3 you must add these lines to the XML file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;config&amp;gt;&lt;br /&gt;
		&amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
		     &amp;lt;fieldset name=&amp;quot;advanced&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;field name=&amp;quot;colorVariation&amp;quot; class=&amp;quot;&amp;quot; type=&amp;quot;color&amp;quot; default=&amp;quot;#08C&amp;quot;&lt;br /&gt;
					label=&amp;quot;TPL PROTOSTAR COLOR LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;TPL PROTOSTAR COLOR DESC&amp;quot; /&amp;gt;&lt;br /&gt;
				&amp;lt;field name=&amp;quot;backgroundVariation&amp;quot; class=&amp;quot;&amp;quot; type=&amp;quot;color&amp;quot; default=&amp;quot;#F4F6F7&amp;quot;&lt;br /&gt;
					label=&amp;quot;TPL PROTOSTAR BACKGROUND COLOR LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;TPL PROTOSTAR BACKGROUND COLOR DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		    &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
		&amp;lt;/fields&amp;gt;&lt;br /&gt;
     &amp;lt;/config&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more complex parameter XML tags you may have to refer to more complex documentation. Also note that the index.php that reference the parameter variables will also need to be changed.&lt;br /&gt;
&lt;br /&gt;
See these links for more information about: &lt;br /&gt;
*[[Standard form field and parameter types]]&lt;br /&gt;
*[[Creating a basic templateDetails.xml file]]&lt;br /&gt;
&lt;br /&gt;
=== index.php file ===&lt;br /&gt;
&lt;br /&gt;
What needs to change in the index.php file?&lt;br /&gt;
&lt;br /&gt;
Index.php files are as widely varied as there are designers and programmers that write them. The index.php in a template for Joomla 3 is the compilation of the many versions that came before including 1.5, 1.6, 1.7,2.5, etc. This template file is the &amp;quot;bloodstream&amp;quot; providing life to your skin, and it has access to every piece of Joomla&#039;s framework available and can use these pieces to manipulate what your site is going to look like to your users. This has always been true and still is. Template designers and programmers have taken advantage of this fact in previous versions and will continue to, so this file needs the most careful research and planning.&lt;br /&gt;
&lt;br /&gt;
Changes that were made to the framework for Joomla 3 may cause problems to some older templates and when rendered could produce errors. Other templates may not have referenced the same piece of framework at all and work fine with almost no changes. For example, a 1.5 template that accesses the variable value &amp;quot;frontpage&amp;quot; to determine if they are on the home page or not. This doesn&#039;t work in Joomla 3. (See table below for code ) If a template referenced a changed piece or not will be the determining factor of how many issues you will have when trying to implement your updated template.&lt;br /&gt;
&lt;br /&gt;
Be prepared to make some changes based on “best practices”. Although your index.php may function, it needs to be secure and execute efficiently. Consider that every page served to your audience uses the index.php file so make sure you are familiar with the recommended methods for the Joomla framework and building blocks for a template. A thorough study of the index.php file in both the Protostar Template and the Beez Template that is included with the Joomla 3 installation package can provide examples and best practices for more complex templates. &lt;br /&gt;
&lt;br /&gt;
==== Guidelines ====&lt;br /&gt;
Here are some guidelines for your Joomla 3 template index.php file: &lt;br /&gt;
&lt;br /&gt;
1. Again, some things haven&#039;t changed: all index.php templates need to start with this statement:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php defined( &#039; JEXEC&#039; ) or die( &#039;Restricted access&#039; );?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
True for Joomla 1.5 and still true for Joomla 3.&lt;br /&gt;
&lt;br /&gt;
2. For Joomla 3 the recommended DOCTYPE ( Document Type Declaration ) should be HTML5 as this is used throughout Joomla 3. Here is an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
    &amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; xml:lang=&amp;quot;en&amp;quot; lang=&amp;quot;en&amp;quot; dir=&amp;quot;ltr&amp;quot;&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. To make use of Joomla 3&#039;s application framework:&lt;br /&gt;
&lt;br /&gt;
In 1.5 access to the framework was done through the $mainframe variable. You might see something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php require_once (‘includes/../framework.php&#039; );&lt;br /&gt;
$mainframe =&amp;amp; JFactory::getApplication(&#039;site&#039;); ?&amp;gt;&amp;lt;/source&amp;gt; &lt;br /&gt;
:replace it with this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php $app = Jfactory::getApplication();?&amp;gt;&lt;br /&gt;
      &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. To retrieve the Heading code use this statement directly beneath your heading tag and follow it with your stylesheets. This has not changed with the Joomla 3 but always bears repeating: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;jdoc:include type=&amp;quot;head&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. To retrieve the sitename in 1.5 you might see this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $mainframe-&amp;gt;getCfg(&#039;sitename&#039;);?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For Joomla 3 use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php  $app-&amp;gt;getCfg(&#039;sitename&#039;);?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. Error Codes and Messages:&lt;br /&gt;
&lt;br /&gt;
A better methodology for retrieving error codes is in place for Joomla 3. You might see this in your 1.5 template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php $this-&amp;gt;error-&amp;gt;code; ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
:replace it with this Joomla 3 convention:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php $this-&amp;gt;error-&amp;gt;getCode(); ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For error messages, this is a typical 1.5 statement:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php $this-&amp;gt;error-&amp;gt;message; ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Replace it with this statement for Joomla 3&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php $this-&amp;gt;error-&amp;gt;getMessage(); ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7. To access the template parameters in replace code that looks like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php $color = $this-&amp;gt;params-&amp;gt;get(&#039;colorVariation&#039;); ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:with this recommended methodology:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php $app = Jfactory::getApplication();&lt;br /&gt;
$template = $app-&amp;gt;getTemplate(true);&lt;br /&gt;
$params = $template-&amp;gt;params;&lt;br /&gt;
$color = $params-&amp;gt;get(&#039;colorVariation&#039;); ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will work equally well as an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php $app = Jfactory::getApplication();&lt;br /&gt;
$params = $app-&amp;gt;getParams();&lt;br /&gt;
$color = $this-&amp;gt;params-&amp;gt;get(&#039;colorVariation&#039;); ?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. Access to the Global Document Object classes in the index.php template file is typically coded this way:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php $doc = Jfactory::getDocument(); ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This statement is the same in Joomla 3. However, it is valid to note that this statement is not necessary to access the page classes so it might be there or it might not depending on the original programmer. &lt;br /&gt;
For example: given the code: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php $doc =&amp;amp; JFactory::getDocument();&lt;br /&gt;
echo &#039;Current title is: &#039; . $doc-&amp;gt;getTitle(); ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
is equivalent to this code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php echo &#039;Current title is: &#039; . $this-&amp;gt;getTitle(); ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== In Summary ====&lt;br /&gt;
&lt;br /&gt;
{{:Template_Code_Comparison_of_J1.5_and_J3.x}}&lt;br /&gt;
&lt;br /&gt;
== Bootstrap Styling and Joomla 3 ==&lt;br /&gt;
&lt;br /&gt;
To incorporate the new Bootstrap Styling ( 2.3.2 ) into your updated template, include these statements in your index.php before the first &amp;lt;code&amp;gt;&amp;lt;html&amp;amp;gt;&amp;lt;/code&amp;gt; tag and after the opening statements of your index:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php defined( &#039; JEXEC&#039; ) or die();&lt;br /&gt;
JHtml:: (&#039;bootstrap.framework&#039;);&lt;br /&gt;
JHtml:: (&#039;bootstrap.loadCss&#039;, false, $this-&amp;gt;direction); ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After these statements, you can add Bootstrap (2.3.2 ) classes wherever you need to and take advantage of the Bootstrap Framework offered in Joomla 3.&lt;br /&gt;
&lt;br /&gt;
== This bears repeating... ==&lt;br /&gt;
&lt;br /&gt;
There are many variations of coding practices and your success with translating a 1.5 template into a template fit for Joomla 3 depends on the complexity of the old and new design, and the original coding. Your template might have been previously converted from Joomla 1.0! Your best strategy is to research the documentation available and become familiar with the Protostar and Beez templates in Joomla 3. Techniques for coding and structuring in these 2 templates have undergone the scrutiny of the Joomla community and volunteer developers – the true experts on how to best make your template secure and function reliably.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
*[[Creating a basic Joomla! template]]&lt;br /&gt;
*[[Creating a basic index file]]&lt;br /&gt;
*[[Creating a basic templateDetails.xml file]]&lt;br /&gt;
*[[Understanding Joomla! templates]]&lt;br /&gt;
*[[Standard form field and parameter types]]&lt;br /&gt;
*[[Talk:Creating a basic Joomla! template]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Migration]]&lt;br /&gt;
[[Category:Template Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Template_Code_Comparison_of_J1.5_and_J3.x&amp;diff=130509</id>
		<title>Template Code Comparison of J1.5 and J3.x</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Template_Code_Comparison_of_J1.5_and_J3.x&amp;diff=130509"/>
		<updated>2014-10-31T13:53:03Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Removed PHP tags&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The table below is a quick reference of code differences between a Joomla 1.5 and Joomla 3.x template&#039;s &amp;lt;code&amp;gt;index.php&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;In a 1.5 Template(index.php)&#039;&#039;&#039; you might see&lt;br /&gt;
! &#039;&#039;&#039;Recommended J3.x Template(index.php) code&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| First Line&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;?php defined( &#039;_JEXEC&#039; ) or die( &#039;Restricted access&#039; );?&amp;gt;&amp;lt;/code&amp;gt; &lt;br /&gt;
| &#039;&#039;&#039;No change&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| DOCTYPE&lt;br /&gt;
| &amp;lt;pre&amp;gt;&amp;lt;!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; xml:lang=&amp;quot;en&amp;quot; lang=&amp;quot;en&amp;quot; dir=&amp;quot;ltr&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;  xml:lang=&amp;quot;&amp;lt;?php echo $this-&amp;gt;language; ?&amp;gt;&amp;quot; lang=&amp;quot;&amp;lt;?php echo $this-&amp;gt;language; ?&amp;gt;&amp;quot; dir=&amp;quot;&amp;lt;?php echo $this-&amp;gt;direction; ?&amp;gt;&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Access to Joomla Framework&lt;br /&gt;
| &amp;lt;pre&amp;gt;$app = JFactory::getApplication();&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &#039;&#039;&#039;No change&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Retreive HTML headers from Joomla&lt;br /&gt;
| &amp;lt;pre&amp;gt;&amp;lt;jdoc:include type=&amp;quot;head&amp;quot; /&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &#039;&#039;&#039;No change&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Retreive the Sitename&lt;br /&gt;
| &amp;lt;pre&amp;gt;$mainframe-&amp;gt; getCfg(&#039;sitename&#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;$app-&amp;gt;getCfg(&#039;sitename&#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Retrieve Error Codes&lt;br /&gt;
|&amp;lt;pre&amp;gt;$this-&amp;gt;error-&amp;gt;code&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;$this-&amp;gt;error-&amp;gt;getCode();&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Retrieve Error Messages&lt;br /&gt;
|&amp;lt;pre&amp;gt;$this-&amp;gt;error-&amp;gt;message&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;$this-&amp;gt;error-&amp;gt;getMessage();&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Retrieve System Messages&lt;br /&gt;
|&amp;lt;pre&amp;gt;$this-&amp;gt;getBuffer(&#039;message&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;&amp;lt;jdoc:include type=&amp;quot;message&amp;quot; /&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Active Language&lt;br /&gt;
|&amp;lt;pre&amp;gt;$this-&amp;gt;language;&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;$doc-&amp;gt;language;&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| View&lt;br /&gt;
|&amp;lt;pre&amp;gt;JRequest::getVar( &#039;view&#039; )&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;$app-&amp;gt;input-&amp;gt;getCmd(&#039;view&#039;, &#039;&#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Task&lt;br /&gt;
|&amp;lt;pre&amp;gt;JRequest::getVar( &#039;task&#039; )&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;$app-&amp;gt;input-&amp;gt;getCmd(&#039;task&#039;, &#039;&#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Layout&lt;br /&gt;
|&amp;lt;pre&amp;gt;JRequest::getVar( &#039;layout&#039; )&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;$app-&amp;gt;input-&amp;gt;getCmd(&#039;layout, &#039;&#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ID&lt;br /&gt;
|&amp;lt;pre&amp;gt;JRequest::getVar( &#039;id&#039; )&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;$app-&amp;gt;input-&amp;gt;getCmd(&#039;layout, &#039;&#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Homepage detection&lt;br /&gt;
|&amp;lt;pre&amp;gt;&amp;lt;?php if(JRequest::getVar( &#039;view&#039; ) == &#039;frontpage&#039;) ?&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;&amp;lt;?php $menu = $app-&amp;gt;getMenu();&lt;br /&gt;
if($menu-&amp;gt;getActive() == $menu-&amp;gt; getDefault()) ?&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Main Content &lt;br /&gt;
| &amp;lt;pre&amp;gt;&amp;lt;jdoc:include type=&amp;quot;component&amp;quot; /&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &#039;&#039;&#039;No change&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Modules &amp;amp; Positions&lt;br /&gt;
|&amp;lt;pre&amp;gt;&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;right&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &#039;&#039;&#039;No change&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Retrieve Base URL&lt;br /&gt;
|&amp;lt;pre&amp;gt;$url = clone(JURI::getInstance());&lt;br /&gt;
echo $this-&amp;gt;baseurl; &lt;br /&gt;
JURI::root()*; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
JURI::base();&lt;br /&gt;
$this-&amp;gt;baseurl;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Template Development]]&lt;br /&gt;
[[Category:Migration]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Template_Code_Comparison_of_J1.5_and_J3.x&amp;diff=130507</id>
		<title>Template Code Comparison of J1.5 and J3.x</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Template_Code_Comparison_of_J1.5_and_J3.x&amp;diff=130507"/>
		<updated>2014-10-31T13:49:38Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Removed variable assignments as they aren&amp;#039;t necessary&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The table below is a quick reference of code differences between a Joomla 1.5 and Joomla 3.x template&#039;s &amp;lt;code&amp;gt;index.php&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;In a 1.5 Template(index.php)&#039;&#039;&#039; you might see&lt;br /&gt;
! &#039;&#039;&#039;Recommended J3.x Template(index.php) code&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| First Line&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;?php defined( &#039;_JEXEC&#039; ) or die( &#039;Restricted access&#039; );?&amp;gt;&amp;lt;/code&amp;gt; &lt;br /&gt;
| &#039;&#039;&#039;No change&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| DOCTYPE&lt;br /&gt;
| &amp;lt;pre&amp;gt;&amp;lt;!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; xml:lang=&amp;quot;en&amp;quot; lang=&amp;quot;en&amp;quot; dir=&amp;quot;ltr&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;  xml:lang=&amp;quot;&amp;lt;?php echo $this-&amp;gt;language; ?&amp;gt;&amp;quot; lang=&amp;quot;&amp;lt;?php echo $this-&amp;gt;language; ?&amp;gt;&amp;quot; dir=&amp;quot;&amp;lt;?php echo $this-&amp;gt;direction; ?&amp;gt;&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Access to Joomla Framework&lt;br /&gt;
| &amp;lt;pre&amp;gt;$url = clone(JURI::getInstance());&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;$app = Jfactory::getApplication();&lt;br /&gt;
$doc = Jfactory::getDocument();&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Retreive HTML headers from Joomla&lt;br /&gt;
| &amp;lt;pre&amp;gt;&amp;lt;jdoc:include type=&amp;quot;head&amp;quot; /&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &#039;&#039;&#039;No change&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Retreive the Sitename&lt;br /&gt;
| &amp;lt;pre&amp;gt;&amp;lt;?php echo $mainframe-&amp;gt; getCfg(&#039;sitename&#039;);?&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;&amp;lt;?php $app-&amp;gt;getCfg(&#039;sitename&#039;);?&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Retrieve Error Codes&lt;br /&gt;
|&amp;lt;pre&amp;gt;$this-&amp;gt;error-&amp;gt;code&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;$this-&amp;gt;error-&amp;gt;getCode();&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Retrieve Error Messages&lt;br /&gt;
|&amp;lt;pre&amp;gt;$this-&amp;gt;error-&amp;gt;message&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;$this-&amp;gt;error-&amp;gt;getMessage();&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Retrieve System Messages&lt;br /&gt;
|&amp;lt;pre&amp;gt;$this-&amp;gt;getBuffer(&#039;message&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;&amp;lt;jdoc:include type=&amp;quot;message&amp;quot; /&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Active Language&lt;br /&gt;
|&amp;lt;pre&amp;gt;&amp;lt;?php $this-&amp;gt;language; ?&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;&amp;lt;?php $doc-&amp;gt;language; ?&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| View&lt;br /&gt;
|&amp;lt;pre&amp;gt;JRequest::getVar( &#039;view&#039; )&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;$app-&amp;gt;input-&amp;gt;getCmd(&#039;view&#039;, &#039;&#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Task&lt;br /&gt;
|&amp;lt;pre&amp;gt;JRequest::getVar( &#039;task&#039; )&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;$app-&amp;gt;input-&amp;gt;getCmd(&#039;task&#039;, &#039;&#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Layout&lt;br /&gt;
|&amp;lt;pre&amp;gt;JRequest::getVar( &#039;layout&#039; )&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;$app-&amp;gt;input-&amp;gt;getCmd(&#039;layout, &#039;&#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ID&lt;br /&gt;
|&amp;lt;pre&amp;gt;JRequest::getVar( &#039;id&#039; )&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;$app-&amp;gt;input-&amp;gt;getCmd(&#039;layout, &#039;&#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Homepage detection&lt;br /&gt;
|&amp;lt;pre&amp;gt;JRequest::getVar( &#039;view&#039; ) == &#039;frontpage&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;&amp;lt;?php $menu = $app-&amp;gt;getMenu(); ?&amp;gt;&lt;br /&gt;
  &amp;lt;?php if($menu-&amp;gt;getActive() == $menu-&amp;gt; getDefault()) { ?&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Main Content &lt;br /&gt;
| &amp;lt;pre&amp;gt;&amp;lt;jdoc:include type=&amp;quot;component&amp;quot; /&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &#039;&#039;&#039;No change&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Modules &amp;amp; Positions&lt;br /&gt;
|&amp;lt;pre&amp;gt;&amp;lt;jdoc:include type=&amp;quot;modules&amp;quot; name=&amp;quot;right&amp;quot; style=&amp;quot;xhtml&amp;quot; /&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &#039;&#039;&#039;No change&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| URL&lt;br /&gt;
|&amp;lt;pre&amp;gt;JURI::root()*&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;$this-&amp;gt;baseurl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Template Development]]&lt;br /&gt;
[[Category:Migration]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Help310:Extensions_Plugin_Manager_Edit&amp;diff=128836</id>
		<title>Help310:Extensions Plugin Manager Edit</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Help310:Extensions_Plugin_Manager_Edit&amp;diff=128836"/>
		<updated>2014-10-21T13:45:00Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: /* Authentication - GMail */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==How to Access==&lt;br /&gt;
Navigate to the [[Help30:Extensions_Plugin_Manager|Plug-in Manager]]. Click on the Plug-in&#039;s Name or click on the Plug-in&#039;s checkbox and press the Edit button in the toolbar.&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
This screen allows you to edit the details and options for plug-ins. Some plug-ins have several configurable options, while others may not have any.&lt;br /&gt;
&lt;br /&gt;
==Screenshot==&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-screen.png]]&lt;br /&gt;
&lt;br /&gt;
==Details==&lt;br /&gt;
The Details section is the same for all plug-ins and has the following fields:&lt;br /&gt;
*&#039;&#039;&#039;Plug-in Name.&#039;&#039;&#039; The Name of the Plug-in.&lt;br /&gt;
*&#039;&#039;&#039;Enabled.&#039;&#039;&#039; Whether or not this Plug-in is enabled.&lt;br /&gt;
*&#039;&#039;&#039;Access.&#039;&#039;&#039; Which user &#039;access levels&#039; have access to this item. You can change an item&#039;s Access Level by clicking on its name to open it up for editing. The default user &#039;access levels&#039; which come preconfigured with Joomla! are:&lt;br /&gt;
** Public: Everyone has access including website visitors who have not logged in&lt;br /&gt;
** Registered: Only users with registered status or higher will have access&lt;br /&gt;
** Special: Only users with author status or higher have access&lt;br /&gt;
*&#039;&#039;&#039;Ordering.&#039;&#039;&#039; A drop-down list of plug-ins of the same Type. The list of plug-ins is arranged by their current order. You can change this plug-in&#039;s order in relation to the other plug-ins by selecting the plug-in in the drop-down list that you want this plug-in to be ordered below.&lt;br /&gt;
*&#039;&#039;&#039;Plug-in Type.&#039;&#039;&#039; The Type of the Plug-in. This value cannot be changed.&lt;br /&gt;
*&#039;&#039;&#039;Plug-in File.&#039;&#039;&#039; The name of the Plug-in file. Each Plug-in has two files with this name. One has the file extension &#039;.php&#039; and the other has the file extension &#039;.xml&#039;.&lt;br /&gt;
*&#039;&#039;&#039;ID.&#039;&#039;&#039; The Plug-in&#039;s ID number. This is a unique identification number for this item assigned automatically by Joomla!. It is used to identify the item internally, for example in internal links. You cannot change this number.&lt;br /&gt;
*&#039;&#039;&#039;Description.&#039;&#039;&#039; The description of what this Plug-in does. This cannot be changed. The developer of the plug-in specifies this. This may be blank if the developer did not specify a description for the plug-in.&lt;br /&gt;
&lt;br /&gt;
==Options==&lt;br /&gt;
If the plug-in has configurable options they will appear to the right of the details section. Usually you will see &#039;&#039;Basic Options&#039;&#039; which are general options which need to be configured for the basic operation of the plug-in. You may also see &#039;&#039;Advanced Options&#039;&#039; which are additional configurable options available for the plug-in which allows further customization of the plug-in. Finally you may see &#039;&#039;Language Options&#039;&#039; which are options related to the language functions of your Joomla! installation.&lt;br /&gt;
&lt;br /&gt;
==Toolbar==&lt;br /&gt;
At the top right you will see the toolbar:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Save-SaveClose-Close-Help-toolbar.png]]&lt;br /&gt;
&lt;br /&gt;
The functions are:&lt;br /&gt;
{{Chunk30:Help_screen_toolbar_icon_Save|plug-in}}&lt;br /&gt;
{{Chunk30:Help_screen_toolbar_icon_SaveAndClose|plug-in}}&lt;br /&gt;
{{Chunk30:Help_screen_toolbar_icon_Cancel}}&lt;br /&gt;
{{Chunk30:Help_screen_toolbar_icon_Help}}&lt;br /&gt;
&lt;br /&gt;
==Plug-in Descriptions and Options==&lt;br /&gt;
When Joomla! is installed, many plug-ins are included in the installation. These are described below, along with any options for the plug-in.&lt;br /&gt;
&lt;br /&gt;
===Authentication - Joomla===&lt;br /&gt;
This plug-in processes the default User Authentication method in Joomla!. It has no options.&lt;br /&gt;
&lt;br /&gt;
===Authentication - GMail===&lt;br /&gt;
This plug-in processes User Authentication using GMail accounts. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-gmail-options-screen.png]]&lt;br /&gt;
* &#039;&#039;&#039;Apply Username Suffix.&#039;&#039;&#039; This options allows you to automatically apply a suffix to the username a person enters when they log into your Joomla! installation. The suffix is the portion of the email address after the &#039;&#039;@&#039;&#039; symbol.&lt;br /&gt;
* &#039;&#039;&#039;Username Suffix.&#039;&#039;&#039; This is the suffix portion of the GMail email addresses which will be used to log into your site. This is the portion of the mail address after the &#039;&#039;@&#039;&#039; symbol. Usually you will set this to &#039;&#039;gmail.com&#039;&#039; for regular GMail accounts. This option is present to allow you to use other GMail accounts that don&#039;t end in the typical &#039;&#039;gmail.com&#039;&#039; suffix. This would be the case with Google Apps for Domains email accounts.&lt;br /&gt;
* &#039;&#039;&#039;Verify Peer.&#039;&#039;&#039; When your Joomla! installation attempts to verify the entered Gmail username it does so over an SSL connection. This option configures whether or not your Joomla! installation will check to ensure the CA certificate of the SSL connection is valid before proceeding with verification of the entered username/password. In some situations certificate verification fails in which case you can try setting this option to &#039;&#039;No&#039;&#039; to try to fix this.&lt;br /&gt;
* &#039;&#039;&#039;User Blacklist.&#039;&#039;&#039; A comma separated list of usernames not allowed to log into your Joomla! installation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To use the GMail plug-in:&#039;&#039;&#039;&lt;br /&gt;
* Create a Joomla! user account with the same username as a GMail account user. For example if the GMail email address of the person you want to add is bob1234@gmail.com you would create the Joomla! user account with the username &#039;&#039;bob1234&#039;&#039;.&lt;br /&gt;
* Enable the GMail Plug-in.&lt;br /&gt;
* Logout of Joomla!.&lt;br /&gt;
* Login using the GMail username (without &amp;quot;@gmail.com&amp;quot;) and the GMail password.&lt;br /&gt;
&lt;br /&gt;
NOTE: Google may block these sign in attempts due to recently increased security checks[http://googleonlinesecurity.blogspot.de/2014/04/new-security-measures-will-affect-older.html] by Google. To resolve this issue, the user may need to go to [https://www.google.com/settings/security/lesssecureapps Allow less secure apps] and choose &amp;quot;Allow&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Authentication - LDAP===&lt;br /&gt;
This plug-in processes User Authentication against an LDAP server. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-ldap-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Host.&#039;&#039;&#039; The host URL. For example, &amp;quot;openldap.mycompany.org&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;Port.&#039;&#039;&#039; The port number. The default is 389.&lt;br /&gt;
*&#039;&#039;&#039;LDAP V3.&#039;&#039;&#039; Whether or not this host uses LDAP version 3. The default is LDAP v2.&lt;br /&gt;
*&#039;&#039;&#039;Negotiate TLS.&#039;&#039;&#039; Whether or not to use TLS encryption with this host. If set to &amp;quot;Yes&amp;quot;, all traffic to and from this server must be encrypted.&lt;br /&gt;
*&#039;&#039;&#039;Follow Referrals.&#039;&#039;&#039; Whether to set the LDAP_OPT_REFERRALS flag to Yes or No. For Windows 2003 hosts this must be set to No.&lt;br /&gt;
*&#039;&#039;&#039;Authorization Method.&#039;&#039;&#039; &amp;quot;Bind Directly as User&amp;quot; or &amp;quot;Bind and Search&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;Base DN.&#039;&#039;&#039; The Base DN of your LDAP server.&lt;br /&gt;
*&#039;&#039;&#039;Search String.&#039;&#039;&#039; A query string used to search for a given User. The [search] keyword is replaced by the login typed by the User. For example: &amp;quot;uid=[search]&amp;quot;. More than one Search String can be entered. Separate each by a semi-colon &amp;quot;;&amp;quot; character. This is only used when searching.&lt;br /&gt;
*&#039;&#039;&#039;User&#039;s DN.&#039;&#039;&#039; The [username] keyword is dynamically replaced by the username typed by the User. An example string is: &amp;quot;uid=[username], dc=[my-domain], dc=[com]&amp;quot;. More than one string can be entered. Separate each with a semi-colon &amp;quot;;&amp;quot; character. This is only used if the Authorization Method above is set to &amp;quot;Bind Directly as User&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;Connect Username and Connect Password.&#039;&#039;&#039; These define connection parameters for the DN lookup phase. For anonymous lookup, leave both of these fields blank. For an Administrative Connection, the &amp;quot;Connect Username&amp;quot; is the username of an administrative account (for example, &amp;quot;Administrator&amp;quot;). In this case, the &amp;quot;Connect password&amp;quot; is the actual password to this administrative account.&lt;br /&gt;
*&#039;&#039;&#039;Map: Full Name.&#039;&#039;&#039; The LDAP attribute that contains the User&#039;s full name.&lt;br /&gt;
*&#039;&#039;&#039;Map: E-mail.&#039;&#039;&#039; The LDAP attribute that contains the User&#039;s e-mail address.&lt;br /&gt;
*&#039;&#039;&#039;Map: User ID.&#039;&#039;&#039; The LDAP attribute that contains the User&#039;s login ID. For Active Directory, this is &amp;quot;sAMAccountName&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Authentication - OpenID===&lt;br /&gt;
This Plugin processes user authentication with an OpenID. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-openid-options-screen.png]]&lt;br /&gt;
* &#039;&#039;&#039;Convert Old Usernames.&#039;&#039;&#039; Convert old usernames to the proper OpenID format. Set this to &#039;&#039;Yes&#039;&#039; if you upgraded your Joomla! installation from one that was already using OpenID authentication.&lt;br /&gt;
* &#039;&#039;&#039;Require Policy phishing-resistant.&#039;&#039;&#039; Requires the OpenID Provider to be configured with the OpenID Provider Authentication Policy Extension &#039;&#039;Phishing-Resistant Authentication&#039;&#039; policy.&lt;br /&gt;
* &#039;&#039;&#039;Require Policy multi-factor.&#039;&#039;&#039; Requires the OpenID Provider to be configured with the OpenID Provider Authentication Policy Extension &#039;&#039;Multi-Factor Authentication&#039;&#039; policy.&lt;br /&gt;
* &#039;&#039;&#039;Require Policy multi-factor-physical.&#039;&#039;&#039; Requires the OpenID Provider to be configured with the OpenID Provider Authentication Policy Extension &#039;&#039;Physical Multi-Factor Authentication&#039;&#039; policy.&lt;br /&gt;
&lt;br /&gt;
===Captcha - ReCaptcha===&lt;br /&gt;
This CAPTCHA plugin uses the reCAPTCHA service to prevent spammers while it helps to digitize books, newspapers and old radio shows. The fields &amp;quot;Public Key&amp;quot; and &amp;quot;Private Key&amp;quot; must be filled in before activating.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Public Key&#039;&#039;&#039; Used in the JavaScript code that is served to your users.&lt;br /&gt;
* &#039;&#039;&#039;Private Key&#039;&#039;&#039; Used in the communication between your server and the ReCaptha server. Be sure to keep it a secret.&lt;br /&gt;
* &#039;&#039;&#039;Theme&#039;&#039;&#039; Defines which theme to use for ReCaptcha.&lt;br /&gt;
&lt;br /&gt;
===Content - Email Cloaking===&lt;br /&gt;
This plug-in cloaks all e-mails in content from spambots using JavaScript. This helps prevent e-mails contained in articles from being added to spam e-mail lists. You can disable Email Cloaking inside an article by inserting &amp;lt;code&amp;gt;{emailcloak=off}&amp;lt;/code&amp;gt; anywhere in the text of the article. In this case, no e-mail addresses in the article will be cloaked by this plug-in.&lt;br /&gt;
&lt;br /&gt;
Email Cloaking has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-email-cloaking-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Mode.&#039;&#039;&#039; How the e-mails will be displayed. Options are &amp;quot;As linkable mailto address&amp;quot; or as &amp;quot;Non-linkable text&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Content - Code Highlighter (GeSHi)===&lt;br /&gt;
This plug-in displays formatted code in Articles based on the GeSHi highlighting engine. &lt;br /&gt;
&lt;br /&gt;
NOTE: The Geshi plugin was removed from joomla standard distribution per 3.1 release it is no longer available by default (bug tracker #28574)&lt;br /&gt;
&lt;br /&gt;
Syntax highlighting per default joomla install supports: css diff html4strict ini mysql php php-brief xml.&lt;br /&gt;
It has a single option to turn on line numbers&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Syntax usage :&lt;br /&gt;
&amp;amp;lt;pre xml:lang=&amp;quot;php&amp;quot;&amp;amp;gt;&lt;br /&gt;
echo $test;&lt;br /&gt;
&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre xml:lang=&amp;quot;css&amp;quot; lines=&amp;quot;true&amp;quot;&amp;amp;gt;&lt;br /&gt;
.form-horizontal .control-group {&lt;br /&gt;
  margin-bottom: 10px;&lt;br /&gt;
}&lt;br /&gt;
&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The syntax highlighting language defaults to php and lines defaults to false. To turn on line numbering add lines= as in the usage example.&lt;br /&gt;
&lt;br /&gt;
Additional language bash, regular expressions etc can be downloaded &lt;br /&gt;
http://sourceforge.net/projects/geshi/?source=dlp&lt;br /&gt;
&lt;br /&gt;
The folder /geshi/geshi in the archive GeSHi-1.0.8.11.zip offers a large number of &amp;quot;highlighters&amp;quot; is available, copy the desired ones to \plugins\content\geshi\geshi\geshi on you server and use the file name as name for the syntax highlighting&lt;br /&gt;
&lt;br /&gt;
===Content - Load Modules===&lt;br /&gt;
This plug-in allows you to place a Module inside an Article with the syntax: {loadposition xx}, where &amp;quot;xx&amp;quot; is a user-defined position code. For example, if you create a Module with the Position value of &amp;quot;myposition1&amp;quot;, then typing the text &amp;quot;{loadposition myposition1}&amp;quot; inside an Article will cause that Module to show at that point in the Article.&lt;br /&gt;
&lt;br /&gt;
This plug-in has the following option:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-load-modules-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Style.&#039;&#039;&#039; The Style for the loaded Module.&lt;br /&gt;
&lt;br /&gt;
===Content - Pagebreak===&lt;br /&gt;
This plug-in adds table of contents functionality to a paginated Article. This is done automatically through the use of the Pagebreak button added to the lower part of the text panel in an Article. The HTML code is included here as a reference of what is available. The Pagebreak will itself display in the text window as a simple horizontal line.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Syntax: Usage: &amp;lt;hr class=&amp;quot;system-pagebreak&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;hr class=&amp;quot;system-pagebreak&amp;quot; title=&amp;quot;The page title&amp;quot; /&amp;gt; or&lt;br /&gt;
 &amp;lt;hr class=&amp;quot;system-pagebreak&amp;quot; alt=&amp;quot;The first page&amp;quot; /&amp;gt; or&lt;br /&gt;
 &amp;lt;hr class=&amp;quot;system-pagebreak&amp;quot; title=&amp;quot;The page title&amp;quot; alt=&amp;quot;The first page&amp;quot; /&amp;gt; or&lt;br /&gt;
 &amp;lt;hr class=&amp;quot;system-pagebreak&amp;quot; alt=&amp;quot;The first page&amp;quot; title=&amp;quot;The page title&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&lt;br /&gt;
This plug-in has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-pagebreak-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Show Site Title.&#039;&#039;&#039; Whether or not the title and heading attributes from the plug-in will be added to the Site Title tag.&lt;br /&gt;
*&#039;&#039;&#039;Table of Contents.&#039;&#039;&#039; Whether to Hide or Show a table of contents for multi-page Articles.&lt;br /&gt;
*&#039;&#039;&#039;Show all.&#039;&#039;&#039; Whether or not to give Users the option to show all pages of an Article.&lt;br /&gt;
&lt;br /&gt;
===Content - Page Navigation===&lt;br /&gt;
This plug-in allows you to add Next &amp;amp; Previous navigation links  to Articles, for example when using a blog or list layout. This feature can be controlled with the following Joomla! parameters:&lt;br /&gt;
*&amp;quot;Show Navigation&amp;quot; in the [[Help30:Content_Article_Manager#Global_Configuration|Article Manager - Global Configuration]] screen&lt;br /&gt;
*&amp;quot;Show Navigation&amp;quot; in the Parameters - Component section of the [[Help30:Menus_Menu_Item_Manager_Edit#Parameters_-_Component_for_Articles|Menu Item Manager - New/Edit - Parameters - Component for Articles]] screen for Article layouts.&lt;br /&gt;
Note that, if the Page Navigation plug-in is disabled in this screen, no Page Navigation will show and the parameter settings above will have no effect.&lt;br /&gt;
&lt;br /&gt;
This plug-in has the following option:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-page-navigation-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Position.&#039;&#039;&#039; Position of the navigation link. Options are &amp;quot;Above&amp;quot; the Article or &amp;quot;Below&amp;quot; the Article.&lt;br /&gt;
&lt;br /&gt;
===Content - Vote===&lt;br /&gt;
This plug-in adds the Voting functionality to Articles. It has no options.&lt;br /&gt;
&lt;br /&gt;
===Editor - CodeMirror===&lt;br /&gt;
This plug-in loads the CodeMirror editor. CodeMirror is a code editor which provides an editor more suited for source code. It provides code syntax highlighting for many programming languages. It can show you mismatched tags and also helps you maintain consistent indenting of your code. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-codemirror-options-screen.png]]&lt;br /&gt;
* &#039;&#039;&#039;List numbers.&#039;&#039;&#039; Display line numbers in the editor.&lt;br /&gt;
* &#039;&#039;&#039;Tab mode.&#039;&#039;&#039; Causes tab to adjust the indentation of the selection or current line using the current parser&#039;s rules&lt;br /&gt;
&lt;br /&gt;
===Editor - None===&lt;br /&gt;
This plug-in loads a basic text editor. This option can be used when you are pasting HTML code from another source and you don&#039;t want the HTML to be altered by a WYSIWYG editor. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===Editor - TinyMCE===&lt;br /&gt;
This plug-in loads the TinyMCE editor. This is the default editor in Joomla!.&lt;br /&gt;
 &lt;br /&gt;
[[Image:Help30-Extensions-Plugin-tinymce-options-screen.png]]&lt;br /&gt;
&lt;br /&gt;
This plug-in has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-tinymce-basic-options-subscreen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Functionality.&#039;&#039;&#039; Select &amp;quot;Advanced&amp;quot; or &amp;quot;Simple&amp;quot; functionality. With &amp;quot;Simple&amp;quot; selected, the User has only 9 toolbar buttons: Bold, Italic, Underline, Strikethrough, Undo, Re-do, Clean up messy code, Bullets, and Numbering. With &amp;quot;Advanced&amp;quot; selected, the User has all of the TinyMCE toolbar buttons. &amp;quot;Advanced&amp;quot; is the default setting.&lt;br /&gt;
*&#039;&#039;&#039;Skin.&#039;&#039;&#039; Choose the skin which will be applied to the TinyMCE editor when displayed in your website.&lt;br /&gt;
*&#039;&#039;&#039;Compressed version.&#039;&#039;&#039; Whether or not to use the compressed version of TinyMCE. Note that this does not work reliably with Windows IE, so &amp;quot;Off&amp;quot; is the recommended setting and is the default.&lt;br /&gt;
*&#039;&#039;&#039;Clean code on load.&#039;&#039; Whether or not to automatically clean up the HTML code when the editor first loads. Default value is &amp;quot;Off&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;Clean code on save.&#039;&#039;&#039; Whether to run HTML code cleanup when a file is saved. Options are &amp;quot;Never&amp;quot;, &amp;quot;Front Only&amp;quot;, and &amp;quot;Always&amp;quot;. The default setting is &amp;quot;Always&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;Entity Encoding.&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;Automatic Language Selection.&#039;&#039;&#039; Whether or not to match the selected UI language. Do not set to &amp;quot;Yes&amp;quot; unless the appropriate editor languages are installed. Default is &amp;quot;No&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;Language Code.&#039;&#039;&#039; Editor UI language code. This must be entered if Automatic Language Selection is &amp;quot;Off&amp;quot;. Default is &amp;quot;en&amp;quot; for British English.&lt;br /&gt;
*&#039;&#039;&#039;Text Direction.&#039;&#039;&#039; Whether the language reads &amp;quot;Left to Right&amp;quot; or &amp;quot;Right to Left&amp;quot; (for example, like Arabic). Default is &amp;quot;Left to Right&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;Template CSS classes.&#039;&#039;&#039; Whether or not to load the &amp;quot;editor.css&amp;quot; file. If no such file is found for the default template, the &amp;quot;editor.css&amp;quot; file from the system template is used. Default is &amp;quot;Yes&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;Custom CSS Classes.&#039;&#039;&#039; Optional full URL path to a custom CSS file. If entered, this overrides the Template CSS classes setting.&lt;br /&gt;
*&#039;&#039;&#039;URLs.&#039;&#039;&#039; Whether to use Relative or Absolute URLs for links. The default is &amp;quot;Relative&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;New Lines.&#039;&#039;&#039; Whether to interpret new lines as &amp;quot;P Elements&amp;quot; or &amp;quot;BR Elements&amp;quot;. Default is &amp;quot;P Elements&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;Prohibited Elements.&#039;&#039;&#039; The elements that will be cleaned from the text. Default is &amp;quot;applet&amp;quot;, which will remove applet elements from the text.&lt;br /&gt;
*&#039;&#039;&#039;Extended Valid Elements.&#039;&#039;&#039; Optional list of valid HTML elements to add to the existing rule set.&lt;br /&gt;
&lt;br /&gt;
This plug-in has the following advanced options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-tinymce-advanced-options-subscreen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Toolbar.&#039;&#039;&#039; Whether to show the toolbar above or below the editor window.&lt;br /&gt;
*&#039;&#039;&#039;Toolbar align.&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;HTML Height.&#039;&#039;&#039; The height, in pixels, of the HTML mode pop-up window.&lt;br /&gt;
*&#039;&#039;&#039;HTML Width.&#039;&#039;&#039; The width, in pixels, of the HTML mode pop-up window.&lt;br /&gt;
*&#039;&#039;&#039;Element Path.&#039;&#039;&#039; If set to &amp;quot;On&amp;quot;, show the &#039;Set Classes&#039; button for the marked text.&lt;br /&gt;
&lt;br /&gt;
The following options only apply if the editor is in Extended Mode.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Fonts.&#039;&#039;&#039; Hide or Show the &#039;Font&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Paste.&#039;&#039;&#039; Hide or Show the &#039;Paste&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Search-Replace.&#039;&#039;&#039; Hide or Show the &#039;Search and Replace&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Insert Date.&#039;&#039;&#039; Hide or Show the &#039;Insert Date&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Date Format.&#039;&#039;&#039; The Date format to use for Insert Date.&lt;br /&gt;
*&#039;&#039;&#039;Insert Time.&#039;&#039;&#039; Hide or Show the &#039;Insert Time&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Time Format.&#039;&#039;&#039; The Time format to use for Insert Time.&lt;br /&gt;
*&#039;&#039;&#039;Colors.&#039;&#039;&#039; Hide or Show the &#039;Colors&#039; control buttons.&lt;br /&gt;
*&#039;&#039;&#039;Table.&#039;&#039;&#039; Hide or Show the Table buttons.&lt;br /&gt;
*&#039;&#039;&#039;Smilies.&#039;&#039;&#039; Hide or Show the &#039;Smilies&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Media.&#039;&#039;&#039; Hide or Show the &#039;Media&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Horizontal Rule.&#039;&#039;&#039; Hide or Show the &#039;Horizontal Rule&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Directionality.&#039;&#039;&#039; Hide or Show the &#039;Directionality&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Fullscreen.&#039;&#039;&#039; Hide or Show the &#039;Fullscreen&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Style.&#039;&#039;&#039; Hide or Show the &#039;CSS Style&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Layer.&#039;&#039;&#039; Hide or Show the Layer buttons.&lt;br /&gt;
*&#039;&#039;&#039;XHTMLxtras.&#039;&#039;&#039; Hide or Show the additional XHTML features.&lt;br /&gt;
*&#039;&#039;&#039;Visualchars.&#039;&#039;&#039; Show invisible characters, specifically non-breaking spaces.&lt;br /&gt;
*&#039;&#039;&#039;Nonbreaking.&#039;&#039;&#039; Insert non-breaking space entities.&lt;br /&gt;
*&#039;&#039;&#039;Template.&#039;&#039;&#039; Hide or Show the &#039;Template&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Blockquote.&#039;&#039;&#039; Turn on/off block quotes.&lt;br /&gt;
*&#039;&#039;&#039;Wordcount.&#039;&#039;&#039; Turn on/off word count.&lt;br /&gt;
*&#039;&#039;&#039;Advanced image.&#039;&#039;&#039; Turn on/off a more advanced image dialog box.&lt;br /&gt;
*&#039;&#039;&#039;Advanced link.&#039;&#039;&#039; Turn on/off a more advanced link dialog box.&lt;br /&gt;
*&#039;&#039;&#039;Advanced List.&#039;&#039;&#039; Turn on/off the ability to set number formats and bullet types in ordered and unordered lists.&lt;br /&gt;
*&#039;&#039;&#039;Save Warning.&#039;&#039;&#039; Whether or not to give a warning if the User cancels without saving the file. The default value is &amp;quot;Off&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;Context menu.&#039;&#039;&#039; Turn on/off the context menu.&lt;br /&gt;
*&#039;&#039;&#039;Inline popups.&#039;&#039;&#039; Turn on/off dialogs opening as floating DIV layers instead of popup windows. This option is useful to allow getting around popup blockers.&lt;br /&gt;
*&#039;&#039;&#039;Custom plugin.&#039;&#039;&#039; Add custom TinyMCE plug-ins to the editor by specifying them here.&lt;br /&gt;
*&#039;&#039;&#039;Custom button.&#039;&#039;&#039; Add custom TinyMCE buttons to the editor by specifying them here.&lt;br /&gt;
&lt;br /&gt;
===Button - Article===&lt;br /&gt;
This plug-in displays the Article button below the editor box when you are using a Joomla! editor (for example, when writing an Article). It allows you to insert an Article link into an Article. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===Button - Image===&lt;br /&gt;
This plug-in displays the Image button below the editor box when you are using a Joomla! editor (for example, when writing an Article). It allows you to insert an image into an Article. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===Button - Pagebreak===&lt;br /&gt;
This plug-in displays the Pagebreak button below the editor box when you are using a Joomla! editor (for example, when writing an Article). It inserts a page break in the Article. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===Button - Readmore===&lt;br /&gt;
This plug-in displays the &amp;quot;Read more...&amp;quot; button below the editor box when you are using a Joomla! editor (for example, when writing an Article). It inserts a &amp;quot;Read more...&amp;quot; break in the Article that allows you to display just the first portion of an Article on a page. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===Extension - Joomla===&lt;br /&gt;
This plug-in manages the update sites for extensions. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===Search - Categories===&lt;br /&gt;
This plug-in enables searching for Category information. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-categories-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Search Limit.&#039;&#039;&#039; The maximum number of search results to return after a search is done.&lt;br /&gt;
*&#039;&#039;&#039;Search Published.&#039;&#039;&#039; Whether or not to include published items in the search results.&lt;br /&gt;
*&#039;&#039;&#039;Search Archived.&#039;&#039;&#039; Whether or not to include archived items in the search results.&lt;br /&gt;
&lt;br /&gt;
===Search - Contacts===&lt;br /&gt;
This plug-in enables searching for Contacts. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-contacts-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Search Limit.&#039;&#039;&#039; The maximum number of search results to return after a search is done.&lt;br /&gt;
*&#039;&#039;&#039;Search Published.&#039;&#039;&#039; Whether or not to include published items in the search results.&lt;br /&gt;
*&#039;&#039;&#039;Search Archived.&#039;&#039;&#039; Whether or not to include archived items in the search results.&lt;br /&gt;
&lt;br /&gt;
===Search - Content===&lt;br /&gt;
This plug-in enables searching for Articles. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-content-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Search Limit.&#039;&#039;&#039; The maximum number of search results to return after a search is done.&lt;br /&gt;
*&#039;&#039;&#039;Articles.&#039;&#039;&#039; Whether or not to enable searching of all articles.&lt;br /&gt;
*&#039;&#039;&#039;Archived Articles.&#039;&#039;&#039; Whether or not to include archived articles in the search results.&lt;br /&gt;
&lt;br /&gt;
===Search - Newsfeeds===&lt;br /&gt;
This plug-in enables searching for News Feeds. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-newsfeeds-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Search Limit.&#039;&#039;&#039; The maximum number of search results to return after a search is done.&lt;br /&gt;
*&#039;&#039;&#039;Search Published.&#039;&#039;&#039; Whether or not to include published items in the search results.&lt;br /&gt;
*&#039;&#039;&#039;Search Archived.&#039;&#039;&#039; Whether or not to include archived items in the search results.&lt;br /&gt;
&lt;br /&gt;
===Search - Weblinks===&lt;br /&gt;
This plug-in enables searching for Web Links. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-weblinks-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Search Limit.&#039;&#039;&#039; The maximum number of search results to return after a search is done.&lt;br /&gt;
*&#039;&#039;&#039;Search Published.&#039;&#039;&#039; Whether or not to include published items in the search results.&lt;br /&gt;
*&#039;&#039;&#039;Search Archived.&#039;&#039;&#039; Whether or not to include archived items in the search results.&lt;br /&gt;
&lt;br /&gt;
===System - Language Filter===&lt;br /&gt;
This plug-in filters the displayed content depending on language. It should only be enabled when the Language Switcher module is published. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===System - Cache===&lt;br /&gt;
This plug-in enables page caching. Page caching allows the web server to save snapshots of pages and use them when serving web pages. This improves the performance of your web site and reduces the workload of the server. This plug-in has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-cache-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Use Browser Caching.&#039;&#039;&#039; Whether or not to use the mechanism for storing a page cache in the local browser. Default is &amp;quot;No&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===System - Debug===&lt;br /&gt;
This plug-in provides debugging information. The report is shown below the main screen of the front and backend interfaces of your Joomla! installation. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-debug-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Allowed Groups.&#039;&#039;&#039; User groups that will see the debug information when enabled.&lt;br /&gt;
*&#039;&#039;&#039;Show Profiling&#039;&#039;&#039; Whether or not to display the profiling waypoints information.&lt;br /&gt;
*&#039;&#039;&#039;Show Queries.&#039;&#039;&#039; Whether or not to include the SQL query log in the debug information.&lt;br /&gt;
*&#039;&#039;&#039;Show Memory Usage.&#039;&#039;&#039; Whether or not to include memory usage data in the debug information.&lt;br /&gt;
&lt;br /&gt;
Language Debug Options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-debug-language-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Show errors when parsing language files.&#039;&#039;&#039; Whether or not to display a list of language files with errors due to their not being in compliance with the Joomla! language file specification.&lt;br /&gt;
*&#039;&#039;&#039;Show Language Files.&#039;&#039;&#039; Whether or not to display the language files that have been loaded to generate the page.&lt;br /&gt;
*&#039;&#039;&#039;Show Language String.&#039;&#039;&#039; Whether or not to include undefined language strings in the debug information.&lt;br /&gt;
*&#039;&#039;&#039;Strip First Word.&#039;&#039;&#039; Whether or not to always strip the first word in multi-word strings.&lt;br /&gt;
*&#039;&#039;&#039;Strip From Start.&#039;&#039;&#039; Strips the specified words from the beginning of the language string. For multiple words separate each word with the pipe ( &#039;&#039;|&#039;&#039; ) character like so: word1|word2&lt;br /&gt;
*&#039;&#039;&#039;Strip From End.&#039;&#039;&#039; Strips the specified words from the end of the language string. For multiple words separate each word with the pipe ( &#039;&#039;|&#039;&#039; ) character like so: word1|word2&lt;br /&gt;
&lt;br /&gt;
===System - Log===&lt;br /&gt;
This plug-in enables system logging. A log is a file that contains information about the web site activity. It can be used to see a history of activity and to troubleshoot problems on the site. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===System - Redirect===&lt;br /&gt;
This plug-in enables the Joomla! Redirect system to catch missing pages and redirect users. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===System - Remember Me===&lt;br /&gt;
This plug-in provides &amp;quot;Remember Me&amp;quot; functionality. This allows the website to &amp;quot;remember&amp;quot; your username and password so that you can automatically be logged in when you return to the site. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===System - SEF===&lt;br /&gt;
This plug-in adds SEF support to links in the document. It operates directly on the HTML and does not require a special tag. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===User - Profile===&lt;br /&gt;
This plug-in adds user profile capability to your website. Website users will be able to fill out profile fields that you enable in the options section of this plug-in. You can control what profile fields are shown in the new user registration form and/or each user&#039;s editable profile screen. To control what fields are shown in the new user registration form, set the field options in the section labeled &#039;&#039;User profile information required at registration&#039;&#039;. For profile fields shown in the user&#039;s profile screen which it editable after login, set the field option in the options section labeled &#039;&#039;Required user profile information&#039;&#039;. For each field you have the following options:&lt;br /&gt;
*&#039;&#039;&#039;Required.&#039;&#039;&#039; The field is visible in user profiles and users are required to fill it out.&lt;br /&gt;
*&#039;&#039;&#039;Optional.&#039;&#039;&#039; The field is visible in user profiles but is optional and users do not need to fill it out.&lt;br /&gt;
*&#039;&#039;&#039;Disabled.&#039;&#039;&#039; The field is disabled and not visible in user profiles.&lt;br /&gt;
 &lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-profile-options-screen.png]]&lt;br /&gt;
* All fields are text fields with the exception of the &#039;&#039;Terms of Service&#039;&#039; field. The &#039;&#039;Terms of Service&#039;&#039; field is a radio button that the user can click on to signify their agreement with the website&#039;s terms of service.&lt;br /&gt;
&lt;br /&gt;
===User - Contact Creator===&lt;br /&gt;
This plug-in automatically creates contact information for new users. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-contact_creator-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Automatic Webpage.&#039;&#039;&#039; A formatted string to automatically generate a contact&#039;s web page. [name] is replaced with the name, [username] is replaced with the username, [userid] is replaced with the user ID and [email] is replaced with the email.&lt;br /&gt;
*&#039;&#039;&#039;Category.&#039;&#039;&#039; Category to assign contacts to by default.&lt;br /&gt;
*&#039;&#039;&#039;Autopublish the contact.&#039;&#039;&#039; Optionally have the automatically created contact set to the published state and visible to your website visitors.&lt;br /&gt;
&lt;br /&gt;
===User - Joomla!===&lt;br /&gt;
This plug-in handles the default user synchronization. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-joomla-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Auto-create Users.&#039;&#039;&#039; Whether or not to automatically create registered Joomla! users where possible. Default is &amp;quot;Yes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Quick Tips==&lt;br /&gt;
*If you are using the TinyMCE editor, you can control which options appear on the editor&#039;s toolbar by setting the parameters in the &amp;quot;Editor - TinyMCE&amp;quot; plug-in.&lt;br /&gt;
*Starting with Joomla! 1.6, configurable plug-in settings are referred to as &#039;options&#039;. In previous versions of Joomla! these configurable settings were referred to as &#039;parameters&#039;. You may see the terms &#039;options&#039; and &#039;parameters&#039; used interchangeably in help documentation and tutorials you encounter.&lt;br /&gt;
&lt;br /&gt;
==Related Information==&lt;br /&gt;
*To install new Plug-in Extensions: [[Help30:Extensions_Extension_Manager_Install|Extension Manager - Install Screen]]&lt;br /&gt;
*To uninstall third-party Plug-ins: [[Help30:Extensions_Extension_Manager_Manage|Extension Manager - Manage]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{cathelp|3.0,3.1,3.2,3.3|Plugin Manager Help Screens|Extensions Help Screens}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Help310:Extensions_Plugin_Manager_Edit&amp;diff=128831</id>
		<title>Help310:Extensions Plugin Manager Edit</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Help310:Extensions_Plugin_Manager_Edit&amp;diff=128831"/>
		<updated>2014-10-21T13:35:58Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: /* Authentication - GMail */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==How to Access==&lt;br /&gt;
Navigate to the [[Help30:Extensions_Plugin_Manager|Plug-in Manager]]. Click on the Plug-in&#039;s Name or click on the Plug-in&#039;s checkbox and press the Edit button in the toolbar.&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
This screen allows you to edit the details and options for plug-ins. Some plug-ins have several configurable options, while others may not have any.&lt;br /&gt;
&lt;br /&gt;
==Screenshot==&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-screen.png]]&lt;br /&gt;
&lt;br /&gt;
==Details==&lt;br /&gt;
The Details section is the same for all plug-ins and has the following fields:&lt;br /&gt;
*&#039;&#039;&#039;Plug-in Name.&#039;&#039;&#039; The Name of the Plug-in.&lt;br /&gt;
*&#039;&#039;&#039;Enabled.&#039;&#039;&#039; Whether or not this Plug-in is enabled.&lt;br /&gt;
*&#039;&#039;&#039;Access.&#039;&#039;&#039; Which user &#039;access levels&#039; have access to this item. You can change an item&#039;s Access Level by clicking on its name to open it up for editing. The default user &#039;access levels&#039; which come preconfigured with Joomla! are:&lt;br /&gt;
** Public: Everyone has access including website visitors who have not logged in&lt;br /&gt;
** Registered: Only users with registered status or higher will have access&lt;br /&gt;
** Special: Only users with author status or higher have access&lt;br /&gt;
*&#039;&#039;&#039;Ordering.&#039;&#039;&#039; A drop-down list of plug-ins of the same Type. The list of plug-ins is arranged by their current order. You can change this plug-in&#039;s order in relation to the other plug-ins by selecting the plug-in in the drop-down list that you want this plug-in to be ordered below.&lt;br /&gt;
*&#039;&#039;&#039;Plug-in Type.&#039;&#039;&#039; The Type of the Plug-in. This value cannot be changed.&lt;br /&gt;
*&#039;&#039;&#039;Plug-in File.&#039;&#039;&#039; The name of the Plug-in file. Each Plug-in has two files with this name. One has the file extension &#039;.php&#039; and the other has the file extension &#039;.xml&#039;.&lt;br /&gt;
*&#039;&#039;&#039;ID.&#039;&#039;&#039; The Plug-in&#039;s ID number. This is a unique identification number for this item assigned automatically by Joomla!. It is used to identify the item internally, for example in internal links. You cannot change this number.&lt;br /&gt;
*&#039;&#039;&#039;Description.&#039;&#039;&#039; The description of what this Plug-in does. This cannot be changed. The developer of the plug-in specifies this. This may be blank if the developer did not specify a description for the plug-in.&lt;br /&gt;
&lt;br /&gt;
==Options==&lt;br /&gt;
If the plug-in has configurable options they will appear to the right of the details section. Usually you will see &#039;&#039;Basic Options&#039;&#039; which are general options which need to be configured for the basic operation of the plug-in. You may also see &#039;&#039;Advanced Options&#039;&#039; which are additional configurable options available for the plug-in which allows further customization of the plug-in. Finally you may see &#039;&#039;Language Options&#039;&#039; which are options related to the language functions of your Joomla! installation.&lt;br /&gt;
&lt;br /&gt;
==Toolbar==&lt;br /&gt;
At the top right you will see the toolbar:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Save-SaveClose-Close-Help-toolbar.png]]&lt;br /&gt;
&lt;br /&gt;
The functions are:&lt;br /&gt;
{{Chunk30:Help_screen_toolbar_icon_Save|plug-in}}&lt;br /&gt;
{{Chunk30:Help_screen_toolbar_icon_SaveAndClose|plug-in}}&lt;br /&gt;
{{Chunk30:Help_screen_toolbar_icon_Cancel}}&lt;br /&gt;
{{Chunk30:Help_screen_toolbar_icon_Help}}&lt;br /&gt;
&lt;br /&gt;
==Plug-in Descriptions and Options==&lt;br /&gt;
When Joomla! is installed, many plug-ins are included in the installation. These are described below, along with any options for the plug-in.&lt;br /&gt;
&lt;br /&gt;
===Authentication - Joomla===&lt;br /&gt;
This plug-in processes the default User Authentication method in Joomla!. It has no options.&lt;br /&gt;
&lt;br /&gt;
===Authentication - GMail===&lt;br /&gt;
This plug-in processes User Authentication using GMail accounts. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-gmail-options-screen.png]]&lt;br /&gt;
* &#039;&#039;&#039;Apply Username Suffix.&#039;&#039;&#039; This options allows you to automatically apply a suffix to the username a person enters when they log into your Joomla! installation. The suffix is the portion of the email address after the &#039;&#039;@&#039;&#039; symbol.&lt;br /&gt;
* &#039;&#039;&#039;Username Suffix.&#039;&#039;&#039; This is the suffix portion of the GMail email addresses which will be used to log into your site. This is the portion of the mail address after the &#039;&#039;@&#039;&#039; symbol. Usually you will set this to &#039;&#039;gmail.com&#039;&#039; for regular GMail accounts. This option is present to allow you to use other GMail accounts that don&#039;t end in the typical &#039;&#039;gmail.com&#039;&#039; suffix. This would be the case with Google Apps for Domains email accounts.&lt;br /&gt;
* &#039;&#039;&#039;Verify Peer.&#039;&#039;&#039; When your Joomla! installation attempts to verify the entered Gmail username it does so over an SSL connection. This option configures whether or not your Joomla! installation will check to ensure the CA certificate of the SSL connection is valid before proceeding with verification of the entered username/password. In some situations certificate verification fails in which case you can try setting this option to &#039;&#039;No&#039;&#039; to try to fix this.&lt;br /&gt;
* &#039;&#039;&#039;User Blacklist.&#039;&#039;&#039; A comma separated list of usernames not allowed to log into your Joomla! installation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To use the GMail plug-in:&#039;&#039;&#039;&lt;br /&gt;
* Create a Joomla! user account with the same username as a GMail account user. For example if the GMail email address of the person you want to add is bob1234@gmail.com you would create the Joomla! user account with the username &#039;&#039;bob1234&#039;&#039;.&lt;br /&gt;
* Enable the GMail Plug-in.&lt;br /&gt;
* Logout of Joomla!.&lt;br /&gt;
* Login using the GMail username (without &amp;quot;@gmail.com&amp;quot;) and the GMail password.&lt;br /&gt;
&lt;br /&gt;
NOTE: Google may block these sign in attempts due to increased security checks by Google. To resolve this issue, the user may need to go to [https://www.google.com/settings/security/lesssecureapps Allow less secure apps] and choose &amp;quot;Allow&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Authentication - LDAP===&lt;br /&gt;
This plug-in processes User Authentication against an LDAP server. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-ldap-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Host.&#039;&#039;&#039; The host URL. For example, &amp;quot;openldap.mycompany.org&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;Port.&#039;&#039;&#039; The port number. The default is 389.&lt;br /&gt;
*&#039;&#039;&#039;LDAP V3.&#039;&#039;&#039; Whether or not this host uses LDAP version 3. The default is LDAP v2.&lt;br /&gt;
*&#039;&#039;&#039;Negotiate TLS.&#039;&#039;&#039; Whether or not to use TLS encryption with this host. If set to &amp;quot;Yes&amp;quot;, all traffic to and from this server must be encrypted.&lt;br /&gt;
*&#039;&#039;&#039;Follow Referrals.&#039;&#039;&#039; Whether to set the LDAP_OPT_REFERRALS flag to Yes or No. For Windows 2003 hosts this must be set to No.&lt;br /&gt;
*&#039;&#039;&#039;Authorization Method.&#039;&#039;&#039; &amp;quot;Bind Directly as User&amp;quot; or &amp;quot;Bind and Search&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;Base DN.&#039;&#039;&#039; The Base DN of your LDAP server.&lt;br /&gt;
*&#039;&#039;&#039;Search String.&#039;&#039;&#039; A query string used to search for a given User. The [search] keyword is replaced by the login typed by the User. For example: &amp;quot;uid=[search]&amp;quot;. More than one Search String can be entered. Separate each by a semi-colon &amp;quot;;&amp;quot; character. This is only used when searching.&lt;br /&gt;
*&#039;&#039;&#039;User&#039;s DN.&#039;&#039;&#039; The [username] keyword is dynamically replaced by the username typed by the User. An example string is: &amp;quot;uid=[username], dc=[my-domain], dc=[com]&amp;quot;. More than one string can be entered. Separate each with a semi-colon &amp;quot;;&amp;quot; character. This is only used if the Authorization Method above is set to &amp;quot;Bind Directly as User&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;Connect Username and Connect Password.&#039;&#039;&#039; These define connection parameters for the DN lookup phase. For anonymous lookup, leave both of these fields blank. For an Administrative Connection, the &amp;quot;Connect Username&amp;quot; is the username of an administrative account (for example, &amp;quot;Administrator&amp;quot;). In this case, the &amp;quot;Connect password&amp;quot; is the actual password to this administrative account.&lt;br /&gt;
*&#039;&#039;&#039;Map: Full Name.&#039;&#039;&#039; The LDAP attribute that contains the User&#039;s full name.&lt;br /&gt;
*&#039;&#039;&#039;Map: E-mail.&#039;&#039;&#039; The LDAP attribute that contains the User&#039;s e-mail address.&lt;br /&gt;
*&#039;&#039;&#039;Map: User ID.&#039;&#039;&#039; The LDAP attribute that contains the User&#039;s login ID. For Active Directory, this is &amp;quot;sAMAccountName&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Authentication - OpenID===&lt;br /&gt;
This Plugin processes user authentication with an OpenID. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-openid-options-screen.png]]&lt;br /&gt;
* &#039;&#039;&#039;Convert Old Usernames.&#039;&#039;&#039; Convert old usernames to the proper OpenID format. Set this to &#039;&#039;Yes&#039;&#039; if you upgraded your Joomla! installation from one that was already using OpenID authentication.&lt;br /&gt;
* &#039;&#039;&#039;Require Policy phishing-resistant.&#039;&#039;&#039; Requires the OpenID Provider to be configured with the OpenID Provider Authentication Policy Extension &#039;&#039;Phishing-Resistant Authentication&#039;&#039; policy.&lt;br /&gt;
* &#039;&#039;&#039;Require Policy multi-factor.&#039;&#039;&#039; Requires the OpenID Provider to be configured with the OpenID Provider Authentication Policy Extension &#039;&#039;Multi-Factor Authentication&#039;&#039; policy.&lt;br /&gt;
* &#039;&#039;&#039;Require Policy multi-factor-physical.&#039;&#039;&#039; Requires the OpenID Provider to be configured with the OpenID Provider Authentication Policy Extension &#039;&#039;Physical Multi-Factor Authentication&#039;&#039; policy.&lt;br /&gt;
&lt;br /&gt;
===Captcha - ReCaptcha===&lt;br /&gt;
This CAPTCHA plugin uses the reCAPTCHA service to prevent spammers while it helps to digitize books, newspapers and old radio shows. The fields &amp;quot;Public Key&amp;quot; and &amp;quot;Private Key&amp;quot; must be filled in before activating.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Public Key&#039;&#039;&#039; Used in the JavaScript code that is served to your users.&lt;br /&gt;
* &#039;&#039;&#039;Private Key&#039;&#039;&#039; Used in the communication between your server and the ReCaptha server. Be sure to keep it a secret.&lt;br /&gt;
* &#039;&#039;&#039;Theme&#039;&#039;&#039; Defines which theme to use for ReCaptcha.&lt;br /&gt;
&lt;br /&gt;
===Content - Email Cloaking===&lt;br /&gt;
This plug-in cloaks all e-mails in content from spambots using JavaScript. This helps prevent e-mails contained in articles from being added to spam e-mail lists. You can disable Email Cloaking inside an article by inserting &amp;lt;code&amp;gt;{emailcloak=off}&amp;lt;/code&amp;gt; anywhere in the text of the article. In this case, no e-mail addresses in the article will be cloaked by this plug-in.&lt;br /&gt;
&lt;br /&gt;
Email Cloaking has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-email-cloaking-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Mode.&#039;&#039;&#039; How the e-mails will be displayed. Options are &amp;quot;As linkable mailto address&amp;quot; or as &amp;quot;Non-linkable text&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Content - Code Highlighter (GeSHi)===&lt;br /&gt;
This plug-in displays formatted code in Articles based on the GeSHi highlighting engine. &lt;br /&gt;
&lt;br /&gt;
NOTE: The Geshi plugin was removed from joomla standard distribution per 3.1 release it is no longer available by default (bug tracker #28574)&lt;br /&gt;
&lt;br /&gt;
Syntax highlighting per default joomla install supports: css diff html4strict ini mysql php php-brief xml.&lt;br /&gt;
It has a single option to turn on line numbers&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Syntax usage :&lt;br /&gt;
&amp;amp;lt;pre xml:lang=&amp;quot;php&amp;quot;&amp;amp;gt;&lt;br /&gt;
echo $test;&lt;br /&gt;
&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre xml:lang=&amp;quot;css&amp;quot; lines=&amp;quot;true&amp;quot;&amp;amp;gt;&lt;br /&gt;
.form-horizontal .control-group {&lt;br /&gt;
  margin-bottom: 10px;&lt;br /&gt;
}&lt;br /&gt;
&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The syntax highlighting language defaults to php and lines defaults to false. To turn on line numbering add lines= as in the usage example.&lt;br /&gt;
&lt;br /&gt;
Additional language bash, regular expressions etc can be downloaded &lt;br /&gt;
http://sourceforge.net/projects/geshi/?source=dlp&lt;br /&gt;
&lt;br /&gt;
The folder /geshi/geshi in the archive GeSHi-1.0.8.11.zip offers a large number of &amp;quot;highlighters&amp;quot; is available, copy the desired ones to \plugins\content\geshi\geshi\geshi on you server and use the file name as name for the syntax highlighting&lt;br /&gt;
&lt;br /&gt;
===Content - Load Modules===&lt;br /&gt;
This plug-in allows you to place a Module inside an Article with the syntax: {loadposition xx}, where &amp;quot;xx&amp;quot; is a user-defined position code. For example, if you create a Module with the Position value of &amp;quot;myposition1&amp;quot;, then typing the text &amp;quot;{loadposition myposition1}&amp;quot; inside an Article will cause that Module to show at that point in the Article.&lt;br /&gt;
&lt;br /&gt;
This plug-in has the following option:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-load-modules-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Style.&#039;&#039;&#039; The Style for the loaded Module.&lt;br /&gt;
&lt;br /&gt;
===Content - Pagebreak===&lt;br /&gt;
This plug-in adds table of contents functionality to a paginated Article. This is done automatically through the use of the Pagebreak button added to the lower part of the text panel in an Article. The HTML code is included here as a reference of what is available. The Pagebreak will itself display in the text window as a simple horizontal line.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Syntax: Usage: &amp;lt;hr class=&amp;quot;system-pagebreak&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;hr class=&amp;quot;system-pagebreak&amp;quot; title=&amp;quot;The page title&amp;quot; /&amp;gt; or&lt;br /&gt;
 &amp;lt;hr class=&amp;quot;system-pagebreak&amp;quot; alt=&amp;quot;The first page&amp;quot; /&amp;gt; or&lt;br /&gt;
 &amp;lt;hr class=&amp;quot;system-pagebreak&amp;quot; title=&amp;quot;The page title&amp;quot; alt=&amp;quot;The first page&amp;quot; /&amp;gt; or&lt;br /&gt;
 &amp;lt;hr class=&amp;quot;system-pagebreak&amp;quot; alt=&amp;quot;The first page&amp;quot; title=&amp;quot;The page title&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&lt;br /&gt;
This plug-in has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-pagebreak-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Show Site Title.&#039;&#039;&#039; Whether or not the title and heading attributes from the plug-in will be added to the Site Title tag.&lt;br /&gt;
*&#039;&#039;&#039;Table of Contents.&#039;&#039;&#039; Whether to Hide or Show a table of contents for multi-page Articles.&lt;br /&gt;
*&#039;&#039;&#039;Show all.&#039;&#039;&#039; Whether or not to give Users the option to show all pages of an Article.&lt;br /&gt;
&lt;br /&gt;
===Content - Page Navigation===&lt;br /&gt;
This plug-in allows you to add Next &amp;amp; Previous navigation links  to Articles, for example when using a blog or list layout. This feature can be controlled with the following Joomla! parameters:&lt;br /&gt;
*&amp;quot;Show Navigation&amp;quot; in the [[Help30:Content_Article_Manager#Global_Configuration|Article Manager - Global Configuration]] screen&lt;br /&gt;
*&amp;quot;Show Navigation&amp;quot; in the Parameters - Component section of the [[Help30:Menus_Menu_Item_Manager_Edit#Parameters_-_Component_for_Articles|Menu Item Manager - New/Edit - Parameters - Component for Articles]] screen for Article layouts.&lt;br /&gt;
Note that, if the Page Navigation plug-in is disabled in this screen, no Page Navigation will show and the parameter settings above will have no effect.&lt;br /&gt;
&lt;br /&gt;
This plug-in has the following option:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-page-navigation-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Position.&#039;&#039;&#039; Position of the navigation link. Options are &amp;quot;Above&amp;quot; the Article or &amp;quot;Below&amp;quot; the Article.&lt;br /&gt;
&lt;br /&gt;
===Content - Vote===&lt;br /&gt;
This plug-in adds the Voting functionality to Articles. It has no options.&lt;br /&gt;
&lt;br /&gt;
===Editor - CodeMirror===&lt;br /&gt;
This plug-in loads the CodeMirror editor. CodeMirror is a code editor which provides an editor more suited for source code. It provides code syntax highlighting for many programming languages. It can show you mismatched tags and also helps you maintain consistent indenting of your code. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-codemirror-options-screen.png]]&lt;br /&gt;
* &#039;&#039;&#039;List numbers.&#039;&#039;&#039; Display line numbers in the editor.&lt;br /&gt;
* &#039;&#039;&#039;Tab mode.&#039;&#039;&#039; Causes tab to adjust the indentation of the selection or current line using the current parser&#039;s rules&lt;br /&gt;
&lt;br /&gt;
===Editor - None===&lt;br /&gt;
This plug-in loads a basic text editor. This option can be used when you are pasting HTML code from another source and you don&#039;t want the HTML to be altered by a WYSIWYG editor. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===Editor - TinyMCE===&lt;br /&gt;
This plug-in loads the TinyMCE editor. This is the default editor in Joomla!.&lt;br /&gt;
 &lt;br /&gt;
[[Image:Help30-Extensions-Plugin-tinymce-options-screen.png]]&lt;br /&gt;
&lt;br /&gt;
This plug-in has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-tinymce-basic-options-subscreen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Functionality.&#039;&#039;&#039; Select &amp;quot;Advanced&amp;quot; or &amp;quot;Simple&amp;quot; functionality. With &amp;quot;Simple&amp;quot; selected, the User has only 9 toolbar buttons: Bold, Italic, Underline, Strikethrough, Undo, Re-do, Clean up messy code, Bullets, and Numbering. With &amp;quot;Advanced&amp;quot; selected, the User has all of the TinyMCE toolbar buttons. &amp;quot;Advanced&amp;quot; is the default setting.&lt;br /&gt;
*&#039;&#039;&#039;Skin.&#039;&#039;&#039; Choose the skin which will be applied to the TinyMCE editor when displayed in your website.&lt;br /&gt;
*&#039;&#039;&#039;Compressed version.&#039;&#039;&#039; Whether or not to use the compressed version of TinyMCE. Note that this does not work reliably with Windows IE, so &amp;quot;Off&amp;quot; is the recommended setting and is the default.&lt;br /&gt;
*&#039;&#039;&#039;Clean code on load.&#039;&#039; Whether or not to automatically clean up the HTML code when the editor first loads. Default value is &amp;quot;Off&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;Clean code on save.&#039;&#039;&#039; Whether to run HTML code cleanup when a file is saved. Options are &amp;quot;Never&amp;quot;, &amp;quot;Front Only&amp;quot;, and &amp;quot;Always&amp;quot;. The default setting is &amp;quot;Always&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;Entity Encoding.&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;Automatic Language Selection.&#039;&#039;&#039; Whether or not to match the selected UI language. Do not set to &amp;quot;Yes&amp;quot; unless the appropriate editor languages are installed. Default is &amp;quot;No&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;Language Code.&#039;&#039;&#039; Editor UI language code. This must be entered if Automatic Language Selection is &amp;quot;Off&amp;quot;. Default is &amp;quot;en&amp;quot; for British English.&lt;br /&gt;
*&#039;&#039;&#039;Text Direction.&#039;&#039;&#039; Whether the language reads &amp;quot;Left to Right&amp;quot; or &amp;quot;Right to Left&amp;quot; (for example, like Arabic). Default is &amp;quot;Left to Right&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;Template CSS classes.&#039;&#039;&#039; Whether or not to load the &amp;quot;editor.css&amp;quot; file. If no such file is found for the default template, the &amp;quot;editor.css&amp;quot; file from the system template is used. Default is &amp;quot;Yes&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;Custom CSS Classes.&#039;&#039;&#039; Optional full URL path to a custom CSS file. If entered, this overrides the Template CSS classes setting.&lt;br /&gt;
*&#039;&#039;&#039;URLs.&#039;&#039;&#039; Whether to use Relative or Absolute URLs for links. The default is &amp;quot;Relative&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;New Lines.&#039;&#039;&#039; Whether to interpret new lines as &amp;quot;P Elements&amp;quot; or &amp;quot;BR Elements&amp;quot;. Default is &amp;quot;P Elements&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;Prohibited Elements.&#039;&#039;&#039; The elements that will be cleaned from the text. Default is &amp;quot;applet&amp;quot;, which will remove applet elements from the text.&lt;br /&gt;
*&#039;&#039;&#039;Extended Valid Elements.&#039;&#039;&#039; Optional list of valid HTML elements to add to the existing rule set.&lt;br /&gt;
&lt;br /&gt;
This plug-in has the following advanced options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-tinymce-advanced-options-subscreen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Toolbar.&#039;&#039;&#039; Whether to show the toolbar above or below the editor window.&lt;br /&gt;
*&#039;&#039;&#039;Toolbar align.&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;HTML Height.&#039;&#039;&#039; The height, in pixels, of the HTML mode pop-up window.&lt;br /&gt;
*&#039;&#039;&#039;HTML Width.&#039;&#039;&#039; The width, in pixels, of the HTML mode pop-up window.&lt;br /&gt;
*&#039;&#039;&#039;Element Path.&#039;&#039;&#039; If set to &amp;quot;On&amp;quot;, show the &#039;Set Classes&#039; button for the marked text.&lt;br /&gt;
&lt;br /&gt;
The following options only apply if the editor is in Extended Mode.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Fonts.&#039;&#039;&#039; Hide or Show the &#039;Font&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Paste.&#039;&#039;&#039; Hide or Show the &#039;Paste&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Search-Replace.&#039;&#039;&#039; Hide or Show the &#039;Search and Replace&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Insert Date.&#039;&#039;&#039; Hide or Show the &#039;Insert Date&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Date Format.&#039;&#039;&#039; The Date format to use for Insert Date.&lt;br /&gt;
*&#039;&#039;&#039;Insert Time.&#039;&#039;&#039; Hide or Show the &#039;Insert Time&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Time Format.&#039;&#039;&#039; The Time format to use for Insert Time.&lt;br /&gt;
*&#039;&#039;&#039;Colors.&#039;&#039;&#039; Hide or Show the &#039;Colors&#039; control buttons.&lt;br /&gt;
*&#039;&#039;&#039;Table.&#039;&#039;&#039; Hide or Show the Table buttons.&lt;br /&gt;
*&#039;&#039;&#039;Smilies.&#039;&#039;&#039; Hide or Show the &#039;Smilies&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Media.&#039;&#039;&#039; Hide or Show the &#039;Media&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Horizontal Rule.&#039;&#039;&#039; Hide or Show the &#039;Horizontal Rule&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Directionality.&#039;&#039;&#039; Hide or Show the &#039;Directionality&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Fullscreen.&#039;&#039;&#039; Hide or Show the &#039;Fullscreen&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Style.&#039;&#039;&#039; Hide or Show the &#039;CSS Style&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Layer.&#039;&#039;&#039; Hide or Show the Layer buttons.&lt;br /&gt;
*&#039;&#039;&#039;XHTMLxtras.&#039;&#039;&#039; Hide or Show the additional XHTML features.&lt;br /&gt;
*&#039;&#039;&#039;Visualchars.&#039;&#039;&#039; Show invisible characters, specifically non-breaking spaces.&lt;br /&gt;
*&#039;&#039;&#039;Nonbreaking.&#039;&#039;&#039; Insert non-breaking space entities.&lt;br /&gt;
*&#039;&#039;&#039;Template.&#039;&#039;&#039; Hide or Show the &#039;Template&#039; button.&lt;br /&gt;
*&#039;&#039;&#039;Blockquote.&#039;&#039;&#039; Turn on/off block quotes.&lt;br /&gt;
*&#039;&#039;&#039;Wordcount.&#039;&#039;&#039; Turn on/off word count.&lt;br /&gt;
*&#039;&#039;&#039;Advanced image.&#039;&#039;&#039; Turn on/off a more advanced image dialog box.&lt;br /&gt;
*&#039;&#039;&#039;Advanced link.&#039;&#039;&#039; Turn on/off a more advanced link dialog box.&lt;br /&gt;
*&#039;&#039;&#039;Advanced List.&#039;&#039;&#039; Turn on/off the ability to set number formats and bullet types in ordered and unordered lists.&lt;br /&gt;
*&#039;&#039;&#039;Save Warning.&#039;&#039;&#039; Whether or not to give a warning if the User cancels without saving the file. The default value is &amp;quot;Off&amp;quot;.&lt;br /&gt;
*&#039;&#039;&#039;Context menu.&#039;&#039;&#039; Turn on/off the context menu.&lt;br /&gt;
*&#039;&#039;&#039;Inline popups.&#039;&#039;&#039; Turn on/off dialogs opening as floating DIV layers instead of popup windows. This option is useful to allow getting around popup blockers.&lt;br /&gt;
*&#039;&#039;&#039;Custom plugin.&#039;&#039;&#039; Add custom TinyMCE plug-ins to the editor by specifying them here.&lt;br /&gt;
*&#039;&#039;&#039;Custom button.&#039;&#039;&#039; Add custom TinyMCE buttons to the editor by specifying them here.&lt;br /&gt;
&lt;br /&gt;
===Button - Article===&lt;br /&gt;
This plug-in displays the Article button below the editor box when you are using a Joomla! editor (for example, when writing an Article). It allows you to insert an Article link into an Article. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===Button - Image===&lt;br /&gt;
This plug-in displays the Image button below the editor box when you are using a Joomla! editor (for example, when writing an Article). It allows you to insert an image into an Article. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===Button - Pagebreak===&lt;br /&gt;
This plug-in displays the Pagebreak button below the editor box when you are using a Joomla! editor (for example, when writing an Article). It inserts a page break in the Article. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===Button - Readmore===&lt;br /&gt;
This plug-in displays the &amp;quot;Read more...&amp;quot; button below the editor box when you are using a Joomla! editor (for example, when writing an Article). It inserts a &amp;quot;Read more...&amp;quot; break in the Article that allows you to display just the first portion of an Article on a page. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===Extension - Joomla===&lt;br /&gt;
This plug-in manages the update sites for extensions. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===Search - Categories===&lt;br /&gt;
This plug-in enables searching for Category information. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-categories-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Search Limit.&#039;&#039;&#039; The maximum number of search results to return after a search is done.&lt;br /&gt;
*&#039;&#039;&#039;Search Published.&#039;&#039;&#039; Whether or not to include published items in the search results.&lt;br /&gt;
*&#039;&#039;&#039;Search Archived.&#039;&#039;&#039; Whether or not to include archived items in the search results.&lt;br /&gt;
&lt;br /&gt;
===Search - Contacts===&lt;br /&gt;
This plug-in enables searching for Contacts. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-contacts-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Search Limit.&#039;&#039;&#039; The maximum number of search results to return after a search is done.&lt;br /&gt;
*&#039;&#039;&#039;Search Published.&#039;&#039;&#039; Whether or not to include published items in the search results.&lt;br /&gt;
*&#039;&#039;&#039;Search Archived.&#039;&#039;&#039; Whether or not to include archived items in the search results.&lt;br /&gt;
&lt;br /&gt;
===Search - Content===&lt;br /&gt;
This plug-in enables searching for Articles. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-content-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Search Limit.&#039;&#039;&#039; The maximum number of search results to return after a search is done.&lt;br /&gt;
*&#039;&#039;&#039;Articles.&#039;&#039;&#039; Whether or not to enable searching of all articles.&lt;br /&gt;
*&#039;&#039;&#039;Archived Articles.&#039;&#039;&#039; Whether or not to include archived articles in the search results.&lt;br /&gt;
&lt;br /&gt;
===Search - Newsfeeds===&lt;br /&gt;
This plug-in enables searching for News Feeds. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-newsfeeds-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Search Limit.&#039;&#039;&#039; The maximum number of search results to return after a search is done.&lt;br /&gt;
*&#039;&#039;&#039;Search Published.&#039;&#039;&#039; Whether or not to include published items in the search results.&lt;br /&gt;
*&#039;&#039;&#039;Search Archived.&#039;&#039;&#039; Whether or not to include archived items in the search results.&lt;br /&gt;
&lt;br /&gt;
===Search - Weblinks===&lt;br /&gt;
This plug-in enables searching for Web Links. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-weblinks-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Search Limit.&#039;&#039;&#039; The maximum number of search results to return after a search is done.&lt;br /&gt;
*&#039;&#039;&#039;Search Published.&#039;&#039;&#039; Whether or not to include published items in the search results.&lt;br /&gt;
*&#039;&#039;&#039;Search Archived.&#039;&#039;&#039; Whether or not to include archived items in the search results.&lt;br /&gt;
&lt;br /&gt;
===System - Language Filter===&lt;br /&gt;
This plug-in filters the displayed content depending on language. It should only be enabled when the Language Switcher module is published. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===System - Cache===&lt;br /&gt;
This plug-in enables page caching. Page caching allows the web server to save snapshots of pages and use them when serving web pages. This improves the performance of your web site and reduces the workload of the server. This plug-in has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-cache-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Use Browser Caching.&#039;&#039;&#039; Whether or not to use the mechanism for storing a page cache in the local browser. Default is &amp;quot;No&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===System - Debug===&lt;br /&gt;
This plug-in provides debugging information. The report is shown below the main screen of the front and backend interfaces of your Joomla! installation. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-debug-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Allowed Groups.&#039;&#039;&#039; User groups that will see the debug information when enabled.&lt;br /&gt;
*&#039;&#039;&#039;Show Profiling&#039;&#039;&#039; Whether or not to display the profiling waypoints information.&lt;br /&gt;
*&#039;&#039;&#039;Show Queries.&#039;&#039;&#039; Whether or not to include the SQL query log in the debug information.&lt;br /&gt;
*&#039;&#039;&#039;Show Memory Usage.&#039;&#039;&#039; Whether or not to include memory usage data in the debug information.&lt;br /&gt;
&lt;br /&gt;
Language Debug Options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-debug-language-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Show errors when parsing language files.&#039;&#039;&#039; Whether or not to display a list of language files with errors due to their not being in compliance with the Joomla! language file specification.&lt;br /&gt;
*&#039;&#039;&#039;Show Language Files.&#039;&#039;&#039; Whether or not to display the language files that have been loaded to generate the page.&lt;br /&gt;
*&#039;&#039;&#039;Show Language String.&#039;&#039;&#039; Whether or not to include undefined language strings in the debug information.&lt;br /&gt;
*&#039;&#039;&#039;Strip First Word.&#039;&#039;&#039; Whether or not to always strip the first word in multi-word strings.&lt;br /&gt;
*&#039;&#039;&#039;Strip From Start.&#039;&#039;&#039; Strips the specified words from the beginning of the language string. For multiple words separate each word with the pipe ( &#039;&#039;|&#039;&#039; ) character like so: word1|word2&lt;br /&gt;
*&#039;&#039;&#039;Strip From End.&#039;&#039;&#039; Strips the specified words from the end of the language string. For multiple words separate each word with the pipe ( &#039;&#039;|&#039;&#039; ) character like so: word1|word2&lt;br /&gt;
&lt;br /&gt;
===System - Log===&lt;br /&gt;
This plug-in enables system logging. A log is a file that contains information about the web site activity. It can be used to see a history of activity and to troubleshoot problems on the site. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===System - Redirect===&lt;br /&gt;
This plug-in enables the Joomla! Redirect system to catch missing pages and redirect users. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===System - Remember Me===&lt;br /&gt;
This plug-in provides &amp;quot;Remember Me&amp;quot; functionality. This allows the website to &amp;quot;remember&amp;quot; your username and password so that you can automatically be logged in when you return to the site. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===System - SEF===&lt;br /&gt;
This plug-in adds SEF support to links in the document. It operates directly on the HTML and does not require a special tag. This plug-in has no options.&lt;br /&gt;
&lt;br /&gt;
===User - Profile===&lt;br /&gt;
This plug-in adds user profile capability to your website. Website users will be able to fill out profile fields that you enable in the options section of this plug-in. You can control what profile fields are shown in the new user registration form and/or each user&#039;s editable profile screen. To control what fields are shown in the new user registration form, set the field options in the section labeled &#039;&#039;User profile information required at registration&#039;&#039;. For profile fields shown in the user&#039;s profile screen which it editable after login, set the field option in the options section labeled &#039;&#039;Required user profile information&#039;&#039;. For each field you have the following options:&lt;br /&gt;
*&#039;&#039;&#039;Required.&#039;&#039;&#039; The field is visible in user profiles and users are required to fill it out.&lt;br /&gt;
*&#039;&#039;&#039;Optional.&#039;&#039;&#039; The field is visible in user profiles but is optional and users do not need to fill it out.&lt;br /&gt;
*&#039;&#039;&#039;Disabled.&#039;&#039;&#039; The field is disabled and not visible in user profiles.&lt;br /&gt;
 &lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-profile-options-screen.png]]&lt;br /&gt;
* All fields are text fields with the exception of the &#039;&#039;Terms of Service&#039;&#039; field. The &#039;&#039;Terms of Service&#039;&#039; field is a radio button that the user can click on to signify their agreement with the website&#039;s terms of service.&lt;br /&gt;
&lt;br /&gt;
===User - Contact Creator===&lt;br /&gt;
This plug-in automatically creates contact information for new users. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-contact_creator-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Automatic Webpage.&#039;&#039;&#039; A formatted string to automatically generate a contact&#039;s web page. [name] is replaced with the name, [username] is replaced with the username, [userid] is replaced with the user ID and [email] is replaced with the email.&lt;br /&gt;
*&#039;&#039;&#039;Category.&#039;&#039;&#039; Category to assign contacts to by default.&lt;br /&gt;
*&#039;&#039;&#039;Autopublish the contact.&#039;&#039;&#039; Optionally have the automatically created contact set to the published state and visible to your website visitors.&lt;br /&gt;
&lt;br /&gt;
===User - Joomla!===&lt;br /&gt;
This plug-in handles the default user synchronization. It has the following options:&lt;br /&gt;
&lt;br /&gt;
[[Image:Help30-Extensions-Plugin-Manager-Edit-joomla-options-screen.png]]&lt;br /&gt;
*&#039;&#039;&#039;Auto-create Users.&#039;&#039;&#039; Whether or not to automatically create registered Joomla! users where possible. Default is &amp;quot;Yes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Quick Tips==&lt;br /&gt;
*If you are using the TinyMCE editor, you can control which options appear on the editor&#039;s toolbar by setting the parameters in the &amp;quot;Editor - TinyMCE&amp;quot; plug-in.&lt;br /&gt;
*Starting with Joomla! 1.6, configurable plug-in settings are referred to as &#039;options&#039;. In previous versions of Joomla! these configurable settings were referred to as &#039;parameters&#039;. You may see the terms &#039;options&#039; and &#039;parameters&#039; used interchangeably in help documentation and tutorials you encounter.&lt;br /&gt;
&lt;br /&gt;
==Related Information==&lt;br /&gt;
*To install new Plug-in Extensions: [[Help30:Extensions_Extension_Manager_Install|Extension Manager - Install Screen]]&lt;br /&gt;
*To uninstall third-party Plug-ins: [[Help30:Extensions_Extension_Manager_Manage|Extension Manager - Manage]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{cathelp|3.0,3.1,3.2,3.3|Plugin Manager Help Screens|Extensions Help Screens}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=API17:JFilterInput::clean&amp;diff=125479</id>
		<title>API17:JFilterInput::clean</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=API17:JFilterInput::clean&amp;diff=125479"/>
		<updated>2014-09-24T14:26:19Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: /* Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
=={{JVer|11.1}} JFilterInput::clean==&lt;br /&gt;
===Description===&lt;br /&gt;
Method to be called by another php script. Processes for XSS and specified bad code.&lt;br /&gt;
&lt;br /&gt;
{{Description:JFilterInput::clean}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[Description:JFilterInput::clean|Edit Descripton]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
public function clean (&lt;br /&gt;
        $source&lt;br /&gt;
        $type=&#039;string&#039;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameter&lt;br /&gt;
!Type&lt;br /&gt;
!Default&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|$source&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|$type&lt;br /&gt;
|&lt;br /&gt;
|&#039;string&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Returns&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;Defined&#039;&#039;&#039; on line 131 of libraries/joomla/filter/filterinput.php&lt;br /&gt;
&lt;br /&gt;
===See also===&lt;br /&gt;
* {{JVer|11.1}} &#039;&#039;&#039;JFilterInput::clean source code&#039;&#039;&#039; on [[jplatform:filter/filterinput.php#cl-123|BitBucket]]&lt;br /&gt;
* {{JVer|11.1}} Class [[API17:JFilterInput|JFilterInput]]&lt;br /&gt;
* {{JVer|11.1}} Subpackage [[API17:Subpackage_Filter|Filter]]&lt;br /&gt;
* [[API17:JFilterInput::clean|Other versions of JFilterInput::clean]]&lt;br /&gt;
{{SeeAlso:JFilterInput::clean}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[SeeAlso:JFilterInput::clean|Edit See Also]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
===User contributed notes===&lt;br /&gt;
&amp;lt;CodeExamplesForm /&amp;gt;&lt;br /&gt;
&amp;lt;dpl&amp;gt;&lt;br /&gt;
noresultsheader=\n&lt;br /&gt;
category=JFilterInput::clean&lt;br /&gt;
category=CodeExample&lt;br /&gt;
category=MethodExample&lt;br /&gt;
include=*&lt;br /&gt;
namespace=CodeExample&lt;br /&gt;
format= ,,,&lt;br /&gt;
&amp;lt;/dpl&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Platform 11.1]][[Category:Archived pages API17]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Form_field&amp;diff=124698</id>
		<title>Form field</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Form_field&amp;diff=124698"/>
		<updated>2014-08-05T14:59:04Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: /* Custom form field types */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
Form fields are fields in a HTML &amp;lt;code&amp;gt;&amp;lt;form&amp;gt;&amp;lt;/code&amp;gt;. Joomla! 2.5 {{JVer|2.5}} and newer supply the JForm class to conveniently and flexibly create forms with a large amount of form fields. Each form field type is a subclass of JFormField.&lt;br /&gt;
&lt;br /&gt;
In addition to being a flexible page creation tool, JFormFields are used by Joomla! to allow [[Administrator (User)|administrators]] to configure Joomla! or its extensions without changing the underlying code. In Joomla! 1.5, this was handled by the now deprecated [[API15:JParameter|JParameter]] and [[API15:JElement|JElement]] classes.&lt;br /&gt;
&lt;br /&gt;
To define form fields in the configuration of an extension, you must include them in a named fieldset, such as &amp;lt;code&amp;gt;&amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&amp;lt;/code&amp;gt;, that is within the &amp;lt;code&amp;gt;&amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&amp;lt;/code&amp;gt; section of the &amp;lt;code&amp;gt;&amp;lt;config&amp;gt;&amp;lt;/code&amp;gt; element in your [[Manifest files|XML manifest file]].&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Form validation ==&lt;br /&gt;
{{:Form validation}}&lt;br /&gt;
== Standard form field types ==&lt;br /&gt;
{{:Standard form field types}}&lt;br /&gt;
== Custom form field types ==&lt;br /&gt;
An [[extension]] can define its own form field types, which can then be used in its own forms or forms created by another extension. See [[Creating a custom form field type]] for instructions.&lt;br /&gt;
=== Modal form field types ===&lt;br /&gt;
If you have a field with a lot of values that don&#039;t fit a selection box, you can always make a modal form field that will allow the user to pick an item from a modal page with a table, filtering options, etc. (jut like any administrator table, e.g. &amp;quot;Articles&amp;quot;)&lt;br /&gt;
See [[Creating a modal form field]]&lt;br /&gt;
&lt;br /&gt;
== Common attributes ==&lt;br /&gt;
Adding the attribute &amp;lt;code&amp;gt;labelclass&amp;lt;/code&amp;gt; adds a CSS class for form field&#039;s label. Source: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;amp;tracker_item_id=28450&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Landing Pages]]&lt;br /&gt;
[[Category:Form fields| ]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Form_field&amp;diff=124697</id>
		<title>Form field</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Form_field&amp;diff=124697"/>
		<updated>2014-08-05T14:58:45Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: /* Common attributes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
Form fields are fields in a HTML &amp;lt;code&amp;gt;&amp;lt;form&amp;gt;&amp;lt;/code&amp;gt;. Joomla! 2.5 {{JVer|2.5}} and newer supply the JForm class to conveniently and flexibly create forms with a large amount of form fields. Each form field type is a subclass of JFormField.&lt;br /&gt;
&lt;br /&gt;
In addition to being a flexible page creation tool, JFormFields are used by Joomla! to allow [[Administrator (User)|administrators]] to configure Joomla! or its extensions without changing the underlying code. In Joomla! 1.5, this was handled by the now deprecated [[API15:JParameter|JParameter]] and [[API15:JElement|JElement]] classes.&lt;br /&gt;
&lt;br /&gt;
To define form fields in the configuration of an extension, you must include them in a named fieldset, such as &amp;lt;code&amp;gt;&amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&amp;lt;/code&amp;gt;, that is within the &amp;lt;code&amp;gt;&amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&amp;lt;/code&amp;gt; section of the &amp;lt;code&amp;gt;&amp;lt;config&amp;gt;&amp;lt;/code&amp;gt; element in your [[Manifest files|XML manifest file]].&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Form validation ==&lt;br /&gt;
{{:Form validation}}&lt;br /&gt;
== Standard form field types ==&lt;br /&gt;
{{:Standard form field types}}&lt;br /&gt;
== Custom form field types ==&lt;br /&gt;
An [[extension]] can define its own form field types, which can then be used in its own forms or forms created by another extension. See [[Creating a custom form field type]] for instructions.&lt;br /&gt;
=== Modal form field types ===&lt;br /&gt;
If you have a field with a lot of values that don&#039;t fit a selection box, you can always make a modal form field that will allow the user to pick an item from a modal page with a table, filtering options, etc. (jut like any administrator table, e.g. &amp;quot;Articles&amp;quot;)&lt;br /&gt;
See [[Creating a modal form field]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Landing Pages]]&lt;br /&gt;
[[Category:Form fields| ]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Form_field&amp;diff=124696</id>
		<title>Form field</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Form_field&amp;diff=124696"/>
		<updated>2014-08-05T14:58:25Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: /* Modal form field types */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
Form fields are fields in a HTML &amp;lt;code&amp;gt;&amp;lt;form&amp;gt;&amp;lt;/code&amp;gt;. Joomla! 2.5 {{JVer|2.5}} and newer supply the JForm class to conveniently and flexibly create forms with a large amount of form fields. Each form field type is a subclass of JFormField.&lt;br /&gt;
&lt;br /&gt;
In addition to being a flexible page creation tool, JFormFields are used by Joomla! to allow [[Administrator (User)|administrators]] to configure Joomla! or its extensions without changing the underlying code. In Joomla! 1.5, this was handled by the now deprecated [[API15:JParameter|JParameter]] and [[API15:JElement|JElement]] classes.&lt;br /&gt;
&lt;br /&gt;
To define form fields in the configuration of an extension, you must include them in a named fieldset, such as &amp;lt;code&amp;gt;&amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&amp;lt;/code&amp;gt;, that is within the &amp;lt;code&amp;gt;&amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&amp;lt;/code&amp;gt; section of the &amp;lt;code&amp;gt;&amp;lt;config&amp;gt;&amp;lt;/code&amp;gt; element in your [[Manifest files|XML manifest file]].&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Form validation ==&lt;br /&gt;
{{:Form validation}}&lt;br /&gt;
== Standard form field types ==&lt;br /&gt;
{{:Standard form field types}}&lt;br /&gt;
== Custom form field types ==&lt;br /&gt;
An [[extension]] can define its own form field types, which can then be used in its own forms or forms created by another extension. See [[Creating a custom form field type]] for instructions.&lt;br /&gt;
=== Modal form field types ===&lt;br /&gt;
If you have a field with a lot of values that don&#039;t fit a selection box, you can always make a modal form field that will allow the user to pick an item from a modal page with a table, filtering options, etc. (jut like any administrator table, e.g. &amp;quot;Articles&amp;quot;)&lt;br /&gt;
See [[Creating a modal form field]]&lt;br /&gt;
&lt;br /&gt;
=== Common attributes ===&lt;br /&gt;
Adding the attribute &amp;lt;code&amp;gt;labelclass&amp;lt;/code&amp;gt; adds a CSS class for form field&#039;s label. Source: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;amp;tracker_item_id=28450&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Landing Pages]]&lt;br /&gt;
[[Category:Form fields| ]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Selecting_data_using_JDatabase&amp;diff=117128</id>
		<title>Selecting data using JDatabase</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Selecting_data_using_JDatabase&amp;diff=117128"/>
		<updated>2014-04-03T14:33:14Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: /* Selecting Records from Multiple Tables */&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, &amp;lt;code&amp;gt;$db-&amp;gt;query()&amp;lt;/code&amp;gt; throws a deprecated notice in Joomla 3.0+. In that case, change &amp;lt;code&amp;gt;$db-&amp;gt;query()&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;$db-&amp;gt;execute()&amp;lt;/code&amp;gt;. However note &amp;lt;code&amp;gt;$db-&amp;gt;execute()&amp;lt;/code&amp;gt; does not work in Joomla 2.5.}}&lt;br /&gt;
&lt;br /&gt;
This tutorial is split into two independent parts:&lt;br /&gt;
* Inserting, updating and removing data from the database.&lt;br /&gt;
* Selecting data from one or more tables and retrieving it in a variety of different forms&lt;br /&gt;
&lt;br /&gt;
This section of the documentation looks at selecting data from a database table and retrieving it in a variety of formats. To see the other part [[Inserting,_Updating_and_Removing_data_using_JDatabase|click here]]&lt;br /&gt;
&lt;br /&gt;
== Introduction==&lt;br /&gt;
Joomla provides a sophisticated database abstraction layer to simplify the usage for third party developers. New versions of the Joomla Platform API provide additional functionality which extends the database layer further, and includes features such as connectors to a greater variety of database servers and the query chaining to improve readability of connection code and simplify SQL coding.&lt;br /&gt;
&lt;br /&gt;
Joomla can use different kinds of SQL database systems and run in a variety of environments with different table-prefixes. In addition to these functions, the class automatically creates the database connection. Besides instantiating the object you need just two lines of code to get a result from the database in a variety of formats. Using the Joomla database layer ensures a maximum of compatibility and flexibility for your extension.&lt;br /&gt;
&lt;br /&gt;
==The Query==&lt;br /&gt;
&lt;br /&gt;
Joomla&#039;s database querying has changed since the new Joomla Framework was introduced  &amp;quot;query chaining&amp;quot; is now the recommended method for building database queries (although string queries are still supported).&lt;br /&gt;
&lt;br /&gt;
Query chaining refers to a method of connecting a number of methods, one after the other, with each method returning an object that can support the next method, improving readability and simplifying code.&lt;br /&gt;
&lt;br /&gt;
To obtain a new instance of the JDatabaseQuery class we use the JDatabaseDriver getQuery method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The JDatabaseDriver::getQuery takes an optional argument, $new, which can be true or false (the default being false).&lt;br /&gt;
&lt;br /&gt;
To query our data source we can call a number of JDatabaseQuery methods; these methods encapsulate the data source&#039;s query language (in most cases SQL), hiding query-specific syntax from the developer and increasing the portability of the developer&#039;s source code. &lt;br /&gt;
&lt;br /&gt;
Some of the more frequently used methods include; select, from, join, where and order. There are also methods such as insert, update and delete for modifying records in the data store. By chaining these and other method calls, you can create almost any query against your data store without compromising portability of your code.&lt;br /&gt;
&lt;br /&gt;
==Selecting Records from a Single Table==&lt;br /&gt;
&lt;br /&gt;
Below is an example of creating a database query using the JDatabaseQuery class. Using the select, from, where and order methods, we can create queries which are flexible, easily readable and portable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Get a db connection.&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
&lt;br /&gt;
// Create a new query object.&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
&lt;br /&gt;
// Select all records from the user profile table where key begins with &amp;quot;custom.&amp;quot;.&lt;br /&gt;
// Order it by the ordering field.&lt;br /&gt;
$query-&amp;gt;select($db-&amp;gt;quoteName(array(&#039;user_id&#039;, &#039;profile_key&#039;, &#039;profile_value&#039;, &#039;ordering&#039;)));&lt;br /&gt;
$query-&amp;gt;from($db-&amp;gt;quoteName(&#039;#__user_profiles&#039;));&lt;br /&gt;
$query-&amp;gt;where($db-&amp;gt;quoteName(&#039;profile_key&#039;) . &#039; LIKE &#039;. $db-&amp;gt;quote(&#039;\&#039;custom.%\&#039;&#039;));&lt;br /&gt;
$query-&amp;gt;order(&#039;ordering ASC&#039;);&lt;br /&gt;
&lt;br /&gt;
// Reset the query using our newly populated query object.&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
&lt;br /&gt;
// Load the results as a list of stdClass objects (see later for more options on retrieving data).&lt;br /&gt;
$results = $db-&amp;gt;loadObjectList();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The query can also be chained to simplify further:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;user_id&#039;, &#039;profile_key&#039;, &#039;profile_value&#039;, &#039;ordering&#039;)))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__user_profiles&#039;))&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;profile_key&#039;) . &#039; LIKE &#039;. $db-&amp;gt;quote(&#039;\&#039;custom.%\&#039;&#039;))&lt;br /&gt;
    -&amp;gt;order(&#039;ordering ASC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Chaining can become useful when queries become longer and more complex.&lt;br /&gt;
&lt;br /&gt;
Grouping can be achieved simply too.  The following query would count the number of articles in each category&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select( array(&#039;catid&#039;, &#039;COUNT(*)&#039;) )&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;))&lt;br /&gt;
    -&amp;gt;group($db-&amp;gt;quoteName(&#039;catid&#039;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Selecting Records from Multiple Tables==&lt;br /&gt;
&lt;br /&gt;
Using the JDatabaseQuery&#039;s [http://api.joomla.org/Joomla-Platform/Database/JDatabaseQuery.html#join join] methods, we can select records from multiple related tables. The generic &amp;quot;join&amp;quot; method takes two arguments; the join &amp;quot;type&amp;quot; (inner, outer, left, right) and the join condition. In the following example you will notice that we can use all of the keywords we would normally use if we were writing a native SQL query, including the AS keyword for aliasing tables and the ON keyword for creating relationships between tables. Also note that the table alias is used in all methods which reference table columns (I.e. select, where, order).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Get a db connection.&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
&lt;br /&gt;
// Create a new query object.&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
&lt;br /&gt;
// Select all articles for users who have a username which starts with &#039;a&#039;.&lt;br /&gt;
// Order it by the created date.&lt;br /&gt;
// Note by putting &#039;a&#039; as a second parameter will generate `#__content` AS `a`&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;a.*&#039;, &#039;b.username&#039;, &#039;b.name&#039;)))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;, &#039;a&#039;))&lt;br /&gt;
    -&amp;gt;join(&#039;INNER&#039;, $db-&amp;gt;quoteName(&#039;#__users&#039;, &#039;b&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.created_by&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;b.username&#039;) . &#039; LIKE \&#039;a%\&#039;&#039;)&lt;br /&gt;
    -&amp;gt;order($db-&amp;gt;quoteName(&#039;a.created&#039;) . &#039; DESC&#039;);&lt;br /&gt;
&lt;br /&gt;
// Reset the query using our newly populated query object.&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
&lt;br /&gt;
// Load the results as a list of stdClass objects (see later for more options on retrieving data).&lt;br /&gt;
$results = $db-&amp;gt;loadObjectList();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The join method above enables us to query both the content and user tables, retrieving articles with their author details. There are also convenience methods for joins:&lt;br /&gt;
* [http://api.joomla.org/Joomla-Platform/Database/JDatabaseQuery.html#innerJoin innerJoin()]&lt;br /&gt;
* [http://api.joomla.org/Joomla-Platform/Database/JDatabaseQuery.html#leftJoin leftJoin()]&lt;br /&gt;
* [http://api.joomla.org/Joomla-Platform/Database/JDatabaseQuery.html#rightJoin rightJoin()] &lt;br /&gt;
* [http://api.joomla.org/Joomla-Platform/Database/JDatabaseQuery.html#outerJoin outerJoin()]&lt;br /&gt;
&lt;br /&gt;
We can use multiple joins to query across more than two tables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;a.*&#039;, &#039;b.username&#039;, &#039;b.name&#039;, &#039;c.*&#039;, &#039;d.*&#039;)))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;, &#039;a&#039;))&lt;br /&gt;
    -&amp;gt;join(&#039;INNER&#039;, $db-&amp;gt;quoteName(&#039;#__users&#039;, &#039;b&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.created_by&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;join(&#039;LEFT&#039;, $db-&amp;gt;quoteName(&#039;#__user_profiles&#039;, &#039;c&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;c.user_id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;join(&#039;RIGHT&#039;, $db-&amp;gt;quoteName(&#039;#__categories&#039;, &#039;d&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.catid&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;d.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;b.username&#039;) . &#039; LIKE \&#039;a%\&#039;&#039;)&lt;br /&gt;
    -&amp;gt;order($db-&amp;gt;quoteName(&#039;a.created&#039;) . &#039; DESC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice how chaining makes the source code much more readable for these longer queries.&lt;br /&gt;
&lt;br /&gt;
In some cases, you will also need to use the AS clause when selecting items to avoid column name conflicts. In this case, multiple select statements can be chained in conjunction with using the second parameter of $db-&amp;gt;quoteName.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(&#039;a.*&#039;))&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(&#039;b.username&#039;, &#039;username&#039;))&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(&#039;b.name&#039;, &#039;name&#039;))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;, &#039;a&#039;))&lt;br /&gt;
    -&amp;gt;join(&#039;INNER&#039;, $db-&amp;gt;quoteName(&#039;#__users&#039;, &#039;b&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.created_by&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;b.username&#039;) . &#039; LIKE \&#039;a%\&#039;&#039;)&lt;br /&gt;
    -&amp;gt;order($db-&amp;gt;quoteName(&#039;a.created&#039;) . &#039; DESC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A second array can also be used as the second parameter of the select statement to populate the values of the AS clause. Remember to include nulls in the second array to correspond to columns in the first array that you don&#039;t want to use the AS clause for:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;a.*&#039;, &#039;b.username&#039;, &#039;b.name&#039;), array(&#039;&#039;, &#039;username&#039;, &#039;name&#039;))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;, &#039;a&#039;))&lt;br /&gt;
    -&amp;gt;join(&#039;INNER&#039;, $db-&amp;gt;quoteName(&#039;#__users&#039;, &#039;b&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.created_by&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;b.username&#039;) . &#039; LIKE \&#039;a%\&#039;&#039;)&lt;br /&gt;
    -&amp;gt;order($db-&amp;gt;quoteName(&#039;a.created&#039;) . &#039; DESC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Query Results ==&lt;br /&gt;
The database class contains many methods for working with a query&#039;s result set.&lt;br /&gt;
&lt;br /&gt;
=== Single Value Result ===&lt;br /&gt;
==== loadResult() ====&lt;br /&gt;
Use &#039;&#039;&#039;loadResult()&#039;&#039;&#039; when you expect just a single value back from your database query. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- &lt;br /&gt;
| 1 || style=&amp;quot;background:yellow&amp;quot; | John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is often the result of a &#039;count&#039; query to get a number of records:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
$query-&amp;gt;select(&#039;COUNT(*)&#039;);&lt;br /&gt;
$query-&amp;gt;from($db-&amp;gt;quoteName(&#039;#__my_table&#039;));&lt;br /&gt;
$query-&amp;gt;where($db-&amp;gt;quoteName(&#039;name&#039;).&amp;quot; = &amp;quot;.$db-&amp;gt;quote($value));&lt;br /&gt;
&lt;br /&gt;
// Reset the query using our newly populated query object.&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$count = $db-&amp;gt;loadResult();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or where you are just looking for a single field from a single row of the table (or possibly a single field from the first row returned).&lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
$query-&amp;gt;select(&#039;field_name&#039;);&lt;br /&gt;
$query-&amp;gt;from($db-&amp;gt;quoteName(&#039;#__my_table&#039;));&lt;br /&gt;
$query-&amp;gt;where($db-&amp;gt;quoteName(&#039;some_name&#039;).&amp;quot; = &amp;quot;.$db-&amp;gt;quote($some_value));&lt;br /&gt;
&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$result = $db-&amp;gt;loadResult();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Single Row Results ===&lt;br /&gt;
Each of these results functions will return a single record from the database even though there may be several records that meet the criteria that you have set. To get more records you need to call the function again.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 1 || John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== loadRow() ====&lt;br /&gt;
loadRow() returns an indexed array from a single record in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadRow();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; 1 [1] =&amp;gt; John Smith [2] =&amp;gt; johnsmith@domain.example [3] =&amp;gt; johnsmith ) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
# Whilst you can repeat the call to get further rows, one of the functions that returns multiple rows might be more useful.&lt;br /&gt;
&lt;br /&gt;
==== loadAssoc() ====&lt;br /&gt;
loadAssoc() returns an associated array from a single record in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadAssoc();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;name&#039;] // e.g. $row[&#039;name&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# Whilst you can repeat the call to get further rows, one of the functions that returns multiple rows might be more useful.&lt;br /&gt;
&lt;br /&gt;
==== loadObject() ====&lt;br /&gt;
loadObject returns a PHP object from a single record in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$result = $db-&amp;gt;loadObject();&lt;br /&gt;
print_r($result);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;stdClass Object ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$result-&amp;gt;index // e.g. $result-&amp;gt;email&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# Whilst you can repeat the call to get further rows, one of the functions that returns multiple rows might be more useful.&lt;br /&gt;
&lt;br /&gt;
===Single Column Results ===&lt;br /&gt;
Each of these results functions will return a single column from the database. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- &lt;br /&gt;
| 1 || style=&amp;quot;background:yellow&amp;quot; | John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|-&lt;br /&gt;
| 2 || style=&amp;quot;background:yellow&amp;quot; | Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|-&lt;br /&gt;
| 3 || style=&amp;quot;background:yellow&amp;quot; | Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== loadColumn() ====&lt;br /&gt;
loadColumn() returns an indexed array from a single column in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
$query-&amp;gt;select(&#039;name&#039;));&lt;br /&gt;
      -&amp;gt;from . . .&amp;quot;;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$column= $db-&amp;gt;loadColumn();&lt;br /&gt;
print_r($column);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; John Smith [1] =&amp;gt; Magda Hellman [2] =&amp;gt; Yvonne de Gaulle )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$column[&#039;index&#039;] // e.g. $column[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
# loadColumn() is equivalent to loadColumn(0).&lt;br /&gt;
&lt;br /&gt;
==== loadColumn($index) ====&lt;br /&gt;
loadColumn($index) returns an indexed array from a single column in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
$query-&amp;gt;select(array(&#039;name&#039;, &#039;email&#039;, &#039;username&#039;));&lt;br /&gt;
      -&amp;gt;from . . .&amp;quot;;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$column= $db-&amp;gt;loadColumn(1);&lt;br /&gt;
print_r($column);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; johnsmith@domain.example [1] =&amp;gt; magda_h@domain.example [2] =&amp;gt; ydg@domain.example )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$column[&#039;index&#039;] // e.g. $column[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
loadColumn($index) allows you to iterate through a series of columns in the results&lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
for ( $i = 0; $i &amp;lt;= 2; $i++ ) {&lt;br /&gt;
  $column= $db-&amp;gt;loadColumn($i);&lt;br /&gt;
  print_r($column);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; John Smith [1] =&amp;gt; Magda Hellman [2] =&amp;gt; Yvonne de Gaulle )&lt;br /&gt;
Array ( [0] =&amp;gt; johnsmith@domain.example [1] =&amp;gt; magda_h@domain.example [2] =&amp;gt; ydg@domain.example )&lt;br /&gt;
Array ( [0] =&amp;gt; johnsmith [1] =&amp;gt; magdah [2] =&amp;gt; ydegaulle )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
&lt;br /&gt;
=== Multi-Row Results ===&lt;br /&gt;
Each of these results functions will return multiple records from the database. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 1 || John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 2 || Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 3 || Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== loadRowList() ====&lt;br /&gt;
loadRowList() returns an indexed array of indexed arrays from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadRowList();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[0] =&amp;gt; Array ( [0] =&amp;gt; 1 [1] =&amp;gt; John Smith [2] =&amp;gt; johnsmith@domain.example [3] =&amp;gt; johnsmith ) &lt;br /&gt;
[1] =&amp;gt; Array ( [0] =&amp;gt; 2 [1] =&amp;gt; Magda Hellman [2] =&amp;gt; magda_h@domain.example [3] =&amp;gt; magdah ) &lt;br /&gt;
[2] =&amp;gt; Array ( [0] =&amp;gt; 3 [1] =&amp;gt; Yvonne de Gaulle [2] =&amp;gt; ydg@domain.example [3] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;][&#039;index&#039;] // e.g. $row[&#039;2&#039;][&#039;3&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
&lt;br /&gt;
==== loadAssocList() ====&lt;br /&gt;
loadAssocList() returns an indexed array of associated arrays from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadAssocList();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[0] =&amp;gt; Array ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[1] =&amp;gt; Array ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[2] =&amp;gt; Array ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;][&#039;column_name&#039;] // e.g. $row[&#039;2&#039;][&#039;email&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== loadAssocList($key) ====&lt;br /&gt;
loadAssocList(&#039;key&#039;) returns an associated array - indexed on &#039;key&#039; - of associated arrays from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadAssocList(&#039;username&#039;);&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[johnsmith] =&amp;gt; Array ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[magdah] =&amp;gt; Array ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[ydegaulle] =&amp;gt; Array ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;] // e.g. $row[&#039;johnsmith&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;][&#039;column_name&#039;] // e.g. $row[&#039;johnsmith&#039;][&#039;email&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Key must be a valid column name from the table; it does not have to be an Index or a Primary Key. But if it does not have a unique value you may not be able to retrieve results reliably.&lt;br /&gt;
&lt;br /&gt;
==== loadObjectList() ====&lt;br /&gt;
loadObjectList() returns an indexed array of PHP objects from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadObjectList();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[0] =&amp;gt; stdClass Object ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith &lt;br /&gt;
    [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[1] =&amp;gt; stdClass Object ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman &lt;br /&gt;
    [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[2] =&amp;gt; stdClass Object ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle &lt;br /&gt;
    [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;]-&amp;gt;name // e.g. $row[&#039;2&#039;]-&amp;gt;email&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== loadObjectList(&#039;key&#039;) ====&lt;br /&gt;
loadObjectList($key) returns an associated array - indexed on &#039;key&#039; - of objects from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadObjectList(&#039;username&#039;);&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[johnsmith] =&amp;gt; stdClass Object ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith &lt;br /&gt;
    [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[magdah] =&amp;gt; stdClass Object ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman &lt;br /&gt;
    [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[ydegaulle] =&amp;gt; stdClass Object ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle &lt;br /&gt;
    [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;] // e.g. $row[&#039;johnsmith&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;]-&amp;gt;column_name // e.g. $row[&#039;johnsmith&#039;]-&amp;gt;email&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Key must be a valid column name from the table; it does not have to be an Index or a Primary Key. But if it does not have a unique value you may not be able to retrieve results reliably.&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous Result Set Methods ===&lt;br /&gt;
==== getNumRows() ====&lt;br /&gt;
getNumRows() will return the number of result rows found by the last query and waiting to be read. To get a result from getNumRows() you have to run it &#039;&#039;&#039;after&#039;&#039;&#039; the query and &#039;&#039;&#039;before&#039;&#039;&#039; you have retrieved any results.  &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$db-&amp;gt;execute();&lt;br /&gt;
$num_rows = $db-&amp;gt;getNumRows();&lt;br /&gt;
print_r($num_rows);&lt;br /&gt;
$result = $db-&amp;gt;loadRowList();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will return &amp;lt;pre&amp;gt;3&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note: if you run getNumRows() after loadRowList() - or any other retrieval method - you may get a PHP Warning:&lt;br /&gt;
&amp;lt;pre&amp;gt;Warning: mysql_num_rows(): 80 is not a valid MySQL result resource &lt;br /&gt;
in libraries\joomla\database\database\mysql.php on line 344&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Extension development]]&lt;br /&gt;
[[Category:Database]]&lt;br /&gt;
[[Category:JFactory]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Selecting_data_using_JDatabase&amp;diff=117115</id>
		<title>Selecting data using JDatabase</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Selecting_data_using_JDatabase&amp;diff=117115"/>
		<updated>2014-04-02T15:53:08Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: /* Selecting Records from Multiple Tables */&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, &amp;lt;code&amp;gt;$db-&amp;gt;query()&amp;lt;/code&amp;gt; throws a deprecated notice in Joomla 3.0+. In that case, change &amp;lt;code&amp;gt;$db-&amp;gt;query()&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;$db-&amp;gt;execute()&amp;lt;/code&amp;gt;. However note &amp;lt;code&amp;gt;$db-&amp;gt;execute()&amp;lt;/code&amp;gt; does not work in Joomla 2.5.}}&lt;br /&gt;
&lt;br /&gt;
This tutorial is split into two independent parts:&lt;br /&gt;
* Inserting, updating and removing data from the database.&lt;br /&gt;
* Selecting data from one or more tables and retrieving it in a variety of different forms&lt;br /&gt;
&lt;br /&gt;
This section of the documentation looks at selecting data from a database table and retrieving it in a variety of formats. To see the other part [[Inserting,_Updating_and_Removing_data_using_JDatabase|click here]]&lt;br /&gt;
&lt;br /&gt;
== Introduction==&lt;br /&gt;
Joomla provides a sophisticated database abstraction layer to simplify the usage for third party developers. New versions of the Joomla Platform API provide additional functionality which extends the database layer further, and includes features such as connectors to a greater variety of database servers and the query chaining to improve readability of connection code and simplify SQL coding.&lt;br /&gt;
&lt;br /&gt;
Joomla can use different kinds of SQL database systems and run in a variety of environments with different table-prefixes. In addition to these functions, the class automatically creates the database connection. Besides instantiating the object you need just two lines of code to get a result from the database in a variety of formats. Using the Joomla database layer ensures a maximum of compatibility and flexibility for your extension.&lt;br /&gt;
&lt;br /&gt;
==The Query==&lt;br /&gt;
&lt;br /&gt;
Joomla&#039;s database querying has changed since the new Joomla Framework was introduced  &amp;quot;query chaining&amp;quot; is now the recommended method for building database queries (although string queries are still supported).&lt;br /&gt;
&lt;br /&gt;
Query chaining refers to a method of connecting a number of methods, one after the other, with each method returning an object that can support the next method, improving readability and simplifying code.&lt;br /&gt;
&lt;br /&gt;
To obtain a new instance of the JDatabaseQuery class we use the JDatabaseDriver getQuery method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The JDatabaseDriver::getQuery takes an optional argument, $new, which can be true or false (the default being false).&lt;br /&gt;
&lt;br /&gt;
To query our data source we can call a number of JDatabaseQuery methods; these methods encapsulate the data source&#039;s query language (in most cases SQL), hiding query-specific syntax from the developer and increasing the portability of the developer&#039;s source code. &lt;br /&gt;
&lt;br /&gt;
Some of the more frequently used methods include; select, from, join, where and order. There are also methods such as insert, update and delete for modifying records in the data store. By chaining these and other method calls, you can create almost any query against your data store without compromising portability of your code.&lt;br /&gt;
&lt;br /&gt;
==Selecting Records from a Single Table==&lt;br /&gt;
&lt;br /&gt;
Below is an example of creating a database query using the JDatabaseQuery class. Using the select, from, where and order methods, we can create queries which are flexible, easily readable and portable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Get a db connection.&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
&lt;br /&gt;
// Create a new query object.&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
&lt;br /&gt;
// Select all records from the user profile table where key begins with &amp;quot;custom.&amp;quot;.&lt;br /&gt;
// Order it by the ordering field.&lt;br /&gt;
$query-&amp;gt;select($db-&amp;gt;quoteName(array(&#039;user_id&#039;, &#039;profile_key&#039;, &#039;profile_value&#039;, &#039;ordering&#039;)));&lt;br /&gt;
$query-&amp;gt;from($db-&amp;gt;quoteName(&#039;#__user_profiles&#039;));&lt;br /&gt;
$query-&amp;gt;where($db-&amp;gt;quoteName(&#039;profile_key&#039;) . &#039; LIKE &#039;. $db-&amp;gt;quote(&#039;\&#039;custom.%\&#039;&#039;));&lt;br /&gt;
$query-&amp;gt;order(&#039;ordering ASC&#039;);&lt;br /&gt;
&lt;br /&gt;
// Reset the query using our newly populated query object.&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
&lt;br /&gt;
// Load the results as a list of stdClass objects (see later for more options on retrieving data).&lt;br /&gt;
$results = $db-&amp;gt;loadObjectList();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The query can also be chained to simplify further:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;user_id&#039;, &#039;profile_key&#039;, &#039;profile_value&#039;, &#039;ordering&#039;)))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__user_profiles&#039;))&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;profile_key&#039;) . &#039; LIKE &#039;. $db-&amp;gt;quote(&#039;\&#039;custom.%\&#039;&#039;))&lt;br /&gt;
    -&amp;gt;order(&#039;ordering ASC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Chaining can become useful when queries become longer and more complex.&lt;br /&gt;
&lt;br /&gt;
Grouping can be achieved simply too.  The following query would count the number of articles in each category&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select( array(&#039;catid&#039;, &#039;COUNT(*)&#039;) )&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;))&lt;br /&gt;
    -&amp;gt;group($db-&amp;gt;quoteName(&#039;catid&#039;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Selecting Records from Multiple Tables==&lt;br /&gt;
&lt;br /&gt;
Using the JDatabaseQuery&#039;s [http://api.joomla.org/Joomla-Platform/Database/JDatabaseQuery.html#join join] methods, we can select records from multiple related tables. The generic &amp;quot;join&amp;quot; method takes two arguments; the join &amp;quot;type&amp;quot; (inner, outer, left, right) and the join condition. In the following example you will notice that we can use all of the keywords we would normally use if we were writing a native SQL query, including the AS keyword for aliasing tables and the ON keyword for creating relationships between tables. Also note that the table alias is used in all methods which reference table columns (I.e. select, where, order).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Get a db connection.&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
&lt;br /&gt;
// Create a new query object.&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
&lt;br /&gt;
// Select all articles for users who have a username which starts with &#039;a&#039;.&lt;br /&gt;
// Order it by the created date.&lt;br /&gt;
// Note by putting &#039;a&#039; as a second parameter will generate `#__content` AS `a`&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;a.*&#039;, &#039;b.username&#039;, &#039;b.name&#039;)))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;, &#039;a&#039;))&lt;br /&gt;
    -&amp;gt;join(&#039;INNER&#039;, $db-&amp;gt;quoteName(&#039;#__users&#039;, &#039;b&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.created_by&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;b.username&#039;) . &#039; LIKE \&#039;a%\&#039;&#039;)&lt;br /&gt;
    -&amp;gt;order($db-&amp;gt;quoteName(&#039;a.created&#039;) . &#039; DESC&#039;);&lt;br /&gt;
&lt;br /&gt;
// Reset the query using our newly populated query object.&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
&lt;br /&gt;
// Load the results as a list of stdClass objects (see later for more options on retrieving data).&lt;br /&gt;
$results = $db-&amp;gt;loadObjectList();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The join method above enables us to query both the content and user tables, retrieving articles with their author details. There are also convenience methods for joins:&lt;br /&gt;
* [http://api.joomla.org/Joomla-Platform/Database/JDatabaseQuery.html#innerJoin innerJoin()]&lt;br /&gt;
* [http://api.joomla.org/Joomla-Platform/Database/JDatabaseQuery.html#leftJoin leftJoin()]&lt;br /&gt;
* [http://api.joomla.org/Joomla-Platform/Database/JDatabaseQuery.html#rightJoin rightJoin()] &lt;br /&gt;
* [http://api.joomla.org/Joomla-Platform/Database/JDatabaseQuery.html#outerJoin outerJoin()]&lt;br /&gt;
&lt;br /&gt;
We can use multiple joins to query across more than two tables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;a.*&#039;, &#039;b.username&#039;, &#039;b.name&#039;, &#039;c.*&#039;, &#039;d.*&#039;)))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;, &#039;a&#039;))&lt;br /&gt;
    -&amp;gt;join(&#039;INNER&#039;, $db-&amp;gt;quoteName(&#039;#__users&#039;, &#039;b&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.created_by&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;join(&#039;LEFT&#039;, $db-&amp;gt;quoteName(&#039;#__user_profiles&#039;, &#039;c&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;c.user_id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;join(&#039;RIGHT&#039;, $db-&amp;gt;quoteName(&#039;#__categories&#039;, &#039;d&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.catid&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;d.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;b.username&#039;) . &#039; LIKE \&#039;a%\&#039;&#039;)&lt;br /&gt;
    -&amp;gt;order($db-&amp;gt;quoteName(&#039;a.created&#039;) . &#039; DESC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice how chaining makes the source code much more readable for these longer queries.&lt;br /&gt;
&lt;br /&gt;
In some cases, you will also need to use the AS clause when selecting items to avoid column name conflicts. In this case, multiple select statements can be chained in conjunction with using the second parameter of $db-&amp;gt;quoteName.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(&#039;a.*&#039;))&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(&#039;b.username&#039;, &#039;username&#039;))&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(&#039;b.name&#039;, &#039;name&#039;))&lt;br /&gt;
    -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__content&#039;, &#039;a&#039;))&lt;br /&gt;
    -&amp;gt;join(&#039;INNER&#039;, $db-&amp;gt;quoteName(&#039;#__users&#039;, &#039;b&#039;) . &#039; ON (&#039; . $db-&amp;gt;quoteName(&#039;a.created_by&#039;) . &#039; = &#039; . $db-&amp;gt;quoteName(&#039;b.id&#039;) . &#039;)&#039;)&lt;br /&gt;
    -&amp;gt;where($db-&amp;gt;quoteName(&#039;b.username&#039;) . &#039; LIKE \&#039;a%\&#039;&#039;)&lt;br /&gt;
    -&amp;gt;order($db-&amp;gt;quoteName(&#039;a.created&#039;) . &#039; DESC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Query Results ==&lt;br /&gt;
The database class contains many methods for working with a query&#039;s result set.&lt;br /&gt;
&lt;br /&gt;
=== Single Value Result ===&lt;br /&gt;
==== loadResult() ====&lt;br /&gt;
Use &#039;&#039;&#039;loadResult()&#039;&#039;&#039; when you expect just a single value back from your database query. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- &lt;br /&gt;
| 1 || style=&amp;quot;background:yellow&amp;quot; | John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is often the result of a &#039;count&#039; query to get a number of records:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
$query-&amp;gt;select(&#039;COUNT(*)&#039;);&lt;br /&gt;
$query-&amp;gt;from($db-&amp;gt;quoteName(&#039;#__my_table&#039;));&lt;br /&gt;
$query-&amp;gt;where($db-&amp;gt;quoteName(&#039;name&#039;).&amp;quot; = &amp;quot;.$db-&amp;gt;quote($value));&lt;br /&gt;
&lt;br /&gt;
// Reset the query using our newly populated query object.&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$count = $db-&amp;gt;loadResult();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or where you are just looking for a single field from a single row of the table (or possibly a single field from the first row returned).&lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
$db = JFactory::getDbo();&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
$query-&amp;gt;select(&#039;field_name&#039;);&lt;br /&gt;
$query-&amp;gt;from($db-&amp;gt;quoteName(&#039;#__my_table&#039;));&lt;br /&gt;
$query-&amp;gt;where($db-&amp;gt;quoteName(&#039;some_name&#039;).&amp;quot; = &amp;quot;.$db-&amp;gt;quote($some_value));&lt;br /&gt;
&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$result = $db-&amp;gt;loadResult();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Single Row Results ===&lt;br /&gt;
Each of these results functions will return a single record from the database even though there may be several records that meet the criteria that you have set. To get more records you need to call the function again.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 1 || John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== loadRow() ====&lt;br /&gt;
loadRow() returns an indexed array from a single record in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadRow();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; 1 [1] =&amp;gt; John Smith [2] =&amp;gt; johnsmith@domain.example [3] =&amp;gt; johnsmith ) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
# Whilst you can repeat the call to get further rows, one of the functions that returns multiple rows might be more useful.&lt;br /&gt;
&lt;br /&gt;
==== loadAssoc() ====&lt;br /&gt;
loadAssoc() returns an associated array from a single record in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadAssoc();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;name&#039;] // e.g. $row[&#039;name&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# Whilst you can repeat the call to get further rows, one of the functions that returns multiple rows might be more useful.&lt;br /&gt;
&lt;br /&gt;
==== loadObject() ====&lt;br /&gt;
loadObject returns a PHP object from a single record in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$result = $db-&amp;gt;loadObject();&lt;br /&gt;
print_r($result);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;stdClass Object ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$result-&amp;gt;index // e.g. $result-&amp;gt;email&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# Whilst you can repeat the call to get further rows, one of the functions that returns multiple rows might be more useful.&lt;br /&gt;
&lt;br /&gt;
===Single Column Results ===&lt;br /&gt;
Each of these results functions will return a single column from the database. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- &lt;br /&gt;
| 1 || style=&amp;quot;background:yellow&amp;quot; | John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|-&lt;br /&gt;
| 2 || style=&amp;quot;background:yellow&amp;quot; | Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|-&lt;br /&gt;
| 3 || style=&amp;quot;background:yellow&amp;quot; | Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== loadColumn() ====&lt;br /&gt;
loadColumn() returns an indexed array from a single column in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
$query-&amp;gt;select(&#039;name&#039;));&lt;br /&gt;
      -&amp;gt;from . . .&amp;quot;;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$column= $db-&amp;gt;loadColumn();&lt;br /&gt;
print_r($column);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; John Smith [1] =&amp;gt; Magda Hellman [2] =&amp;gt; Yvonne de Gaulle )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$column[&#039;index&#039;] // e.g. $column[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
# loadColumn() is equivalent to loadColumn(0).&lt;br /&gt;
&lt;br /&gt;
==== loadColumn($index) ====&lt;br /&gt;
loadColumn($index) returns an indexed array from a single column in the table: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
$query-&amp;gt;select(array(&#039;name&#039;, &#039;email&#039;, &#039;username&#039;));&lt;br /&gt;
      -&amp;gt;from . . .&amp;quot;;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$column= $db-&amp;gt;loadColumn(1);&lt;br /&gt;
print_r($column);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; johnsmith@domain.example [1] =&amp;gt; magda_h@domain.example [2] =&amp;gt; ydg@domain.example )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual values by using:&amp;lt;pre&amp;gt;$column[&#039;index&#039;] // e.g. $column[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
loadColumn($index) allows you to iterate through a series of columns in the results&lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
for ( $i = 0; $i &amp;lt;= 2; $i++ ) {&lt;br /&gt;
  $column= $db-&amp;gt;loadColumn($i);&lt;br /&gt;
  print_r($column);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give:&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( [0] =&amp;gt; John Smith [1] =&amp;gt; Magda Hellman [2] =&amp;gt; Yvonne de Gaulle )&lt;br /&gt;
Array ( [0] =&amp;gt; johnsmith@domain.example [1] =&amp;gt; magda_h@domain.example [2] =&amp;gt; ydg@domain.example )&lt;br /&gt;
Array ( [0] =&amp;gt; johnsmith [1] =&amp;gt; magdah [2] =&amp;gt; ydegaulle )&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
&lt;br /&gt;
=== Multi-Row Results ===&lt;br /&gt;
Each of these results functions will return multiple records from the database. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! id !! name !! email !! username&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 1 || John Smith || johnsmith@domain.example || johnsmith&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 2 || Magda Hellman || magda_h@domain.example || magdah&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 3 || Yvonne de Gaulle || ydg@domain.example || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== loadRowList() ====&lt;br /&gt;
loadRowList() returns an indexed array of indexed arrays from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadRowList();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[0] =&amp;gt; Array ( [0] =&amp;gt; 1 [1] =&amp;gt; John Smith [2] =&amp;gt; johnsmith@domain.example [3] =&amp;gt; johnsmith ) &lt;br /&gt;
[1] =&amp;gt; Array ( [0] =&amp;gt; 2 [1] =&amp;gt; Magda Hellman [2] =&amp;gt; magda_h@domain.example [3] =&amp;gt; magdah ) &lt;br /&gt;
[2] =&amp;gt; Array ( [0] =&amp;gt; 3 [1] =&amp;gt; Yvonne de Gaulle [2] =&amp;gt; ydg@domain.example [3] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;][&#039;index&#039;] // e.g. $row[&#039;2&#039;][&#039;3&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
&lt;br /&gt;
==== loadAssocList() ====&lt;br /&gt;
loadAssocList() returns an indexed array of associated arrays from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadAssocList();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[0] =&amp;gt; Array ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[1] =&amp;gt; Array ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[2] =&amp;gt; Array ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;][&#039;column_name&#039;] // e.g. $row[&#039;2&#039;][&#039;email&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== loadAssocList($key) ====&lt;br /&gt;
loadAssocList(&#039;key&#039;) returns an associated array - indexed on &#039;key&#039; - of associated arrays from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadAssocList(&#039;username&#039;);&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[johnsmith] =&amp;gt; Array ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[magdah] =&amp;gt; Array ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[ydegaulle] =&amp;gt; Array ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;] // e.g. $row[&#039;johnsmith&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;][&#039;column_name&#039;] // e.g. $row[&#039;johnsmith&#039;][&#039;email&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Key must be a valid column name from the table; it does not have to be an Index or a Primary Key. But if it does not have a unique value you may not be able to retrieve results reliably.&lt;br /&gt;
&lt;br /&gt;
==== loadObjectList() ====&lt;br /&gt;
loadObjectList() returns an indexed array of PHP objects from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadObjectList();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[0] =&amp;gt; stdClass Object ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith &lt;br /&gt;
    [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[1] =&amp;gt; stdClass Object ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman &lt;br /&gt;
    [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[2] =&amp;gt; stdClass Object ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle &lt;br /&gt;
    [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;index&#039;]-&amp;gt;name // e.g. $row[&#039;2&#039;]-&amp;gt;email&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== loadObjectList(&#039;key&#039;) ====&lt;br /&gt;
loadObjectList($key) returns an associated array - indexed on &#039;key&#039; - of objects from the table records returned by the query: &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$row = $db-&amp;gt;loadObjectList(&#039;username&#039;);&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&lt;br /&gt;
&amp;lt;pre&amp;gt;Array ( &lt;br /&gt;
[johnsmith] =&amp;gt; stdClass Object ( [id] =&amp;gt; 1 [name] =&amp;gt; John Smith &lt;br /&gt;
    [email] =&amp;gt; johnsmith@domain.example [username] =&amp;gt; johnsmith ) &lt;br /&gt;
[magdah] =&amp;gt; stdClass Object ( [id] =&amp;gt; 2 [name] =&amp;gt; Magda Hellman &lt;br /&gt;
    [email] =&amp;gt; magda_h@domain.example [username] =&amp;gt; magdah ) &lt;br /&gt;
[ydegaulle] =&amp;gt; stdClass Object ( [id] =&amp;gt; 3 [name] =&amp;gt; Yvonne de Gaulle &lt;br /&gt;
    [email] =&amp;gt; ydg@domain.example [username] =&amp;gt; ydegaulle ) &lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can access the individual rows by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;] // e.g. $row[&#039;johnsmith&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;]-&amp;gt;column_name // e.g. $row[&#039;johnsmith&#039;]-&amp;gt;email&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Key must be a valid column name from the table; it does not have to be an Index or a Primary Key. But if it does not have a unique value you may not be able to retrieve results reliably.&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous Result Set Methods ===&lt;br /&gt;
==== getNumRows() ====&lt;br /&gt;
getNumRows() will return the number of result rows found by the last query and waiting to be read. To get a result from getNumRows() you have to run it &#039;&#039;&#039;after&#039;&#039;&#039; the query and &#039;&#039;&#039;before&#039;&#039;&#039; you have retrieved any results.  &lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
. . .&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$db-&amp;gt;execute();&lt;br /&gt;
$num_rows = $db-&amp;gt;getNumRows();&lt;br /&gt;
print_r($num_rows);&lt;br /&gt;
$result = $db-&amp;gt;loadRowList();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will return &amp;lt;pre&amp;gt;3&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note: if you run getNumRows() after loadRowList() - or any other retrieval method - you may get a PHP Warning:&lt;br /&gt;
&amp;lt;pre&amp;gt;Warning: mysql_num_rows(): 80 is not a valid MySQL result resource &lt;br /&gt;
in libraries\joomla\database\database\mysql.php on line 344&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Extension development]]&lt;br /&gt;
[[Category:Database]]&lt;br /&gt;
[[Category:JFactory]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_backend_actions&amp;diff=107200</id>
		<title>J3.x:Developing an MVC Component/Adding backend actions</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_backend_actions&amp;diff=107200"/>
		<updated>2014-01-22T18:39:49Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Clarify JToolBarHelper reference and add link to further details&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Adding a toolbar ==&lt;br /&gt;
In Joomla, the administrator interacts generally with components through the use of a toolbar. In the file &#039;&#039;admin/views/helloworlds/view.html.php&#039;&#039; put this content. It will create a basic toolbar and a title for the component.&lt;br /&gt;
&lt;br /&gt;
The arguments used in, for example, JToolBarHelper::addNew is used to set a controller instance which will be used after button is clicked. Further details below in the [[#Adding_specific_controllers | adding specific controllers]] section.&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 JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * HelloWorlds view display method&lt;br /&gt;
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  mixed  A string if successful, otherwise a JError object.&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;
&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;));&lt;br /&gt;
		JToolBarHelper::deleteList(&#039;&#039;, &#039;helloworlds.delete&#039;);&lt;br /&gt;
		JToolBarHelper::editList(&#039;helloworld.edit&#039;);&lt;br /&gt;
		JToolBarHelper::addNew(&#039;helloworld.add&#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;
You can find other classic backend actions in the &#039;&#039;administrator/includes/toolbar.php&#039;&#039; file of your Joomla installation.&lt;br /&gt;
&lt;br /&gt;
Since the view can perform some actions, we have to add some input data. With your favorite file manager and editor, put in the file &#039;&#039;admin/views/helloworlds/tmpl/default.php&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/tmpl/default.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworlds/tmpl/default.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;
// load tooltip behavior&lt;br /&gt;
JHtml::_(&#039;behavior.tooltip&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;form action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php?option=com_helloworld&#039;); ?&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot; id=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;table class=&amp;quot;adminlist&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;thead&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;head&#039;);?&amp;gt;&amp;lt;/thead&amp;gt;&lt;br /&gt;
		&amp;lt;tfoot&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;foot&#039;);?&amp;gt;&amp;lt;/tfoot&amp;gt;&lt;br /&gt;
		&amp;lt;tbody&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;body&#039;);?&amp;gt;&amp;lt;/tbody&amp;gt;&lt;br /&gt;
	&amp;lt;/table&amp;gt;&lt;br /&gt;
	&amp;lt;div&amp;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;boxchecked&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;?php echo JHtml::_(&#039;form.token&#039;); ?&amp;gt;&lt;br /&gt;
	&amp;lt;/div&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;
== Adding specific controllers ==&lt;br /&gt;
Three actions have been added:&lt;br /&gt;
* &#039;&#039;helloworlds.delete&#039;&#039; &lt;br /&gt;
* &#039;&#039;helloworld.edit&#039;&#039;&lt;br /&gt;
* &#039;&#039;helloworld.add&#039;&#039;&lt;br /&gt;
read more about [[JController_and_its_subclass_usage_overview|subcontrollers...]]&lt;br /&gt;
&lt;br /&gt;
These are compound tasks (&#039;&#039;controller&#039;&#039;.&#039;&#039;task&#039;&#039;). So two new controllers &#039;&#039;HelloWorldControllerHelloWorlds&#039;&#039; and &#039;&#039;HelloWorldControllerHelloWorld&#039;&#039; have to be coded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/controllers/helloworlds.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/controllers/helloworlds.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 controlleradmin library&lt;br /&gt;
jimport(&#039;joomla.application.component.controlleradmin&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorlds Controller&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldControllerHelloWorlds extends JControllerAdmin&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Proxy for getModel.&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	public function getModel($name = &#039;HelloWorld&#039;, $prefix = &#039;HelloWorldModel&#039;) &lt;br /&gt;
	{&lt;br /&gt;
		$model = parent::getModel($name, $prefix, array(&#039;ignore_request&#039; =&amp;gt; true));&lt;br /&gt;
		return $model;&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/controllers/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/controllers/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 controllerform library&lt;br /&gt;
jimport(&#039;joomla.application.component.controllerform&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Controller&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldControllerHelloWorld extends JControllerForm&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;
== Adding an editing view ==&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;admin/views/helloworld/view.html.php&#039;&#039; containing:&lt;br /&gt;
&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 JViewLegacy&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;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Setting the toolbar&lt;br /&gt;
	 */&lt;br /&gt;
	protected function addToolBar() &lt;br /&gt;
	{&lt;br /&gt;
		$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
		$input-&amp;gt;set(&#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;));&lt;br /&gt;
		JToolBarHelper::save(&#039;helloworld.save&#039;);&lt;br /&gt;
		JToolBarHelper::cancel(&#039;helloworld.cancel&#039;, $isNew ? &#039;JTOOLBAR_CANCEL&#039;&lt;br /&gt;
		                                                   : &#039;JTOOLBAR_CLOSE&#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 will display data using a layout.&lt;br /&gt;
&lt;br /&gt;
Put a file &#039;&#039;admin/views/helloworld/tmpl/edit.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworld/tmpl/edit.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworld/tmpl/edit.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&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
JHtml::_(&#039;behavior.tooltip&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;form action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php?option=com_helloworld&amp;amp;layout=edit&amp;amp;id=&#039; . (int) $this-&amp;gt;item-&amp;gt;id); ?&amp;gt;&amp;quot;&lt;br /&gt;
    method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot; id=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;form-horizontal&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;fieldset class=&amp;quot;adminform&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;legend&amp;gt;&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_DETAILS&#039;); ?&amp;gt;&amp;lt;/legend&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&amp;quot;row-fluid&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&amp;quot;span6&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;?php foreach ($this-&amp;gt;form-&amp;gt;getFieldset() as $field): ?&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&amp;quot;control-group&amp;quot;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&amp;quot;control-label&amp;quot;&amp;gt;&amp;lt;?php echo $field-&amp;gt;label; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&amp;quot;controls&amp;quot;&amp;gt;&amp;lt;?php echo $field-&amp;gt;input; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;?php endforeach; ?&amp;gt;&lt;br /&gt;
                &amp;lt;div&amp;gt;&lt;br /&gt;
            &amp;lt;div&amp;gt;&lt;br /&gt;
        &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
    &amp;lt;div&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;helloworld.edit&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;?php echo JHtml::_(&#039;form.token&#039;); ?&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;
== Adding a model and modifying the existing one ==&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;HelloWorldViewHelloWorld&#039;&#039; view asks form and data from a model. This model has to provide a &#039;&#039;getTable&#039;&#039;, a &#039;&#039;getForm&#039;&#039; method and a &#039;&#039;loadData&#039;&#039; method (called from the &#039;&#039;JModelAdmin&#039;&#039; controller)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/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 modelform library&lt;br /&gt;
jimport(&#039;joomla.application.component.modeladmin&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelAdmin&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Returns a reference to the a Table object, always creating it.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param	type	The table type to instantiate&lt;br /&gt;
	 * @param	string	A prefix for the table class name. Optional.&lt;br /&gt;
	 * @param	array	Configuration array for model. Optional.&lt;br /&gt;
	 * @return	JTable	A database object&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	public function getTable($type = &#039;HelloWorld&#039;, $prefix = &#039;HelloWorldTable&#039;, $config = array()) &lt;br /&gt;
	{&lt;br /&gt;
		return JTable::getInstance($type, $prefix, $config);&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get the record form.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param	array	$data		Data for the form.&lt;br /&gt;
	 * @param	boolean	$loadData	True if the form is to load its own data (default case), false if not.&lt;br /&gt;
	 * @return	mixed	A JForm object on success, false on failure&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	public function getForm($data = array(), $loadData = true) &lt;br /&gt;
	{&lt;br /&gt;
		// Get the form.&lt;br /&gt;
		$form = $this-&amp;gt;loadForm(&#039;com_helloworld.helloworld&#039;, &#039;helloworld&#039;,&lt;br /&gt;
		                        array(&#039;control&#039; =&amp;gt; &#039;jform&#039;, &#039;load_data&#039; =&amp;gt; $loadData));&lt;br /&gt;
		if (empty($form)) &lt;br /&gt;
		{&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		return $form;&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get the data that should be injected in the form.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return	mixed	The data for the form.&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	protected function loadFormData() &lt;br /&gt;
	{&lt;br /&gt;
		// Check the session for previously entered form data.&lt;br /&gt;
		$data = JFactory::getApplication()-&amp;gt;getUserState(&#039;com_helloworld.edit.helloworld.data&#039;, array());&lt;br /&gt;
		if (empty($data)) &lt;br /&gt;
		{&lt;br /&gt;
			$data = $this-&amp;gt;getItem();&lt;br /&gt;
		}&lt;br /&gt;
		return $data;&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 model inherits from the &#039;&#039;JModelAdmin&#039;&#039; class and uses its &#039;&#039;loadForm&#039;&#039; method. This method searches for forms in the &#039;&#039;forms&#039;&#039; folder. With your favorite file manager and editor, put a file &#039;&#039;admin/models/forms/helloworld.xml&#039;&#039; containing:&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&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_GREETING_LABEL&amp;quot;&lt;br /&gt;
			description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_GREETING_DESC&amp;quot;&lt;br /&gt;
			size=&amp;quot;40&amp;quot;&lt;br /&gt;
			class=&amp;quot;inputbox&amp;quot;&lt;br /&gt;
			default=&amp;quot;&amp;quot;&lt;br /&gt;
		/&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;
== 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;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_backend_actions#admin/models/helloworlds.php|admin/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_backend_actions#admin/models/helloworlds.php|admin/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_backend_actions#admin/models/helloworlds.php|admin/models/forms/helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_backend_actions#admin/models/helloworlds.php|admin/controllers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_backend_actions#admin/models/helloworlds.php|admin/controllers/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_backend_actions#admin/models/helloworlds.php|admin/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/language/index.html|admin/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/language/en-GB/index.html|admin/language/en-GB/index.html]]&#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;[[#admin/language/en-GB/en-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#language/en-GB/en-GB.com_helloworld.sys.ini|language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-9-adding-backend-actions.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.9&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;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu&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;!-- admin languages files section --&amp;gt;&lt;br /&gt;
                        &amp;lt;folder&amp;gt;language&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;
	&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;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Adding language management &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|next=Adding decorations to the backend &amp;lt;!-- next article subpage name --&amp;gt;}}&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:betweenbrain|Matt Thomas]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_backend_actions&amp;diff=107185</id>
		<title>J3.x:Developing an MVC Component/Adding backend actions</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_backend_actions&amp;diff=107185"/>
		<updated>2014-01-21T22:25:19Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Updates archive link to point to Github repo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Adding a toolbar ==&lt;br /&gt;
In Joomla, the administrator interacts generally with components through the use of a toolbar. In the file &#039;&#039;admin/views/helloworlds/view.html.php&#039;&#039; put this content. It will create a basic toolbar and a title for the component.&lt;br /&gt;
&lt;br /&gt;
The args used in ex. JToolBarHelper::addNew is used to set a controller instance which will be used after button is clicked.&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 JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * HelloWorlds view display method&lt;br /&gt;
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  mixed  A string if successful, otherwise a JError object.&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;
&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;));&lt;br /&gt;
		JToolBarHelper::deleteList(&#039;&#039;, &#039;helloworlds.delete&#039;);&lt;br /&gt;
		JToolBarHelper::editList(&#039;helloworld.edit&#039;);&lt;br /&gt;
		JToolBarHelper::addNew(&#039;helloworld.add&#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;
You can find other classic backend actions in the &#039;&#039;administrator/includes/toolbar.php&#039;&#039; file of your Joomla installation.&lt;br /&gt;
&lt;br /&gt;
Since the view can perform some actions, we have to add some input data. With your favorite file manager and editor, put in the file &#039;&#039;admin/views/helloworlds/tmpl/default.php&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/tmpl/default.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworlds/tmpl/default.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;
// load tooltip behavior&lt;br /&gt;
JHtml::_(&#039;behavior.tooltip&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;form action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php?option=com_helloworld&#039;); ?&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot; id=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;table class=&amp;quot;adminlist&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;thead&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;head&#039;);?&amp;gt;&amp;lt;/thead&amp;gt;&lt;br /&gt;
		&amp;lt;tfoot&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;foot&#039;);?&amp;gt;&amp;lt;/tfoot&amp;gt;&lt;br /&gt;
		&amp;lt;tbody&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;body&#039;);?&amp;gt;&amp;lt;/tbody&amp;gt;&lt;br /&gt;
	&amp;lt;/table&amp;gt;&lt;br /&gt;
	&amp;lt;div&amp;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;boxchecked&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;?php echo JHtml::_(&#039;form.token&#039;); ?&amp;gt;&lt;br /&gt;
	&amp;lt;/div&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;
== Adding specific controllers ==&lt;br /&gt;
Three actions have been added:&lt;br /&gt;
* &#039;&#039;helloworlds.delete&#039;&#039; &lt;br /&gt;
* &#039;&#039;helloworld.edit&#039;&#039;&lt;br /&gt;
* &#039;&#039;helloworld.add&#039;&#039;&lt;br /&gt;
read more about [[JController_and_its_subclass_usage_overview|subcontrollers...]]&lt;br /&gt;
&lt;br /&gt;
These are compound tasks (&#039;&#039;controller&#039;&#039;.&#039;&#039;task&#039;&#039;). So two new controllers &#039;&#039;HelloWorldControllerHelloWorlds&#039;&#039; and &#039;&#039;HelloWorldControllerHelloWorld&#039;&#039; have to be coded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/controllers/helloworlds.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/controllers/helloworlds.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 controlleradmin library&lt;br /&gt;
jimport(&#039;joomla.application.component.controlleradmin&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorlds Controller&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldControllerHelloWorlds extends JControllerAdmin&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Proxy for getModel.&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	public function getModel($name = &#039;HelloWorld&#039;, $prefix = &#039;HelloWorldModel&#039;) &lt;br /&gt;
	{&lt;br /&gt;
		$model = parent::getModel($name, $prefix, array(&#039;ignore_request&#039; =&amp;gt; true));&lt;br /&gt;
		return $model;&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/controllers/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/controllers/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 controllerform library&lt;br /&gt;
jimport(&#039;joomla.application.component.controllerform&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Controller&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldControllerHelloWorld extends JControllerForm&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;
== Adding an editing view ==&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;admin/views/helloworld/view.html.php&#039;&#039; containing:&lt;br /&gt;
&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;
	 * 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;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Setting the toolbar&lt;br /&gt;
	 */&lt;br /&gt;
	protected function addToolBar() &lt;br /&gt;
	{&lt;br /&gt;
		$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
		$input-&amp;gt;set(&#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;));&lt;br /&gt;
		JToolBarHelper::save(&#039;helloworld.save&#039;);&lt;br /&gt;
		JToolBarHelper::cancel(&#039;helloworld.cancel&#039;, $isNew ? &#039;JTOOLBAR_CANCEL&#039;&lt;br /&gt;
		                                                   : &#039;JTOOLBAR_CLOSE&#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 will display data using a layout.&lt;br /&gt;
&lt;br /&gt;
Put a file &#039;&#039;admin/views/helloworld/tmpl/edit.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworld/tmpl/edit.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworld/tmpl/edit.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&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
JHtml::_(&#039;behavior.tooltip&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;form action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php?option=com_helloworld&amp;amp;layout=edit&amp;amp;id=&#039; . (int) $this-&amp;gt;item-&amp;gt;id); ?&amp;gt;&amp;quot;&lt;br /&gt;
    method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot; id=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;form-horizontal&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;fieldset class=&amp;quot;adminform&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;legend&amp;gt;&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_DETAILS&#039;); ?&amp;gt;&amp;lt;/legend&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&amp;quot;row-fluid&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&amp;quot;span6&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;?php foreach ($this-&amp;gt;form-&amp;gt;getFieldset() as $field): ?&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&amp;quot;control-group&amp;quot;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&amp;quot;control-label&amp;quot;&amp;gt;&amp;lt;?php echo $field-&amp;gt;label; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&amp;quot;controls&amp;quot;&amp;gt;&amp;lt;?php echo $field-&amp;gt;input; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;?php endforeach; ?&amp;gt;&lt;br /&gt;
                &amp;lt;div&amp;gt;&lt;br /&gt;
            &amp;lt;div&amp;gt;&lt;br /&gt;
        &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
    &amp;lt;div&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;helloworld.edit&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;?php echo JHtml::_(&#039;form.token&#039;); ?&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;
== Adding a model and modifying the existing one ==&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;HelloWorldViewHelloWorld&#039;&#039; view asks form and data from a model. This model has to provide a &#039;&#039;getTable&#039;&#039;, a &#039;&#039;getForm&#039;&#039; method and a &#039;&#039;loadData&#039;&#039; method (called from the &#039;&#039;JModelAdmin&#039;&#039; controller)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/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 modelform library&lt;br /&gt;
jimport(&#039;joomla.application.component.modeladmin&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelAdmin&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Returns a reference to the a Table object, always creating it.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param	type	The table type to instantiate&lt;br /&gt;
	 * @param	string	A prefix for the table class name. Optional.&lt;br /&gt;
	 * @param	array	Configuration array for model. Optional.&lt;br /&gt;
	 * @return	JTable	A database object&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	public function getTable($type = &#039;HelloWorld&#039;, $prefix = &#039;HelloWorldTable&#039;, $config = array()) &lt;br /&gt;
	{&lt;br /&gt;
		return JTable::getInstance($type, $prefix, $config);&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get the record form.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param	array	$data		Data for the form.&lt;br /&gt;
	 * @param	boolean	$loadData	True if the form is to load its own data (default case), false if not.&lt;br /&gt;
	 * @return	mixed	A JForm object on success, false on failure&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	public function getForm($data = array(), $loadData = true) &lt;br /&gt;
	{&lt;br /&gt;
		// Get the form.&lt;br /&gt;
		$form = $this-&amp;gt;loadForm(&#039;com_helloworld.helloworld&#039;, &#039;helloworld&#039;,&lt;br /&gt;
		                        array(&#039;control&#039; =&amp;gt; &#039;jform&#039;, &#039;load_data&#039; =&amp;gt; $loadData));&lt;br /&gt;
		if (empty($form)) &lt;br /&gt;
		{&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		return $form;&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get the data that should be injected in the form.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return	mixed	The data for the form.&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	protected function loadFormData() &lt;br /&gt;
	{&lt;br /&gt;
		// Check the session for previously entered form data.&lt;br /&gt;
		$data = JFactory::getApplication()-&amp;gt;getUserState(&#039;com_helloworld.edit.helloworld.data&#039;, array());&lt;br /&gt;
		if (empty($data)) &lt;br /&gt;
		{&lt;br /&gt;
			$data = $this-&amp;gt;getItem();&lt;br /&gt;
		}&lt;br /&gt;
		return $data;&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 model inherits from the &#039;&#039;JModelAdmin&#039;&#039; class and uses its &#039;&#039;loadForm&#039;&#039; method. This method searches for forms in the &#039;&#039;forms&#039;&#039; folder. With your favorite file manager and editor, put a file &#039;&#039;admin/models/forms/helloworld.xml&#039;&#039; containing:&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&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_GREETING_LABEL&amp;quot;&lt;br /&gt;
			description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_GREETING_DESC&amp;quot;&lt;br /&gt;
			size=&amp;quot;40&amp;quot;&lt;br /&gt;
			class=&amp;quot;inputbox&amp;quot;&lt;br /&gt;
			default=&amp;quot;&amp;quot;&lt;br /&gt;
		/&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;
== 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;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#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;[[#admin/language/en-GB/en-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#language/en-GB/en-GB.com_helloworld.sys.ini|language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-9-adding-backend-actions.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.9&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;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu&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;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Basic backend &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|next=Adding backend actions &amp;lt;!-- next article subpage name --&amp;gt;}}&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:betweenbrain|Matt Thomas]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_backend_actions&amp;diff=107183</id>
		<title>J3.x:Developing an MVC Component/Adding backend actions</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_backend_actions&amp;diff=107183"/>
		<updated>2014-01-21T22:24:27Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Removes redundant multi-part notice&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Adding a toolbar ==&lt;br /&gt;
In Joomla, the administrator interacts generally with components through the use of a toolbar. In the file &#039;&#039;admin/views/helloworlds/view.html.php&#039;&#039; put this content. It will create a basic toolbar and a title for the component.&lt;br /&gt;
&lt;br /&gt;
The args used in ex. JToolBarHelper::addNew is used to set a controller instance which will be used after button is clicked.&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;
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  mixed  A string if successful, otherwise a JError object.&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;
&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;));&lt;br /&gt;
		JToolBarHelper::deleteList(&#039;&#039;, &#039;helloworlds.delete&#039;);&lt;br /&gt;
		JToolBarHelper::editList(&#039;helloworld.edit&#039;);&lt;br /&gt;
		JToolBarHelper::addNew(&#039;helloworld.add&#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;
You can find other classic backend actions in the &#039;&#039;administrator/includes/toolbar.php&#039;&#039; file of your Joomla installation.&lt;br /&gt;
&lt;br /&gt;
Since the view can perform some actions, we have to add some input data. With your favorite file manager and editor, put in the file &#039;&#039;admin/views/helloworlds/tmpl/default.php&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/tmpl/default.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworlds/tmpl/default.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;
// load tooltip behavior&lt;br /&gt;
JHtml::_(&#039;behavior.tooltip&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;form action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php?option=com_helloworld&#039;); ?&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot; id=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;table class=&amp;quot;adminlist&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;thead&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;head&#039;);?&amp;gt;&amp;lt;/thead&amp;gt;&lt;br /&gt;
		&amp;lt;tfoot&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;foot&#039;);?&amp;gt;&amp;lt;/tfoot&amp;gt;&lt;br /&gt;
		&amp;lt;tbody&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;body&#039;);?&amp;gt;&amp;lt;/tbody&amp;gt;&lt;br /&gt;
	&amp;lt;/table&amp;gt;&lt;br /&gt;
	&amp;lt;div&amp;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;boxchecked&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;?php echo JHtml::_(&#039;form.token&#039;); ?&amp;gt;&lt;br /&gt;
	&amp;lt;/div&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;
== Adding specific controllers ==&lt;br /&gt;
Three actions have been added:&lt;br /&gt;
* &#039;&#039;helloworlds.delete&#039;&#039; &lt;br /&gt;
* &#039;&#039;helloworld.edit&#039;&#039;&lt;br /&gt;
* &#039;&#039;helloworld.add&#039;&#039;&lt;br /&gt;
read more about [[JController_and_its_subclass_usage_overview|subcontrollers...]]&lt;br /&gt;
&lt;br /&gt;
These are compound tasks (&#039;&#039;controller&#039;&#039;.&#039;&#039;task&#039;&#039;). So two new controllers &#039;&#039;HelloWorldControllerHelloWorlds&#039;&#039; and &#039;&#039;HelloWorldControllerHelloWorld&#039;&#039; have to be coded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/controllers/helloworlds.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/controllers/helloworlds.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 controlleradmin library&lt;br /&gt;
jimport(&#039;joomla.application.component.controlleradmin&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorlds Controller&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldControllerHelloWorlds extends JControllerAdmin&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Proxy for getModel.&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	public function getModel($name = &#039;HelloWorld&#039;, $prefix = &#039;HelloWorldModel&#039;) &lt;br /&gt;
	{&lt;br /&gt;
		$model = parent::getModel($name, $prefix, array(&#039;ignore_request&#039; =&amp;gt; true));&lt;br /&gt;
		return $model;&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/controllers/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/controllers/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 controllerform library&lt;br /&gt;
jimport(&#039;joomla.application.component.controllerform&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Controller&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldControllerHelloWorld extends JControllerForm&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;
== Adding an editing view ==&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;admin/views/helloworld/view.html.php&#039;&#039; containing:&lt;br /&gt;
&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;
	 * 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;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Setting the toolbar&lt;br /&gt;
	 */&lt;br /&gt;
	protected function addToolBar() &lt;br /&gt;
	{&lt;br /&gt;
		$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
		$input-&amp;gt;set(&#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;));&lt;br /&gt;
		JToolBarHelper::save(&#039;helloworld.save&#039;);&lt;br /&gt;
		JToolBarHelper::cancel(&#039;helloworld.cancel&#039;, $isNew ? &#039;JTOOLBAR_CANCEL&#039;&lt;br /&gt;
		                                                   : &#039;JTOOLBAR_CLOSE&#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 will display data using a layout.&lt;br /&gt;
&lt;br /&gt;
Put a file &#039;&#039;admin/views/helloworld/tmpl/edit.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworld/tmpl/edit.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworld/tmpl/edit.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&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
JHtml::_(&#039;behavior.tooltip&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;form action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php?option=com_helloworld&amp;amp;layout=edit&amp;amp;id=&#039; . (int) $this-&amp;gt;item-&amp;gt;id); ?&amp;gt;&amp;quot;&lt;br /&gt;
    method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot; id=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;form-horizontal&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;fieldset class=&amp;quot;adminform&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;legend&amp;gt;&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_DETAILS&#039;); ?&amp;gt;&amp;lt;/legend&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&amp;quot;row-fluid&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&amp;quot;span6&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;?php foreach ($this-&amp;gt;form-&amp;gt;getFieldset() as $field): ?&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&amp;quot;control-group&amp;quot;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&amp;quot;control-label&amp;quot;&amp;gt;&amp;lt;?php echo $field-&amp;gt;label; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&amp;quot;controls&amp;quot;&amp;gt;&amp;lt;?php echo $field-&amp;gt;input; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;?php endforeach; ?&amp;gt;&lt;br /&gt;
                &amp;lt;div&amp;gt;&lt;br /&gt;
            &amp;lt;div&amp;gt;&lt;br /&gt;
        &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
    &amp;lt;div&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;helloworld.edit&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;?php echo JHtml::_(&#039;form.token&#039;); ?&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;
== Adding a model and modifying the existing one ==&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;HelloWorldViewHelloWorld&#039;&#039; view asks form and data from a model. This model has to provide a &#039;&#039;getTable&#039;&#039;, a &#039;&#039;getForm&#039;&#039; method and a &#039;&#039;loadData&#039;&#039; method (called from the &#039;&#039;JModelAdmin&#039;&#039; controller)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/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 modelform library&lt;br /&gt;
jimport(&#039;joomla.application.component.modeladmin&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelAdmin&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Returns a reference to the a Table object, always creating it.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param	type	The table type to instantiate&lt;br /&gt;
	 * @param	string	A prefix for the table class name. Optional.&lt;br /&gt;
	 * @param	array	Configuration array for model. Optional.&lt;br /&gt;
	 * @return	JTable	A database object&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	public function getTable($type = &#039;HelloWorld&#039;, $prefix = &#039;HelloWorldTable&#039;, $config = array()) &lt;br /&gt;
	{&lt;br /&gt;
		return JTable::getInstance($type, $prefix, $config);&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get the record form.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param	array	$data		Data for the form.&lt;br /&gt;
	 * @param	boolean	$loadData	True if the form is to load its own data (default case), false if not.&lt;br /&gt;
	 * @return	mixed	A JForm object on success, false on failure&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	public function getForm($data = array(), $loadData = true) &lt;br /&gt;
	{&lt;br /&gt;
		// Get the form.&lt;br /&gt;
		$form = $this-&amp;gt;loadForm(&#039;com_helloworld.helloworld&#039;, &#039;helloworld&#039;,&lt;br /&gt;
		                        array(&#039;control&#039; =&amp;gt; &#039;jform&#039;, &#039;load_data&#039; =&amp;gt; $loadData));&lt;br /&gt;
		if (empty($form)) &lt;br /&gt;
		{&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		return $form;&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get the data that should be injected in the form.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return	mixed	The data for the form.&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	protected function loadFormData() &lt;br /&gt;
	{&lt;br /&gt;
		// Check the session for previously entered form data.&lt;br /&gt;
		$data = JFactory::getApplication()-&amp;gt;getUserState(&#039;com_helloworld.edit.helloworld.data&#039;, array());&lt;br /&gt;
		if (empty($data)) &lt;br /&gt;
		{&lt;br /&gt;
			$data = $this-&amp;gt;getItem();&lt;br /&gt;
		}&lt;br /&gt;
		return $data;&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 model inherits from the &#039;&#039;JModelAdmin&#039;&#039; class and uses its &#039;&#039;loadForm&#039;&#039; method. This method searches for forms in the &#039;&#039;forms&#039;&#039; folder. With your favorite file manager and editor, put a file &#039;&#039;admin/models/forms/helloworld.xml&#039;&#039; containing:&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&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_GREETING_LABEL&amp;quot;&lt;br /&gt;
			description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_GREETING_DESC&amp;quot;&lt;br /&gt;
			size=&amp;quot;40&amp;quot;&lt;br /&gt;
			class=&amp;quot;inputbox&amp;quot;&lt;br /&gt;
			default=&amp;quot;&amp;quot;&lt;br /&gt;
		/&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;
== 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;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#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;[[#admin/language/en-GB/en-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#language/en-GB/en-GB.com_helloworld.sys.ini|language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-8-adding-language-management.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.9&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;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu&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;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Basic backend &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|next=Adding backend actions &amp;lt;!-- next article subpage name --&amp;gt;}}&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:betweenbrain|Matt Thomas]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_backend_actions&amp;diff=107182</id>
		<title>J3.x:Developing an MVC Component/Adding backend actions</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_backend_actions&amp;diff=107182"/>
		<updated>2014-01-21T22:21:13Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|{{CurrentSTSVer|minor}}}}.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Adding a toolbar ==&lt;br /&gt;
In Joomla, the administrator interacts generally with components through the use of a toolbar. In the file &#039;&#039;admin/views/helloworlds/view.html.php&#039;&#039; put this content. It will create a basic toolbar and a title for the component.&lt;br /&gt;
&lt;br /&gt;
The args used in ex. JToolBarHelper::addNew is used to set a controller instance which will be used after button is clicked.&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;
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  mixed  A string if successful, otherwise a JError object.&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;
&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;));&lt;br /&gt;
		JToolBarHelper::deleteList(&#039;&#039;, &#039;helloworlds.delete&#039;);&lt;br /&gt;
		JToolBarHelper::editList(&#039;helloworld.edit&#039;);&lt;br /&gt;
		JToolBarHelper::addNew(&#039;helloworld.add&#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;
You can find other classic backend actions in the &#039;&#039;administrator/includes/toolbar.php&#039;&#039; file of your Joomla installation.&lt;br /&gt;
&lt;br /&gt;
Since the view can perform some actions, we have to add some input data. With your favorite file manager and editor, put in the file &#039;&#039;admin/views/helloworlds/tmpl/default.php&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/tmpl/default.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworlds/tmpl/default.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;
// load tooltip behavior&lt;br /&gt;
JHtml::_(&#039;behavior.tooltip&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;form action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php?option=com_helloworld&#039;); ?&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot; id=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;table class=&amp;quot;adminlist&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;thead&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;head&#039;);?&amp;gt;&amp;lt;/thead&amp;gt;&lt;br /&gt;
		&amp;lt;tfoot&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;foot&#039;);?&amp;gt;&amp;lt;/tfoot&amp;gt;&lt;br /&gt;
		&amp;lt;tbody&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;body&#039;);?&amp;gt;&amp;lt;/tbody&amp;gt;&lt;br /&gt;
	&amp;lt;/table&amp;gt;&lt;br /&gt;
	&amp;lt;div&amp;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;boxchecked&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;?php echo JHtml::_(&#039;form.token&#039;); ?&amp;gt;&lt;br /&gt;
	&amp;lt;/div&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;
== Adding specific controllers ==&lt;br /&gt;
Three actions have been added:&lt;br /&gt;
* &#039;&#039;helloworlds.delete&#039;&#039; &lt;br /&gt;
* &#039;&#039;helloworld.edit&#039;&#039;&lt;br /&gt;
* &#039;&#039;helloworld.add&#039;&#039;&lt;br /&gt;
read more about [[JController_and_its_subclass_usage_overview|subcontrollers...]]&lt;br /&gt;
&lt;br /&gt;
These are compound tasks (&#039;&#039;controller&#039;&#039;.&#039;&#039;task&#039;&#039;). So two new controllers &#039;&#039;HelloWorldControllerHelloWorlds&#039;&#039; and &#039;&#039;HelloWorldControllerHelloWorld&#039;&#039; have to be coded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/controllers/helloworlds.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/controllers/helloworlds.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 controlleradmin library&lt;br /&gt;
jimport(&#039;joomla.application.component.controlleradmin&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorlds Controller&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldControllerHelloWorlds extends JControllerAdmin&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Proxy for getModel.&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	public function getModel($name = &#039;HelloWorld&#039;, $prefix = &#039;HelloWorldModel&#039;) &lt;br /&gt;
	{&lt;br /&gt;
		$model = parent::getModel($name, $prefix, array(&#039;ignore_request&#039; =&amp;gt; true));&lt;br /&gt;
		return $model;&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/controllers/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/controllers/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 controllerform library&lt;br /&gt;
jimport(&#039;joomla.application.component.controllerform&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Controller&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldControllerHelloWorld extends JControllerForm&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;
== Adding an editing view ==&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;admin/views/helloworld/view.html.php&#039;&#039; containing:&lt;br /&gt;
&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;
	 * 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;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Setting the toolbar&lt;br /&gt;
	 */&lt;br /&gt;
	protected function addToolBar() &lt;br /&gt;
	{&lt;br /&gt;
		$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
		$input-&amp;gt;set(&#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;));&lt;br /&gt;
		JToolBarHelper::save(&#039;helloworld.save&#039;);&lt;br /&gt;
		JToolBarHelper::cancel(&#039;helloworld.cancel&#039;, $isNew ? &#039;JTOOLBAR_CANCEL&#039;&lt;br /&gt;
		                                                   : &#039;JTOOLBAR_CLOSE&#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 will display data using a layout.&lt;br /&gt;
&lt;br /&gt;
Put a file &#039;&#039;admin/views/helloworld/tmpl/edit.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworld/tmpl/edit.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworld/tmpl/edit.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&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
JHtml::_(&#039;behavior.tooltip&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;form action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php?option=com_helloworld&amp;amp;layout=edit&amp;amp;id=&#039; . (int) $this-&amp;gt;item-&amp;gt;id); ?&amp;gt;&amp;quot;&lt;br /&gt;
    method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot; id=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;form-horizontal&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;fieldset class=&amp;quot;adminform&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;legend&amp;gt;&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_DETAILS&#039;); ?&amp;gt;&amp;lt;/legend&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&amp;quot;row-fluid&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&amp;quot;span6&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;?php foreach ($this-&amp;gt;form-&amp;gt;getFieldset() as $field): ?&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&amp;quot;control-group&amp;quot;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&amp;quot;control-label&amp;quot;&amp;gt;&amp;lt;?php echo $field-&amp;gt;label; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&amp;quot;controls&amp;quot;&amp;gt;&amp;lt;?php echo $field-&amp;gt;input; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;?php endforeach; ?&amp;gt;&lt;br /&gt;
                &amp;lt;div&amp;gt;&lt;br /&gt;
            &amp;lt;div&amp;gt;&lt;br /&gt;
        &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
    &amp;lt;div&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;helloworld.edit&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;?php echo JHtml::_(&#039;form.token&#039;); ?&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;
== Adding a model and modifying the existing one ==&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;HelloWorldViewHelloWorld&#039;&#039; view asks form and data from a model. This model has to provide a &#039;&#039;getTable&#039;&#039;, a &#039;&#039;getForm&#039;&#039; method and a &#039;&#039;loadData&#039;&#039; method (called from the &#039;&#039;JModelAdmin&#039;&#039; controller)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/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 modelform library&lt;br /&gt;
jimport(&#039;joomla.application.component.modeladmin&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelAdmin&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Returns a reference to the a Table object, always creating it.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param	type	The table type to instantiate&lt;br /&gt;
	 * @param	string	A prefix for the table class name. Optional.&lt;br /&gt;
	 * @param	array	Configuration array for model. Optional.&lt;br /&gt;
	 * @return	JTable	A database object&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	public function getTable($type = &#039;HelloWorld&#039;, $prefix = &#039;HelloWorldTable&#039;, $config = array()) &lt;br /&gt;
	{&lt;br /&gt;
		return JTable::getInstance($type, $prefix, $config);&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get the record form.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param	array	$data		Data for the form.&lt;br /&gt;
	 * @param	boolean	$loadData	True if the form is to load its own data (default case), false if not.&lt;br /&gt;
	 * @return	mixed	A JForm object on success, false on failure&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	public function getForm($data = array(), $loadData = true) &lt;br /&gt;
	{&lt;br /&gt;
		// Get the form.&lt;br /&gt;
		$form = $this-&amp;gt;loadForm(&#039;com_helloworld.helloworld&#039;, &#039;helloworld&#039;,&lt;br /&gt;
		                        array(&#039;control&#039; =&amp;gt; &#039;jform&#039;, &#039;load_data&#039; =&amp;gt; $loadData));&lt;br /&gt;
		if (empty($form)) &lt;br /&gt;
		{&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		return $form;&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get the data that should be injected in the form.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return	mixed	The data for the form.&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	protected function loadFormData() &lt;br /&gt;
	{&lt;br /&gt;
		// Check the session for previously entered form data.&lt;br /&gt;
		$data = JFactory::getApplication()-&amp;gt;getUserState(&#039;com_helloworld.edit.helloworld.data&#039;, array());&lt;br /&gt;
		if (empty($data)) &lt;br /&gt;
		{&lt;br /&gt;
			$data = $this-&amp;gt;getItem();&lt;br /&gt;
		}&lt;br /&gt;
		return $data;&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 model inherits from the &#039;&#039;JModelAdmin&#039;&#039; class and uses its &#039;&#039;loadForm&#039;&#039; method. This method searches for forms in the &#039;&#039;forms&#039;&#039; folder. With your favorite file manager and editor, put a file &#039;&#039;admin/models/forms/helloworld.xml&#039;&#039; containing:&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&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_GREETING_LABEL&amp;quot;&lt;br /&gt;
			description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_GREETING_DESC&amp;quot;&lt;br /&gt;
			size=&amp;quot;40&amp;quot;&lt;br /&gt;
			class=&amp;quot;inputbox&amp;quot;&lt;br /&gt;
			default=&amp;quot;&amp;quot;&lt;br /&gt;
		/&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;
== 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;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#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;[[#admin/language/en-GB/en-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#language/en-GB/en-GB.com_helloworld.sys.ini|language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-8-adding-language-management.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.9&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;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu&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;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Basic backend &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|next=Adding backend actions &amp;lt;!-- next article subpage name --&amp;gt;}}&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:betweenbrain|Matt Thomas]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_language_management&amp;diff=107175</id>
		<title>J3.x:Developing an MVC Component/Adding language management</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_language_management&amp;diff=107175"/>
		<updated>2014-01-21T21:01:47Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Removes Adding translation when installing the component section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|{{CurrentSTSVer|minor}}}}.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
Joomla!3.2 manages languages for components in four different situations:&lt;br /&gt;
* displaying a component in the public site&lt;br /&gt;
* managing a component in the backend&lt;br /&gt;
* managing menus in the backend&lt;br /&gt;
* installing a component&lt;br /&gt;
&lt;br /&gt;
Joomla!3.2 uses two different location folder for languages:&lt;br /&gt;
* one in &#039;&#039;administrator/language&#039;&#039; or &#039;&#039;language&#039;&#039;&lt;br /&gt;
* one in the component folder (&#039;&#039;administrator/components/*component*/language&#039;&#039; or &#039;&#039;components/*component*/language&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
It depends how the component is installed.&lt;br /&gt;
&lt;br /&gt;
== Adding language translation in the public site ==&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;site/language/en-GB/en-GB.com_helloworld.ini&#039;&#039;. This file will contain translation for the public part. For the moment, this file is empty&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/language/en-GB/en-GB.com_helloworld.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the moment, there are no translations strings in this file.&lt;br /&gt;
&lt;br /&gt;
== Adding language translation when managing the component ==&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.ini&#039;&#039;. This file will contain translation for the backend part.&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_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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding language translation when managing the menus in the backend ==&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.ini&#039;&#039;. This file will contain translation for the backend part.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/language/en-GB/en-GB.com_helloworld.sys.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.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_DESCRIPTION=&amp;quot;This is the Hello World description&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE=&amp;quot;Hello World&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC=&amp;quot;This view displays a selected message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MENU=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Language File Location Options ==&lt;br /&gt;
Starting with version 1.7 there are 2 ways to install language files for an extension.&lt;br /&gt;
One can use one or the other or a combination of both.&lt;br /&gt;
&lt;br /&gt;
The 1.5 way will install the files in the CORE language folders (ROOT/administrator/language/ and ROOT/language/ ).&lt;br /&gt;
Since 1.6— includes the files in a &amp;quot;language&amp;quot; folder installed at the root of the extension.&lt;br /&gt;
&lt;br /&gt;
Therefore an extension can include a language folder with a .sys.ini different from the one installed in joomla core language folders (this last one not being included in that language folder but in root or any other folder not installed).&lt;br /&gt;
This let&#039;s display 2 different descriptions: one from the sys.ini in the &amp;quot;language&amp;quot; folder is used as a message displayed when install has been done, the other (from the .ini) is used for &amp;quot;normal&amp;quot; operation, i.e. when the extension is edited in back-end.&lt;br /&gt;
This can be extremely useful when installing also uses some scripts and requires a different value for the description.&lt;br /&gt;
&lt;br /&gt;
{{tip|The sys.ini file is also used to translate the name of the extensions in some back-end Managers and to provide menu translation for components.|title=You Should Note!}}&lt;br /&gt;
&lt;br /&gt;
Therefore, the xml would include since 1.6&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;files&amp;gt;&lt;br /&gt;
&amp;lt;[...]&lt;br /&gt;
&amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;  // This folder HAS to include the right subfolders, i.e. language/en-GB/ ... language/fr-FR/&lt;br /&gt;
&amp;lt;filename&amp;gt;whatever&amp;lt;/filename&amp;gt;&lt;br /&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;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;[...]&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;whatever&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;[...]&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/administration&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and/or then (1.5 way):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;languages folder=&amp;quot;joomlacorelanguagefolders&amp;quot;&amp;gt; // if using another language folder for cleanliness (any folder name will fit)&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB/en-GB.whatever.ini&amp;lt;/language&amp;gt; // or&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.whatever.ini&amp;lt;/language&amp;gt; if no tagged subfolder&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB/en-GB.whatever.sys.ini&amp;lt;/language&amp;gt; // or&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.whatever.sys.ini&amp;lt;/language&amp;gt; if no tagged subfolder&lt;br /&gt;
&amp;lt;/languages&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or simply in ROOT&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;languages&amp;gt;&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.whatever.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.whatever.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;/languages&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Language file used by the install script during install of a component(&#039;&#039;the first install&#039;&#039; not upgrade) obeys specific rules described in the article, [[Specification of language files]]. During the first install, only the language file included in the component folder &amp;lt;code&amp;gt;(/administrator/components/com_helloworld/language)&amp;lt;/code&amp;gt; is used when present. If this file is only provided in the CORE language folder &amp;lt;code&amp;gt;(/administrator/language)&amp;lt;/code&amp;gt;, no translation occurs. This also applies to KEYs used in the manifest file.&lt;br /&gt;
&lt;br /&gt;
When upgrading or uninstalling the extension (not installing), it is the sys.ini file present in the extension root language folder which will display the result of the install from the description key/value. Thereafter, if present, the sys.ini as well as the ini installed in CORE language folder will have priority over the files present in the root language folder of the extension.&lt;br /&gt;
&lt;br /&gt;
{{tip|title=Advantages of Extension &amp;quot;Language&amp;quot; Folder|&#039;&#039;One advantage of installing the files in the extension &amp;quot;language&amp;quot; folder is that these &#039;&#039;&#039;are not touched when updating&#039;&#039;&#039; a language pack.&#039;&#039;{{-}}The other advantage is that this folder can include multiple languages (en-GB always, fr-FR, it-IT, etc.) not requiring the user to install the corresponding language pack. This is handy as they are available if, later on, a user installs the corresponding pack.}}&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;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#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;[[#admin/language/en-GB/en-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#language/en-GB/en-GB.com_helloworld.sys.ini|language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-8-adding-language-management.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;3.2.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;January 2014&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.8&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;administration&amp;gt;&lt;br /&gt;
        &amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
        &amp;lt;menu&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;!-- admin languages files section --&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;
    &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;
In this &#039;&#039;helloworld.xml&#039;&#039; file, languages are installed in:&lt;br /&gt;
* &#039;&#039;administrator/language&#039;&#039; for the admin part (look at the xml languages tag)&lt;br /&gt;
* &#039;&#039;components/com_helloworld/language&#039;&#039; for the site part (there are no xml languages tag in the site part of the xml description file, but the language folder is included)&lt;br /&gt;
&lt;br /&gt;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Basic backend &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
|next=Adding backend actions &amp;lt;!-- next article subpage name --&amp;gt;}}&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:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_language_management&amp;diff=107174</id>
		<title>J3.x:Developing an MVC Component/Adding language management</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_language_management&amp;diff=107174"/>
		<updated>2014-01-21T21:00:36Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Adds administration language folder example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|{{CurrentSTSVer|minor}}}}.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
Joomla!3.2 manages languages for components in four different situations:&lt;br /&gt;
* displaying a component in the public site&lt;br /&gt;
* managing a component in the backend&lt;br /&gt;
* managing menus in the backend&lt;br /&gt;
* installing a component&lt;br /&gt;
&lt;br /&gt;
Joomla!3.2 uses two different location folder for languages:&lt;br /&gt;
* one in &#039;&#039;administrator/language&#039;&#039; or &#039;&#039;language&#039;&#039;&lt;br /&gt;
* one in the component folder (&#039;&#039;administrator/components/*component*/language&#039;&#039; or &#039;&#039;components/*component*/language&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
It depends how the component is installed.&lt;br /&gt;
&lt;br /&gt;
== Adding language translation in the public site ==&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;site/language/en-GB/en-GB.com_helloworld.ini&#039;&#039;. This file will contain translation for the public part. For the moment, this file is empty&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/language/en-GB/en-GB.com_helloworld.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the moment, there are no translations strings in this file.&lt;br /&gt;
&lt;br /&gt;
== Adding language translation when managing the component ==&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.ini&#039;&#039;. This file will contain translation for the backend part.&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_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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding language translation when managing the menus in the backend ==&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.ini&#039;&#039;. This file will contain translation for the backend part.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/language/en-GB/en-GB.com_helloworld.sys.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.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_DESCRIPTION=&amp;quot;This is the Hello World description&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE=&amp;quot;Hello World&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC=&amp;quot;This view displays a selected message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MENU=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Language File Location Options ==&lt;br /&gt;
Starting with version 1.7 there are 2 ways to install language files for an extension.&lt;br /&gt;
One can use one or the other or a combination of both.&lt;br /&gt;
&lt;br /&gt;
The 1.5 way will install the files in the CORE language folders (ROOT/administrator/language/ and ROOT/language/ ).&lt;br /&gt;
Since 1.6— includes the files in a &amp;quot;language&amp;quot; folder installed at the root of the extension.&lt;br /&gt;
&lt;br /&gt;
Therefore an extension can include a language folder with a .sys.ini different from the one installed in joomla core language folders (this last one not being included in that language folder but in root or any other folder not installed).&lt;br /&gt;
This let&#039;s display 2 different descriptions: one from the sys.ini in the &amp;quot;language&amp;quot; folder is used as a message displayed when install has been done, the other (from the .ini) is used for &amp;quot;normal&amp;quot; operation, i.e. when the extension is edited in back-end.&lt;br /&gt;
This can be extremely useful when installing also uses some scripts and requires a different value for the description.&lt;br /&gt;
&lt;br /&gt;
{{tip|The sys.ini file is also used to translate the name of the extensions in some back-end Managers and to provide menu translation for components.|title=You Should Note!}}&lt;br /&gt;
&lt;br /&gt;
Therefore, the xml would include since 1.6&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;files&amp;gt;&lt;br /&gt;
&amp;lt;[...]&lt;br /&gt;
&amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;  // This folder HAS to include the right subfolders, i.e. language/en-GB/ ... language/fr-FR/&lt;br /&gt;
&amp;lt;filename&amp;gt;whatever&amp;lt;/filename&amp;gt;&lt;br /&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;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;[...]&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;whatever&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;[...]&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/administration&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and/or then (1.5 way):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;languages folder=&amp;quot;joomlacorelanguagefolders&amp;quot;&amp;gt; // if using another language folder for cleanliness (any folder name will fit)&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB/en-GB.whatever.ini&amp;lt;/language&amp;gt; // or&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.whatever.ini&amp;lt;/language&amp;gt; if no tagged subfolder&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB/en-GB.whatever.sys.ini&amp;lt;/language&amp;gt; // or&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.whatever.sys.ini&amp;lt;/language&amp;gt; if no tagged subfolder&lt;br /&gt;
&amp;lt;/languages&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or simply in ROOT&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;languages&amp;gt;&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.whatever.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.whatever.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;/languages&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Language file used by the install script during install of a component(&#039;&#039;the first install&#039;&#039; not upgrade) obeys specific rules described in the article, [[Specification of language files]]. During the first install, only the language file included in the component folder &amp;lt;code&amp;gt;(/administrator/components/com_helloworld/language)&amp;lt;/code&amp;gt; is used when present. If this file is only provided in the CORE language folder &amp;lt;code&amp;gt;(/administrator/language)&amp;lt;/code&amp;gt;, no translation occurs. This also applies to KEYs used in the manifest file.&lt;br /&gt;
&lt;br /&gt;
When upgrading or uninstalling the extension (not installing), it is the sys.ini file present in the extension root language folder which will display the result of the install from the description key/value. Thereafter, if present, the sys.ini as well as the ini installed in CORE language folder will have priority over the files present in the root language folder of the extension.&lt;br /&gt;
&lt;br /&gt;
{{tip|title=Advantages of Extension &amp;quot;Language&amp;quot; Folder|&#039;&#039;One advantage of installing the files in the extension &amp;quot;language&amp;quot; folder is that these &#039;&#039;&#039;are not touched when updating&#039;&#039;&#039; a language pack.&#039;&#039;{{-}}The other advantage is that this folder can include multiple languages (en-GB always, fr-FR, it-IT, etc.) not requiring the user to install the corresponding language pack. This is handy as they are available if, later on, a user installs the corresponding pack.}}&lt;br /&gt;
&lt;br /&gt;
== Adding translation when installing the component ==&lt;br /&gt;
&lt;br /&gt;
See: [[#Language_File_Location_Options|Language File Location Options]]&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;EXTENSIONROOT/language/en-GB/en-GB.myextension.sys.ini&#039;&#039;. This file will contain translation for the install.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;language/en-GB/en-GB.com_helloworld.sys.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;language/en-GB/en-GB.com_helloworld.sys.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_DESCRIPTION=&amp;quot;This is the Hello World description&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;COM_HELLOWORLD_DESCRIPTION&#039;&#039; can be used in the [[#helloworld.xml|helloworld.xml]] file&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;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#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;[[#admin/language/en-GB/en-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#language/en-GB/en-GB.com_helloworld.sys.ini|language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-8-adding-language-management.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;3.2.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;January 2014&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.8&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;administration&amp;gt;&lt;br /&gt;
        &amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
        &amp;lt;menu&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;!-- admin languages files section --&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;
    &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;
In this &#039;&#039;helloworld.xml&#039;&#039; file, languages are installed in:&lt;br /&gt;
* &#039;&#039;administrator/language&#039;&#039; for the admin part (look at the xml languages tag)&lt;br /&gt;
* &#039;&#039;components/com_helloworld/language&#039;&#039; for the site part (there are no xml languages tag in the site part of the xml description file, but the language folder is included)&lt;br /&gt;
&lt;br /&gt;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Basic backend &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
|next=Adding backend actions &amp;lt;!-- next article subpage name --&amp;gt;}}&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:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_language_management&amp;diff=107173</id>
		<title>J3.x:Developing an MVC Component/Adding language management</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_language_management&amp;diff=107173"/>
		<updated>2014-01-21T20:57:50Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Add link to step 8 archive&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|{{CurrentSTSVer|minor}}}}.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
Joomla!3.2 manages languages for components in four different situations:&lt;br /&gt;
* displaying a component in the public site&lt;br /&gt;
* managing a component in the backend&lt;br /&gt;
* managing menus in the backend&lt;br /&gt;
* installing a component&lt;br /&gt;
&lt;br /&gt;
Joomla!3.2 uses two different location folder for languages:&lt;br /&gt;
* one in &#039;&#039;administrator/language&#039;&#039; or &#039;&#039;language&#039;&#039;&lt;br /&gt;
* one in the component folder (&#039;&#039;administrator/components/*component*/language&#039;&#039; or &#039;&#039;components/*component*/language&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
It depends how the component is installed.&lt;br /&gt;
&lt;br /&gt;
== Adding language translation in the public site ==&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;site/language/en-GB/en-GB.com_helloworld.ini&#039;&#039;. This file will contain translation for the public part. For the moment, this file is empty&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/language/en-GB/en-GB.com_helloworld.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the moment, there are no translations strings in this file.&lt;br /&gt;
&lt;br /&gt;
== Adding language translation when managing the component ==&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.ini&#039;&#039;. This file will contain translation for the backend part.&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_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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding language translation when managing the menus in the backend ==&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.ini&#039;&#039;. This file will contain translation for the backend part.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/language/en-GB/en-GB.com_helloworld.sys.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.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_DESCRIPTION=&amp;quot;This is the Hello World description&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE=&amp;quot;Hello World&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC=&amp;quot;This view displays a selected message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MENU=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Language File Location Options ==&lt;br /&gt;
Starting with version 1.7 there are 2 ways to install language files for an extension.&lt;br /&gt;
One can use one or the other or a combination of both.&lt;br /&gt;
&lt;br /&gt;
The 1.5 way will install the files in the CORE language folders (ROOT/administrator/language/ and ROOT/language/ ).&lt;br /&gt;
Since 1.6— includes the files in a &amp;quot;language&amp;quot; folder installed at the root of the extension.&lt;br /&gt;
&lt;br /&gt;
Therefore an extension can include a language folder with a .sys.ini different from the one installed in joomla core language folders (this last one not being included in that language folder but in root or any other folder not installed).&lt;br /&gt;
This let&#039;s display 2 different descriptions: one from the sys.ini in the &amp;quot;language&amp;quot; folder is used as a message displayed when install has been done, the other (from the .ini) is used for &amp;quot;normal&amp;quot; operation, i.e. when the extension is edited in back-end.&lt;br /&gt;
This can be extremely useful when installing also uses some scripts and requires a different value for the description.&lt;br /&gt;
&lt;br /&gt;
{{tip|The sys.ini file is also used to translate the name of the extensions in some back-end Managers and to provide menu translation for components.|title=You Should Note!}}&lt;br /&gt;
&lt;br /&gt;
Therefore, the xml would include since 1.6&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;files&amp;gt;&lt;br /&gt;
&amp;lt;[...]&lt;br /&gt;
&amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;  // This folder HAS to include the right subfolders, i.e. language/en-GB/ ... language/fr-FR/&lt;br /&gt;
&amp;lt;filename&amp;gt;whatever&amp;lt;/filename&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and/or then (1.5 way):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;languages folder=&amp;quot;joomlacorelanguagefolders&amp;quot;&amp;gt; // if using another language folder for cleanliness (any folder name will fit)&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB/en-GB.whatever.ini&amp;lt;/language&amp;gt; // or&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.whatever.ini&amp;lt;/language&amp;gt; if no tagged subfolder&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB/en-GB.whatever.sys.ini&amp;lt;/language&amp;gt; // or&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.whatever.sys.ini&amp;lt;/language&amp;gt; if no tagged subfolder&lt;br /&gt;
&amp;lt;/languages&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or simply in ROOT&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;languages&amp;gt;&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.whatever.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.whatever.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;/languages&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Language file used by the install script during install of a component(&#039;&#039;the first install&#039;&#039; not upgrade) obeys specific rules described in the article, [[Specification of language files]]. During the first install, only the language file included in the component folder &amp;lt;code&amp;gt;(/administrator/components/com_helloworld/language)&amp;lt;/code&amp;gt; is used when present. If this file is only provided in the CORE language folder &amp;lt;code&amp;gt;(/administrator/language)&amp;lt;/code&amp;gt;, no translation occurs. This also applies to KEYs used in the manifest file.&lt;br /&gt;
&lt;br /&gt;
When upgrading or uninstalling the extension (not installing), it is the sys.ini file present in the extension root language folder which will display the result of the install from the description key/value. Thereafter, if present, the sys.ini as well as the ini installed in CORE language folder will have priority over the files present in the root language folder of the extension.&lt;br /&gt;
&lt;br /&gt;
{{tip|title=Advantages of Extension &amp;quot;Language&amp;quot; Folder|&#039;&#039;One advantage of installing the files in the extension &amp;quot;language&amp;quot; folder is that these &#039;&#039;&#039;are not touched when updating&#039;&#039;&#039; a language pack.&#039;&#039;{{-}}The other advantage is that this folder can include multiple languages (en-GB always, fr-FR, it-IT, etc.) not requiring the user to install the corresponding language pack. This is handy as they are available if, later on, a user installs the corresponding pack.}}&lt;br /&gt;
&lt;br /&gt;
== Adding translation when installing the component ==&lt;br /&gt;
&lt;br /&gt;
See: [[#Language_File_Location_Options|Language File Location Options]]&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;EXTENSIONROOT/language/en-GB/en-GB.myextension.sys.ini&#039;&#039;. This file will contain translation for the install.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;language/en-GB/en-GB.com_helloworld.sys.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;language/en-GB/en-GB.com_helloworld.sys.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_DESCRIPTION=&amp;quot;This is the Hello World description&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;COM_HELLOWORLD_DESCRIPTION&#039;&#039; can be used in the [[#helloworld.xml|helloworld.xml]] file&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;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#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;[[#admin/language/en-GB/en-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#language/en-GB/en-GB.com_helloworld.sys.ini|language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-8-adding-language-management.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;3.2.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;January 2014&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.8&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;administration&amp;gt;&lt;br /&gt;
        &amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
        &amp;lt;menu&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;!-- admin languages files section --&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;
    &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;
In this &#039;&#039;helloworld.xml&#039;&#039; file, languages are installed in:&lt;br /&gt;
* &#039;&#039;administrator/language&#039;&#039; for the admin part (look at the xml languages tag)&lt;br /&gt;
* &#039;&#039;components/com_helloworld/language&#039;&#039; for the site part (there are no xml languages tag in the site part of the xml description file, but the language folder is included)&lt;br /&gt;
&lt;br /&gt;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Basic backend &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
|next=Adding backend actions &amp;lt;!-- next article subpage name --&amp;gt;}}&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:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_language_management&amp;diff=107172</id>
		<title>J3.x:Developing an MVC Component/Adding language management</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_language_management&amp;diff=107172"/>
		<updated>2014-01-21T20:53:30Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Implements storing language file within extension&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|{{CurrentSTSVer|minor}}}}.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
Joomla!3.2 manages languages for components in four different situations:&lt;br /&gt;
* displaying a component in the public site&lt;br /&gt;
* managing a component in the backend&lt;br /&gt;
* managing menus in the backend&lt;br /&gt;
* installing a component&lt;br /&gt;
&lt;br /&gt;
Joomla!3.2 uses two different location folder for languages:&lt;br /&gt;
* one in &#039;&#039;administrator/language&#039;&#039; or &#039;&#039;language&#039;&#039;&lt;br /&gt;
* one in the component folder (&#039;&#039;administrator/components/*component*/language&#039;&#039; or &#039;&#039;components/*component*/language&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
It depends how the component is installed.&lt;br /&gt;
&lt;br /&gt;
== Adding language translation in the public site ==&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;site/language/en-GB/en-GB.com_helloworld.ini&#039;&#039;. This file will contain translation for the public part. For the moment, this file is empty&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/language/en-GB/en-GB.com_helloworld.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the moment, there are no translations strings in this file.&lt;br /&gt;
&lt;br /&gt;
== Adding language translation when managing the component ==&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.ini&#039;&#039;. This file will contain translation for the backend part.&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_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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding language translation when managing the menus in the backend ==&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.ini&#039;&#039;. This file will contain translation for the backend part.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/language/en-GB/en-GB.com_helloworld.sys.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.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_DESCRIPTION=&amp;quot;This is the Hello World description&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE=&amp;quot;Hello World&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC=&amp;quot;This view displays a selected message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MENU=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Language File Location Options ==&lt;br /&gt;
Starting with version 1.7 there are 2 ways to install language files for an extension.&lt;br /&gt;
One can use one or the other or a combination of both.&lt;br /&gt;
&lt;br /&gt;
The 1.5 way will install the files in the CORE language folders (ROOT/administrator/language/ and ROOT/language/ ).&lt;br /&gt;
Since 1.6— includes the files in a &amp;quot;language&amp;quot; folder installed at the root of the extension.&lt;br /&gt;
&lt;br /&gt;
Therefore an extension can include a language folder with a .sys.ini different from the one installed in joomla core language folders (this last one not being included in that language folder but in root or any other folder not installed).&lt;br /&gt;
This let&#039;s display 2 different descriptions: one from the sys.ini in the &amp;quot;language&amp;quot; folder is used as a message displayed when install has been done, the other (from the .ini) is used for &amp;quot;normal&amp;quot; operation, i.e. when the extension is edited in back-end.&lt;br /&gt;
This can be extremely useful when installing also uses some scripts and requires a different value for the description.&lt;br /&gt;
&lt;br /&gt;
{{tip|The sys.ini file is also used to translate the name of the extensions in some back-end Managers and to provide menu translation for components.|title=You Should Note!}}&lt;br /&gt;
&lt;br /&gt;
Therefore, the xml would include since 1.6&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;files&amp;gt;&lt;br /&gt;
&amp;lt;[...]&lt;br /&gt;
&amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;  // This folder HAS to include the right subfolders, i.e. language/en-GB/ ... language/fr-FR/&lt;br /&gt;
&amp;lt;filename&amp;gt;whatever&amp;lt;/filename&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and/or then (1.5 way):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;languages folder=&amp;quot;joomlacorelanguagefolders&amp;quot;&amp;gt; // if using another language folder for cleanliness (any folder name will fit)&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB/en-GB.whatever.ini&amp;lt;/language&amp;gt; // or&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.whatever.ini&amp;lt;/language&amp;gt; if no tagged subfolder&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB/en-GB.whatever.sys.ini&amp;lt;/language&amp;gt; // or&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.whatever.sys.ini&amp;lt;/language&amp;gt; if no tagged subfolder&lt;br /&gt;
&amp;lt;/languages&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or simply in ROOT&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;languages&amp;gt;&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.whatever.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.whatever.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;/languages&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Language file used by the install script during install of a component(&#039;&#039;the first install&#039;&#039; not upgrade) obeys specific rules described in the article, [[Specification of language files]]. During the first install, only the language file included in the component folder &amp;lt;code&amp;gt;(/administrator/components/com_helloworld/language)&amp;lt;/code&amp;gt; is used when present. If this file is only provided in the CORE language folder &amp;lt;code&amp;gt;(/administrator/language)&amp;lt;/code&amp;gt;, no translation occurs. This also applies to KEYs used in the manifest file.&lt;br /&gt;
&lt;br /&gt;
When upgrading or uninstalling the extension (not installing), it is the sys.ini file present in the extension root language folder which will display the result of the install from the description key/value. Thereafter, if present, the sys.ini as well as the ini installed in CORE language folder will have priority over the files present in the root language folder of the extension.&lt;br /&gt;
&lt;br /&gt;
{{tip|title=Advantages of Extension &amp;quot;Language&amp;quot; Folder|&#039;&#039;One advantage of installing the files in the extension &amp;quot;language&amp;quot; folder is that these &#039;&#039;&#039;are not touched when updating&#039;&#039;&#039; a language pack.&#039;&#039;{{-}}The other advantage is that this folder can include multiple languages (en-GB always, fr-FR, it-IT, etc.) not requiring the user to install the corresponding language pack. This is handy as they are available if, later on, a user installs the corresponding pack.}}&lt;br /&gt;
&lt;br /&gt;
== Adding translation when installing the component ==&lt;br /&gt;
&lt;br /&gt;
See: [[#Language_File_Location_Options|Language File Location Options]]&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;EXTENSIONROOT/language/en-GB/en-GB.myextension.sys.ini&#039;&#039;. This file will contain translation for the install.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;language/en-GB/en-GB.com_helloworld.sys.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;language/en-GB/en-GB.com_helloworld.sys.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_DESCRIPTION=&amp;quot;This is the Hello World description&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;COM_HELLOWORLD_DESCRIPTION&#039;&#039; can be used in the [[#helloworld.xml|helloworld.xml]] file&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;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#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;[[#admin/language/en-GB/en-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#language/en-GB/en-GB.com_helloworld.sys.ini|language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [[not_available_yet 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;3.2.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;January 2014&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.8&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;administration&amp;gt;&lt;br /&gt;
        &amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
        &amp;lt;menu&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;!-- admin languages files section --&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;
    &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;
In this &#039;&#039;helloworld.xml&#039;&#039; file, languages are installed in:&lt;br /&gt;
* &#039;&#039;administrator/language&#039;&#039; for the admin part (look at the xml languages tag)&lt;br /&gt;
* &#039;&#039;components/com_helloworld/language&#039;&#039; for the site part (there are no xml languages tag in the site part of the xml description file, but the language folder is included)&lt;br /&gt;
&lt;br /&gt;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Basic backend &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
|next=Adding backend actions &amp;lt;!-- next article subpage name --&amp;gt;}}&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:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_language_management&amp;diff=107171</id>
		<title>J3.x:Developing an MVC Component/Adding language management</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_language_management&amp;diff=107171"/>
		<updated>2014-01-21T20:32:15Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Adds note about Github repo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|{{CurrentSTSVer|minor}}}}.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
Joomla!3.2 manages languages for components in four different situations:&lt;br /&gt;
* displaying a component in the public site&lt;br /&gt;
* managing a component in the backend&lt;br /&gt;
* managing menus in the backend&lt;br /&gt;
* installing a component&lt;br /&gt;
&lt;br /&gt;
Joomla!3.2 uses two different location folder for languages:&lt;br /&gt;
* one in &#039;&#039;administrator/language&#039;&#039; or &#039;&#039;language&#039;&#039;&lt;br /&gt;
* one in the component folder (&#039;&#039;administrator/components/*component*/language&#039;&#039; or &#039;&#039;components/*component*/language&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
It depends how the component is installed.&lt;br /&gt;
&lt;br /&gt;
== Adding language translation in the public site ==&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;site/language/en-GB/en-GB.com_helloworld.ini&#039;&#039;. This file will contain translation for the public part. For the moment, this file is empty&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/language/en-GB/en-GB.com_helloworld.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the moment, there are no translations strings in this file.&lt;br /&gt;
&lt;br /&gt;
== Adding language translation when managing the component ==&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.ini&#039;&#039;. This file will contain translation for the backend part.&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_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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding language translation when managing the menus in the backend ==&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.ini&#039;&#039;. This file will contain translation for the backend part.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/language/en-GB/en-GB.com_helloworld.sys.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.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_DESCRIPTION=&amp;quot;This is the Hello World description&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE=&amp;quot;Hello World&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC=&amp;quot;This view displays a selected message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MENU=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Language File Location Options ==&lt;br /&gt;
Starting with version 1.7 there are 2 ways to install language files for an extension.&lt;br /&gt;
One can use one or the other or a combination of both.&lt;br /&gt;
&lt;br /&gt;
The 1.5 way will install the files in the CORE language folders (ROOT/administrator/language/ and ROOT/language/ ).&lt;br /&gt;
Since 1.6— includes the files in a &amp;quot;language&amp;quot; folder installed at the root of the extension.&lt;br /&gt;
&lt;br /&gt;
Therefore an extension can include a language folder with a .sys.ini different from the one installed in joomla core language folders (this last one not being included in that language folder but in root or any other folder not installed).&lt;br /&gt;
This let&#039;s display 2 different descriptions: one from the sys.ini in the &amp;quot;language&amp;quot; folder is used as a message displayed when install has been done, the other (from the .ini) is used for &amp;quot;normal&amp;quot; operation, i.e. when the extension is edited in back-end.&lt;br /&gt;
This can be extremely useful when installing also uses some scripts and requires a different value for the description.&lt;br /&gt;
&lt;br /&gt;
{{tip|The sys.ini file is also used to translate the name of the extensions in some back-end Managers and to provide menu translation for components.|title=You Should Note!}}&lt;br /&gt;
&lt;br /&gt;
Therefore, the xml would include since 1.6&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;files&amp;gt;&lt;br /&gt;
&amp;lt;[...]&lt;br /&gt;
&amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;  // This folder HAS to include the right subfolders, i.e. language/en-GB/ ... language/fr-FR/&lt;br /&gt;
&amp;lt;filename&amp;gt;whatever&amp;lt;/filename&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and/or then (1.5 way):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;languages folder=&amp;quot;joomlacorelanguagefolders&amp;quot;&amp;gt; // if using another language folder for cleanliness (any folder name will fit)&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB/en-GB.whatever.ini&amp;lt;/language&amp;gt; // or&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.whatever.ini&amp;lt;/language&amp;gt; if no tagged subfolder&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB/en-GB.whatever.sys.ini&amp;lt;/language&amp;gt; // or&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.whatever.sys.ini&amp;lt;/language&amp;gt; if no tagged subfolder&lt;br /&gt;
&amp;lt;/languages&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or simply in ROOT&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;languages&amp;gt;&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.whatever.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.whatever.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;/languages&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Language file used by the install script during install of a component(&#039;&#039;the first install&#039;&#039; not upgrade) obeys specific rules described in the article, [[Specification of language files]]. During the first install, only the language file included in the component folder &amp;lt;code&amp;gt;(/administrator/components/com_helloworld/language)&amp;lt;/code&amp;gt; is used when present. If this file is only provided in the CORE language folder &amp;lt;code&amp;gt;(/administrator/language)&amp;lt;/code&amp;gt;, no translation occurs. This also applies to KEYs used in the manifest file.&lt;br /&gt;
&lt;br /&gt;
When upgrading or uninstalling the extension (not installing), it is the sys.ini file present in the extension root language folder which will display the result of the install from the description key/value. Thereafter, if present, the sys.ini as well as the ini installed in CORE language folder will have priority over the files present in the root language folder of the extension.&lt;br /&gt;
&lt;br /&gt;
{{tip|title=Advantages of Extension &amp;quot;Language&amp;quot; Folder|&#039;&#039;One advantage of installing the files in the extension &amp;quot;language&amp;quot; folder is that these &#039;&#039;&#039;are not touched when updating&#039;&#039;&#039; a language pack.&#039;&#039;{{-}}The other advantage is that this folder can include multiple languages (en-GB always, fr-FR, it-IT, etc.) not requiring the user to install the corresponding language pack. This is handy as they are available if, later on, a user installs the corresponding pack.}}&lt;br /&gt;
&lt;br /&gt;
== Adding translation when installing the component ==&lt;br /&gt;
&lt;br /&gt;
See: [[#Language_File_Location_Options|Language File Location Options]]&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, put a file &#039;&#039;EXTENSIONROOT/language/en-GB/en-GB.myextension.sys.ini&#039;&#039;. This file will contain translation for the install.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;language/en-GB/en-GB.com_helloworld.sys.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;language/en-GB/en-GB.com_helloworld.sys.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_DESCRIPTION=&amp;quot;This is the Hello World description&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;COM_HELLOWORLD_DESCRIPTION&#039;&#039; can be used in the [[#helloworld.xml|helloworld.xml]] file&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;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#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;[[#admin/language/en-GB/en-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#language/en-GB/en-GB.com_helloworld.sys.ini|language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [[not_available_yet 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;3.2.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;January 2014&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.8&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;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu&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;/files&amp;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;
In this &#039;&#039;helloworld.xml&#039;&#039; file, languages are installed in:&lt;br /&gt;
* &#039;&#039;administrator/language&#039;&#039; for the admin part (look at the xml languages tag)&lt;br /&gt;
* &#039;&#039;components/com_helloworld/language&#039;&#039; for the site part (there are no xml languages tag in the site part of the xml description file, but the language folder is included)&lt;br /&gt;
&lt;br /&gt;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Basic backend &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
|next=Adding backend actions &amp;lt;!-- next article subpage name --&amp;gt;}}&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:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Basic_backend&amp;diff=107170</id>
		<title>J3.x:Developing an MVC Component/Basic backend</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Basic_backend&amp;diff=107170"/>
		<updated>2014-01-21T20:28:06Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Adds note about Github repo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|{{CurrentSTSVer|minor}}}}.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Basic backend ==&lt;br /&gt;
Designing the backend interface leads us to create at least a Model-View-Controller triptych. We have to modify the administrator entry point of our component, the &#039;&#039;admin/helloworld.php&#039;&#039; file&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;
// 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 = JControllerLegacy::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;
// Perform the Request task&lt;br /&gt;
$controller-&amp;gt;execute($task);&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the general controller ==&lt;br /&gt;
The entry point now gets an instance of a &#039;&#039;HelloWorld&#039;&#039; prefixed controller. Let&#039;s create a basic controller for the administrator part:&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 JControllerLegacy&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, $urlparams = 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;
}&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 controller will display the &#039;HelloWorlds&#039; view by default.&lt;br /&gt;
&lt;br /&gt;
== Create the view ==&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, create a file &#039;&#039;admin/views/helloworlds/view.html.php&#039;&#039; containing:&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 JViewLegacy&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;
		// Display the template&lt;br /&gt;
		parent::display($tpl);&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;
In Joomla, views display data using layout. With your favorite file manager and editor, put a file &#039;&#039;admin/views/helloworlds/tmpl/default.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/tmpl/default.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworlds/tmpl/default.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;
// load tooltip behavior&lt;br /&gt;
JHtml::_(&#039;behavior.tooltip&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;form action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php?option=com_helloworld&#039;); ?&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;table class=&amp;quot;adminlist&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;thead&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;head&#039;);?&amp;gt;&amp;lt;/thead&amp;gt;&lt;br /&gt;
		&amp;lt;tfoot&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;foot&#039;);?&amp;gt;&amp;lt;/tfoot&amp;gt;&lt;br /&gt;
		&amp;lt;tbody&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;body&#039;);?&amp;gt;&amp;lt;/tbody&amp;gt;&lt;br /&gt;
	&amp;lt;/table&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;
This layout calls several sub-layout (&#039;&#039;head&#039;&#039;, &#039;&#039;foot&#039;&#039; and &#039;&#039;body&#039;&#039;). Each sub-layout corresponds to a file prefixed by the name of the main layout (&#039;&#039;default&#039;&#039;), and an underscore.&lt;br /&gt;
&lt;br /&gt;
Put a file &#039;&#039;admin/views/helloworlds/tmpl/default_head.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/tmpl/default_head.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworlds/tmpl/default_head.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;
?&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
	&amp;lt;th width=&amp;quot;20&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;?php echo JHtml::_(&#039;grid.checkall&#039;); ?&amp;gt;&lt;br /&gt;
	&amp;lt;/th&amp;gt;&lt;br /&gt;
	&amp;lt;th&amp;gt;&lt;br /&gt;
		&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_HEADING_GREETING&#039;); ?&amp;gt;&lt;br /&gt;
	&amp;lt;/th&amp;gt;&lt;br /&gt;
	&amp;lt;th width=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_HEADING_ID&#039;); ?&amp;gt;&lt;br /&gt;
	&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;COM_HELLOWORLD_HELLOWORLD_HEADING_ID&#039;&#039; and &#039;&#039;COM_HELLOWORLD_HELLOWORLD_HEADING_GREETING&#039;&#039; are placeholders which will later be replaced with language-specific text. The [http://api.joomla.org/Joomla-Platform/Language/JText.html JText::_] method translates a string into the current language.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;checkAll&#039;&#039; is a javascript function defined in the Joomla core able to check all items.&lt;br /&gt;
&lt;br /&gt;
Put a file &#039;&#039;admin/views/helloworlds/tmpl/default_body.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/tmpl/default_body.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworlds/tmpl/default_body.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;
?&amp;gt;&lt;br /&gt;
&amp;lt;?php foreach($this-&amp;gt;items as $i =&amp;gt; $item): ?&amp;gt;&lt;br /&gt;
	&amp;lt;tr class=&amp;quot;row&amp;lt;?php echo $i % 2; ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;td&amp;gt;&lt;br /&gt;
			&amp;lt;?php echo JHtml::_(&#039;grid.id&#039;, $i, $item-&amp;gt;id); ?&amp;gt;&lt;br /&gt;
		&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;td&amp;gt;&lt;br /&gt;
			&amp;lt;?php echo $item-&amp;gt;greeting; ?&amp;gt;&lt;br /&gt;
		&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;td&amp;gt;&lt;br /&gt;
			&amp;lt;?php echo $item-&amp;gt;id; ?&amp;gt;&lt;br /&gt;
		&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;?php endforeach; ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;JHtml::_&#039;&#039; is a helper function able to display several HTML output. In this case, it will display a checkbox for the item.&lt;br /&gt;
&lt;br /&gt;
Put a file &#039;&#039;admin/views/helloworlds/tmpl/default_foot.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/tmpl/default_foot.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworlds/tmpl/default_foot.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;
?&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
	&amp;lt;td colspan=&amp;quot;3&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;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;JPagination&#039;&#039; is a Joomla class able to manage and display pagination object.&lt;br /&gt;
&lt;br /&gt;
== Create the model ==&lt;br /&gt;
The &#039;&#039;HelloWorlds&#039;&#039; view asks the model for data. In Joomla, there is a class able to manage a list of data: &#039;&#039;JModelList&#039;&#039;. Class &#039;&#039;JModelList&#039;&#039; and inherited classes need only one method:&lt;br /&gt;
* &#039;&#039;getListQuery&#039;&#039; which constructs an SQL query&lt;br /&gt;
&lt;br /&gt;
and two states:&lt;br /&gt;
* &#039;&#039;list.start&#039;&#039; for determining the list offset&lt;br /&gt;
* &#039;&#039;list.limit&#039;&#039; for determining the list length&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;getItems&#039;&#039; and &#039;&#039;getPagination&#039;&#039; methods are defined in JModelList class. They don&#039;t need to be defined in the &#039;&#039;HelloWorldModelHelloWorlds&#039;&#039; class.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/helloworlds.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/models/helloworlds.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;
// import the Joomla modellist library&lt;br /&gt;
jimport(&#039;joomla.application.component.modellist&#039;);&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorldList Model&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorlds extends JModelList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to build an SQL query to load the list data.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return	string	An SQL query&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getListQuery()&lt;br /&gt;
	{&lt;br /&gt;
		// Create a new query object.		&lt;br /&gt;
		$db = JFactory::getDBO();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		// Select some fields from the hello table&lt;br /&gt;
		$query&lt;br /&gt;
		    -&amp;gt;select(&#039;id,greeting&#039;)&lt;br /&gt;
		    -&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		&lt;br /&gt;
		return $query;&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;
The &#039;&#039;_populateState&#039;&#039; method is, by default, automatically called when a state is read by the &#039;&#039;getState&#039;&#039; method.&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;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-7-basic-backend.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;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&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;version&amp;gt;0.0.7&amp;lt;/version&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;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;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;menu&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&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;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&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;/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;
Now you can see in your component &#039;&#039;&#039;hello-world&#039;&#039;&#039; an array with two colums, two rows and checkboxes. You can click the checkboxes in order to select the different options you want.&lt;br /&gt;
&lt;br /&gt;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Using the database &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
|next=Adding language management &amp;lt;!-- next article subpage name --&amp;gt;}}&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:presto|Preston Smith]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type&amp;diff=107169</id>
		<title>J3.x:Developing an 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=J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type&amp;diff=107169"/>
		<updated>2014-01-21T20:16:26Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: /* Packaging the component */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] 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!2.5 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;&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;
* the name attribute can be passed to the component in the URL. In this case &#039;&#039;?option=com_helloworld&amp;amp;id=1&#039;&#039;  would indicate that you had chosen option 1.&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;
&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&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;3.2.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;January 2014&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 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;/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;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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 [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-5-adding-a-menu-variable-request.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;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Adding a model to the site part &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
|next=Using the database &amp;lt;!-- next article subpage name --&amp;gt;}}&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:betweenbrain|Matt Thomas]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_model_to_the_site_part&amp;diff=107168</id>
		<title>J3.x:Developing an MVC Component/Adding a model to the site part</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_model_to_the_site_part&amp;diff=107168"/>
		<updated>2014-01-21T20:16:00Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Adds note about Github repo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Adding a model ==&lt;br /&gt;
In the Joomla framework, models are responsible for managing the data. The first function that has to be written for a model is a &#039;&#039;get&#039;&#039; function. It returns data to the caller. In our case, the caller will be the &#039;&#039;HelloWorldViewHelloWorld&#039;&#039; view. By default, the model named &#039;&#039;HelloWorldModelHelloWorld&#039;&#039; residing in &#039;&#039;site/models/helloworld.php&#039;&#039; is the main model associated to this view. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So let&#039;s have a quick look at the naming conventions with an example, since the naming convention are the actual magic, that make everything work:&lt;br /&gt;
&lt;br /&gt;
The class &#039;&#039;HelloWorldView&#039;&#039;&#039;HelloWorld&#039;&#039;&#039;&#039;&#039; resides in &#039;&#039;site/views/&#039;&#039;&#039;helloworld&#039;&#039;&#039;/view.html.php&#039;&#039; and will make use of the class &#039;&#039;HelloWorldModel&#039;&#039;&#039;HelloWorld&#039;&#039;&#039;&#039;&#039; in the file &#039;&#039;site/models/&#039;&#039;&#039;helloworld&#039;&#039;&#039;.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So let&#039;s just assume we want to use an imaginary view &#039;&#039;fluffy&#039;&#039;, you would have to have:&lt;br /&gt;
&lt;br /&gt;
The class &#039;&#039;HelloWorldView&#039;&#039;&#039;Fluffy&#039;&#039;&#039;&#039;&#039; which resides in &#039;&#039;site/views/&#039;&#039;&#039;fluffy&#039;&#039;&#039;/view.html.php&#039;&#039;. The view will make use of &#039;&#039;HelloWorldModel&#039;&#039;&#039;Fluffy&#039;&#039;&#039;&#039;&#039; in the file &#039;&#039;site/models/&#039;&#039;&#039;fluffy&#039;&#039;&#039;.php&#039;&#039;. Note: the actual screen of the view: &#039;&#039;site/views/&#039;&#039;&#039;fluffy&#039;&#039;&#039;/tmpl/default.php&#039;&#039; is required as well to make this example work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Breaking any of these bold conventions will lead to errors or a blank page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So back to the actual implementation of the single classes:&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a &#039;&#039;site/models/helloworld.php&#039;&#039; file containing:&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;
			$this-&amp;gt;msg = &#039;Hello World!&#039;;&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;
The &#039;&#039;HelloWorldViewHelloWorld&#039;&#039; class asks the model for data using the &#039;&#039;get&#039;&#039; method of the &#039;&#039;JViewLegacy&#039;&#039; class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/view.html.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/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;
 * HTML View class for the HelloWorld Component&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorld extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	// Overwriting JView display method&lt;br /&gt;
	function display($tpl = null) &lt;br /&gt;
	{&lt;br /&gt;
		// Assign data to the view&lt;br /&gt;
		$this-&amp;gt;msg = $this-&amp;gt;get(&#039;Msg&#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;
			JLog::add(implode(&#039;&amp;lt;br /&amp;gt;&#039;, $errors), JLog::WARNING, &#039;jerror&#039;);&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&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;
Note: $this-&amp;gt;get() is a member of JViewLegacy::get which is a proxy to get* methods of the default model where * is populated with the value of the first parameter passed to get()&lt;br /&gt;
&lt;br /&gt;
Also modify your &#039;&#039;helloworld.xml&#039;&#039; file to indicate use of models and 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;3.2.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;January 2014&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.4&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 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;/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;
== 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;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_menu_type_to_the_site_part#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-4-adding-a-site-model.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;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Adding a menu type to the site part &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
|next=Adding a variable request in the menu type &amp;lt;!-- next article subpage name --&amp;gt;}}&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:Jossnaz|Lukas Meier]]&lt;br /&gt;
*[[User:betweenbrain|Matt Thomas]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_menu_type_to_the_site_part&amp;diff=107167</id>
		<title>J3.x:Developing an MVC Component/Adding a menu type to the site part</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_menu_type_to_the_site_part&amp;diff=107167"/>
		<updated>2014-01-21T20:15:16Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Adds note about Github repo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component|Developing a MVC Component for Joomla!3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
Generally speaking, this article describes how to get a link on your joomla page to open a specific page of your component. This gets simply done by adding an xml file to your specific page into your view folder. &lt;br /&gt;
&lt;br /&gt;
E.g.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;site/views/helloworld/tmpl/&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Contains your view page &#039;&#039;default.php&#039;&#039; that we want to open.&lt;br /&gt;
&lt;br /&gt;
A file &#039;&#039;default.xml&#039;&#039; is placed next to this file with some xml. This makes joomla able to recognize the view file &#039;&#039;default.php&#039;&#039; as a menu item.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a menu item type ==&lt;br /&gt;
In the Joomla framework, components are executed using menu items. If you go in the menu manager of your Joomla installation a &#039;&#039;HelloWorld&#039;&#039; menu item type does not yet exist. Adding this functionality is easy in Joomla. Simply put a &#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039; file containing:&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;&lt;br /&gt;
			&amp;lt;![CDATA[COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC]]&amp;gt;&lt;br /&gt;
		&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&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;
For the moment the strings won&#039;t be translated in the administrator interface. We will see in a later article how translation is performed.&lt;br /&gt;
&lt;br /&gt;
Also modify your &#039;&#039;helloworld.xml&#039;&#039; file to indicate a 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;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.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;January 2014&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.3&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 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;/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;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory&lt;br /&gt;
Content of your code directory&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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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;[[#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
[[File:Com_helloworld_v3-0.0.3.png|thumb|right|400px|Selecting the Menu Item Type]] Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-3-adding-a-site-menu.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. To do so select &amp;quot;Add New Menu Item&amp;quot; from the one of the menus in the &amp;quot;Menus&amp;quot; menu; then you can select COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE for Menu Item Type. Once selected you can see the Link information is populated with the URL for the view.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Adding a view to the site part &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
|next=Adding a model to the site part &amp;lt;!-- next article subpage name --&amp;gt;}}&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:Jossnaz|Lukas Meier]]&lt;br /&gt;
*[[User:betweenbrain|Matt Thomas]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part&amp;diff=107166</id>
		<title>J3.x:Developing an MVC Component/Adding a view to the site part</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part&amp;diff=107166"/>
		<updated>2014-01-21T20:13:14Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Adds note about Github repo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|3.2}}&lt;br /&gt;
{{Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!3.1 - Contents}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing_a_MVC_Component|Developing a Model-View-Controller (MVC) Component for Joomla! 3.x]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
In the Joomla!3.x framework, third party component authors divide their code into three main parts:&lt;br /&gt;
* &#039;&#039;models&#039;&#039; They manage the data &lt;br /&gt;
* &#039;&#039;controllers&#039;&#039; They perform tasks, set and get the states of the models and ask the views to display&lt;br /&gt;
* &#039;&#039;views&#039;&#039; They display the content according to the type (&#039;&#039;error&#039;&#039;, &#039;&#039;feed&#039;&#039;, &#039;&#039;html&#039;&#039;, &#039;&#039;json&#039;&#039;, &#039;&#039;raw&#039;&#039;, &#039;&#039;xml&#039;&#039;) and the layout chosen by the controllers&lt;br /&gt;
&lt;br /&gt;
== Setting the controller ==&lt;br /&gt;
In the core code of Joomla, there is a class able to manage controllers: &#039;&#039;[http://api.joomla.org/cms-3/classes/JControllerLegacy.html JControllerLegacy]&#039;&#039;. This class has to be extended to be used in our component. In the file &#039;&#039;site/helloworld.php&#039;&#039; (entry point of our &#039;&#039;Hello World&#039;&#039; component), put these lines&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/helloworld.php}}&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;
// Get an instance of the controller prefixed by HelloWorld&lt;br /&gt;
$controller = JControllerLegacy::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;
&lt;br /&gt;
The &#039;&#039;[http://api.joomla.org/cms-3/classes/JControllerLegacy.html#method_getInstance getInstance]&#039;&#039; static method of the &#039;&#039;JControllerLegacy&#039;&#039; class will create a controller. In the code above, it will instantiate a controller object of a class named &#039;&#039;HelloWorldController&#039;&#039;. Joomla will look for the declaration of that class in an aptly named file called &#039;&#039;controller.php&#039;&#039; (it&#039;s a default behavior).&lt;br /&gt;
&lt;br /&gt;
Now, &#039;&#039;controller.php&#039;&#039; needs to be created and &#039;&#039;HelloWorldController&#039;&#039; needs to be declared and defined. So with your favorite file manager and editor, create a &#039;&#039;site/controller.php&#039;&#039; file containing&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/controller.php}}&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;
 * Hello World Component Controller&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldController extends JControllerLegacy&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When no task is given in the request variables, the default task will be executed. It&#039;s the &#039;&#039;display&#039;&#039; task by default. The &#039;&#039;JControllerLegacy&#039;&#039; class has such a task. In our example, it will display a view named &#039;&#039;HelloWorld&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
So with &#039;&#039;task&#039;&#039; simply a public function display() of &#039;&#039;JControllerLegacy&#039;&#039; is refered to.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{tip|Just a side note for completion, you could call another function aside from &#039;&#039;display()&#039;&#039; by using an URL like this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;http://localhost/index.php?option=com_helloworld&amp;amp;task=insert&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would try to call a function &#039;&#039;insert()&#039;&#039; of our controller (which we would actually have to implement in &#039;&#039;HelloWorldController&#039;&#039; ).}}&lt;br /&gt;
&lt;br /&gt;
== Setting the view ==&lt;br /&gt;
&lt;br /&gt;
When JControllerLegacy wants to display a view, it will look for certain files in the &#039;&#039;component/com_[component_name]/views/[name of view]/&#039;&#039; folder. &lt;br /&gt;
&lt;br /&gt;
The name of the folder of the default view is the name of the component itself. In our case the path is &#039;&#039;component/com_helloworld/views/helloworld/&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The file that will contain the code of the view is called &#039;&#039;view.[view_mode].php&#039;&#039;. The default view mode, and probably the only view a component might need is the &#039;&#039;html&#039;&#039; mode. So this give us our file name which is &#039;&#039;view.html.php&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, create a file &#039;&#039;site/views/helloworld/view.html.php&#039;&#039; able to display the default view and containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/view.html.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/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;
 * HTML View class for the HelloWorld Component&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorld extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	// Overwriting JView display method&lt;br /&gt;
	function display($tpl = null) &lt;br /&gt;
	{&lt;br /&gt;
		// Assign data to the view&lt;br /&gt;
		$this-&amp;gt;msg = &#039;Hello World&#039;;&lt;br /&gt;
&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&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;
The &#039;&#039;display&#039;&#039; method of the &#039;&#039;[http://api.joomla.org/cms-3/classes/JViewLegacy.html JViewLegacy]&#039;&#039; class is called with the &#039;&#039;display&#039;&#039; task of the JControllerLegacy class. In our case, this method will display data using the &#039;&#039;tmpl/default.php&#039;&#039; file. With your favorite file manager and editor, create a file &#039;&#039;site/views/helloworld/tmpl/default.php&#039;&#039; able to display the default view and containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/helloworld/tmpl/default.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;
?&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;&amp;lt;?php echo $this-&amp;gt;msg; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This template file will be included by the JViewLegacy class. Therefore, here, $this refers to the HelloWorldViewHelloWorld class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So to give an example, one could call the view inside the &#039;&#039;component/com_[component_name]/views/[name of view]/&#039;&#039;    folder by calling:&lt;br /&gt;
&lt;br /&gt;
http://localhost/joomla/index.php?option=com_helloworld&lt;br /&gt;
&lt;br /&gt;
(this would default to the &#039;&#039;component/com_helloworld/views/helloworld/&#039;&#039; folder)&lt;br /&gt;
or we could explicitly call the folder by calling&lt;br /&gt;
&lt;br /&gt;
http://localhost/joomla/index.php?option=com_helloworld&amp;amp;view=helloworld&lt;br /&gt;
&lt;br /&gt;
if we change &#039;&#039;&amp;amp;view=helloworld&#039;&#039; to something else, e.g. &#039;&#039;&amp;amp;view=fluffy&#039;&#039; we would have to create a folder:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;component/com_helloworld/views/fluffy/&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Copy the contents of &#039;&#039;views/helloworld&#039;&#039; to &#039;&#039;views/fluffy&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The classname of the file &#039;&#039;view.html.php&#039;&#039; of the fluffy folder would be &#039;&#039;HelloWorldViewFluffy&#039;&#039;. Afterwards you can customize the contents of &#039;&#039;default.php&#039;&#039; of the &#039;&#039;fluffy&#039;&#039; subfolder for custom output and see the output by calling:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;http://localhost/joomla/index.php?option=com_helloworld&amp;amp;view=fluffy&#039;&#039;&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;[[#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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/58226/com_helloworld-1.6-part02.zip archive] and install it using the extension manager of Joomla. You can test this basic component by putting &#039;&#039;index.php?option=com_helloworld&#039;&#039; in your browser address.&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.2&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 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;/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;
&#039;&#039;&#039;Result:&#039;&#039;&#039;&lt;br /&gt;
You will see by default the message contained in the variable &#039;&#039;$this-&amp;gt;msg&#039;&#039; in the &#039;&#039;view.html.php&#039;&#039; file.&lt;br /&gt;
&lt;br /&gt;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate|prev=Developing a Basic Component|next=Adding a menu type to the site part}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Component Development]] [[Category:Joomla! 3.0]] [[Category:Joomla! 3.1]][[Category:Joomla! 3.2]]&amp;lt;/noinclude&amp;gt;&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! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Developing_a_Basic_Component&amp;diff=107165</id>
		<title>J3.x:Developing an MVC Component/Developing a Basic Component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Developing_a_Basic_Component&amp;diff=107165"/>
		<updated>2014-01-21T20:12:02Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Adds note about Github repo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:Developing a Model-View-Controller Component/3.0}}&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;yoursite/components/com_helloworld/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! 3.x installation path) after installing this component.&lt;br /&gt;
&lt;br /&gt;
=== Administrator management ===&lt;br /&gt;
With your favorite file manager and editor, create a file &#039;&#039;yoursite/administrator/components/com_helloworld/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 after installing the component.&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;
With your favorite file manager, create a directory (outside your Joomla 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;[[#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;[[#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#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/58225/com_helloworld-1.6-part01.zip archive] and install it using the extension manager of Joomla. 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 installation under the &#039;&#039;Components&#039;&#039; menu.&lt;br /&gt;
&lt;br /&gt;
==File Details==&lt;br /&gt;
{{vanchor|admin/sql/updates/mysql/0.0.1.sql}}&lt;br /&gt;
is an empty file allowing to initialise schema version of the com_helloworld component.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|helloworld.xml}}&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;3.2&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;December 2013&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;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.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;/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;
&lt;br /&gt;
{{vanchor|site/helloworld.php}}&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;
{{vanchor|admin/helloworld.php}}&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;
{{vanchor|index.html}}&lt;br /&gt;
common to all folders&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;
&lt;br /&gt;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Introduction&lt;br /&gt;
|next=Adding a view to the site part}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Component Development]] [[Category:Joomla! 3.0]] [[Category:Joomla! 3.1]][[Category:Joomla! 3.2]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database&amp;diff=107164</id>
		<title>J3.x:Developing an MVC Component/Using the database</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database&amp;diff=107164"/>
		<updated>2014-01-21T20:10:30Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Removing note about site/models/helloworld.php being not up to date.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Using the database ==&lt;br /&gt;
Components usually manage their contents using the database. During the install/uninstall/update phase of a component, you can execute SQL queries through the use of SQL text files.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor create two files called &#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039; and &#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;. They should both have the same content, as follows:&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; and &#039;&#039;admin/sql/updates/mysql/0.0.6.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;
   PRIMARY KEY  (`id`)&lt;br /&gt;
) ENGINE=InnoDB 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;
The file &#039;&#039;install.mysql.utf8.sql&#039;&#039; will be executed when you install this component. The file &#039;&#039;0.0.6.sql&#039;&#039; is executed when you do an update.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When the component is installed, the files in the SQL updates folder (for example, &#039;&#039;admin/sql/updates/mysql&#039;&#039;) are read and the name of the last file alphabetically is used to populate the component&#039;s version number in the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; table. This value must be in this table in order for the automatic update to execute the update SQL files for future versions. For this reason, it is good practice to create a SQL update file for each version (even if it is empty or just has a comment). This way the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; version will always match the component version.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When saving the SQL files in utf8, be sure to save them as utf8 NO BOM or the query will fail with MySQL error #1064.&lt;br /&gt;
&lt;br /&gt;
This is the install file. It will be executed if you put an appropriate order in the &#039;&#039;helloworld.xml&#039;&#039; file&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;3.2.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;January 2014&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.6&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;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;/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;!-- 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;/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;
Do the same for the uninstall file:&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039; containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/uninstall.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/sql/uninstall.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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a new field type ==&lt;br /&gt;
For the moment, we have used a [[Developing_a_Model-View-Controller_%28MVC%29_Component_for_Joomla!2.5_-_Part_03|hard coded field type for messages]]. We need to use our database for choosing the message.&lt;br /&gt;
&lt;br /&gt;
Modify the &#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039; file and put these lines&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&lt;br /&gt;
		name=&amp;quot;request&amp;quot;&lt;br /&gt;
		addfieldpath=&amp;quot;/administrator/components/com_helloworld/models/fields&amp;quot;&lt;br /&gt;
	&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;helloworld&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;
			/&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;
It introduces a new field type and tells Joomla to look for the field definition in the &#039;&#039;/administrator/components/com_helloworld/models/fields&#039;&#039; folder.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &#039;&#039;admin/models/fields/helloworld.php&#039;&#039; file containing:&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;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		$query-&amp;gt;select(&#039;id,greeting&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#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;
			}&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;
The new field type displays a drop-down list of messages to choose from. You can see the result of this change in the menu manager section for the helloworld item.&lt;br /&gt;
&lt;br /&gt;
== Display the chosen message ==&lt;br /&gt;
When a menu item of this component is created/updated, Joomla stores the identifier of the message. The &#039;&#039;HelloWorldModelHelloWorld&#039;&#039; model has now to compute the message according to this identifier and the data stored in the database.&lt;br /&gt;
&lt;br /&gt;
Modify the &#039;&#039;site/models/helloworld.php&#039;&#039; file:&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 array messages&lt;br /&gt;
	 */&lt;br /&gt;
	protected $messages;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Returns a reference to the a Table object, always creating it.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param	type	The table type to instantiate&lt;br /&gt;
	 * @param	string	A prefix for the table class name. Optional.&lt;br /&gt;
	 * @param	array	Configuration array for model. Optional.&lt;br /&gt;
	 * @return	JTable	A database object&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	public function getTable($type = &#039;HelloWorld&#039;, $prefix = &#039;HelloWorldTable&#039;, $config = array()) &lt;br /&gt;
	{&lt;br /&gt;
		return JTable::getInstance($type, $prefix, $config);&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 * @param  int    The corresponding id of the message to be retrieved&lt;br /&gt;
	 * @return string The message to be displayed to the user&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg($id = 1) &lt;br /&gt;
	{&lt;br /&gt;
		if (!is_array($this-&amp;gt;messages))&lt;br /&gt;
		{&lt;br /&gt;
			$this-&amp;gt;messages = array();&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		if (!isset($this-&amp;gt;messages[$id])) &lt;br /&gt;
		{&lt;br /&gt;
                        //request the selected id&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039; );&lt;br /&gt;
&lt;br /&gt;
			// Get a TableHelloWorld instance&lt;br /&gt;
			$table = $this-&amp;gt;getTable();&lt;br /&gt;
&lt;br /&gt;
			// Load the message&lt;br /&gt;
			$table-&amp;gt;load($id);&lt;br /&gt;
&lt;br /&gt;
			// Assign the message&lt;br /&gt;
			$this-&amp;gt;messages[$id] = $table-&amp;gt;greeting;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		return $this-&amp;gt;messages[$id];&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;
The model now asks the &#039;&#039;TableHelloWorld&#039;&#039; to get the message. This table class has to be defined in &#039;&#039;admin/tables/helloworld.php&#039;&#039; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/tables/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&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import Joomla table library&lt;br /&gt;
jimport(&#039;joomla.database.table&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldTableHelloWorld extends JTable&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param object Database connector object&lt;br /&gt;
	 */&lt;br /&gt;
	function __construct(&amp;amp;$db) &lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct(&#039;#__helloworld&#039;, &#039;id&#039;, $db);&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;
You shouldn&#039;t see any differences, but if you access the database you should see a table named &#039;&#039;jos_helloworld&#039;&#039; with two columns: id and greeting. And two entries: &#039;&#039;Hello World!&#039;&#039; and &#039;&#039;Good bye World&#039;&#039;&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;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-6-using-the-database.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;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Adding a variable request in the menu type &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
|next=Basic backend &amp;lt;!-- next article subpage name --&amp;gt;}}&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:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database&amp;diff=107163</id>
		<title>J3.x:Developing an MVC Component/Using the database</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database&amp;diff=107163"/>
		<updated>2014-01-21T20:08:28Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: /* Packaging the component */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Using the database ==&lt;br /&gt;
Components usually manage their contents using the database. During the install/uninstall/update phase of a component, you can execute SQL queries through the use of SQL text files.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor create two files called &#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039; and &#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;. They should both have the same content, as follows:&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; and &#039;&#039;admin/sql/updates/mysql/0.0.6.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;
   PRIMARY KEY  (`id`)&lt;br /&gt;
) ENGINE=InnoDB 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;
The file &#039;&#039;install.mysql.utf8.sql&#039;&#039; will be executed when you install this component. The file &#039;&#039;0.0.6.sql&#039;&#039; is executed when you do an update.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When the component is installed, the files in the SQL updates folder (for example, &#039;&#039;admin/sql/updates/mysql&#039;&#039;) are read and the name of the last file alphabetically is used to populate the component&#039;s version number in the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; table. This value must be in this table in order for the automatic update to execute the update SQL files for future versions. For this reason, it is good practice to create a SQL update file for each version (even if it is empty or just has a comment). This way the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; version will always match the component version.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When saving the SQL files in utf8, be sure to save them as utf8 NO BOM or the query will fail with MySQL error #1064.&lt;br /&gt;
&lt;br /&gt;
This is the install file. It will be executed if you put an appropriate order in the &#039;&#039;helloworld.xml&#039;&#039; file&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;3.2.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;January 2014&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.6&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;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;/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;!-- 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;/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;
Do the same for the uninstall file:&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039; containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/uninstall.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/sql/uninstall.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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a new field type ==&lt;br /&gt;
For the moment, we have used a [[Developing_a_Model-View-Controller_%28MVC%29_Component_for_Joomla!2.5_-_Part_03|hard coded field type for messages]]. We need to use our database for choosing the message.&lt;br /&gt;
&lt;br /&gt;
Modify the &#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039; file and put these lines&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&lt;br /&gt;
		name=&amp;quot;request&amp;quot;&lt;br /&gt;
		addfieldpath=&amp;quot;/administrator/components/com_helloworld/models/fields&amp;quot;&lt;br /&gt;
	&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;helloworld&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;
			/&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;
It introduces a new field type and tells Joomla to look for the field definition in the &#039;&#039;/administrator/components/com_helloworld/models/fields&#039;&#039; folder.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &#039;&#039;admin/models/fields/helloworld.php&#039;&#039; file containing:&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;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		$query-&amp;gt;select(&#039;id,greeting&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#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;
			}&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;
The new field type displays a drop-down list of messages to choose from. You can see the result of this change in the menu manager section for the helloworld item.&lt;br /&gt;
&lt;br /&gt;
== Display the chosen message ==&lt;br /&gt;
When a menu item of this component is created/updated, Joomla stores the identifier of the message. The &#039;&#039;HelloWorldModelHelloWorld&#039;&#039; model has now to compute the message according to this identifier and the data stored in the database.&lt;br /&gt;
&lt;br /&gt;
Modify the &#039;&#039;site/models/helloworld.php&#039;&#039; file:&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 array messages&lt;br /&gt;
	 */&lt;br /&gt;
	protected $messages;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Returns a reference to the a Table object, always creating it.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param	type	The table type to instantiate&lt;br /&gt;
	 * @param	string	A prefix for the table class name. Optional.&lt;br /&gt;
	 * @param	array	Configuration array for model. Optional.&lt;br /&gt;
	 * @return	JTable	A database object&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	public function getTable($type = &#039;HelloWorld&#039;, $prefix = &#039;HelloWorldTable&#039;, $config = array()) &lt;br /&gt;
	{&lt;br /&gt;
		return JTable::getInstance($type, $prefix, $config);&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 * @param  int    The corresponding id of the message to be retrieved&lt;br /&gt;
	 * @return string The message to be displayed to the user&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg($id = 1) &lt;br /&gt;
	{&lt;br /&gt;
		if (!is_array($this-&amp;gt;messages))&lt;br /&gt;
		{&lt;br /&gt;
			$this-&amp;gt;messages = array();&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		if (!isset($this-&amp;gt;messages[$id])) &lt;br /&gt;
		{&lt;br /&gt;
                        //request the selected id&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039; );&lt;br /&gt;
&lt;br /&gt;
			// Get a TableHelloWorld instance&lt;br /&gt;
			$table = $this-&amp;gt;getTable();&lt;br /&gt;
&lt;br /&gt;
			// Load the message&lt;br /&gt;
			$table-&amp;gt;load($id);&lt;br /&gt;
&lt;br /&gt;
			// Assign the message&lt;br /&gt;
			$this-&amp;gt;messages[$id] = $table-&amp;gt;greeting;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		return $this-&amp;gt;messages[$id];&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;
The model now asks the &#039;&#039;TableHelloWorld&#039;&#039; to get the message. This table class has to be defined in &#039;&#039;admin/tables/helloworld.php&#039;&#039; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/tables/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&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import Joomla table library&lt;br /&gt;
jimport(&#039;joomla.database.table&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldTableHelloWorld extends JTable&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param object Database connector object&lt;br /&gt;
	 */&lt;br /&gt;
	function __construct(&amp;amp;$db) &lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct(&#039;#__helloworld&#039;, &#039;id&#039;, $db);&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;
You shouldn&#039;t see any differences, but if you access the database you should see a table named &#039;&#039;jos_helloworld&#039;&#039; with two columns: id and greeting. And two entries: &#039;&#039;Hello World!&#039;&#039; and &#039;&#039;Good bye World&#039;&#039;&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;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-6-using-the-database.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;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
Note: site/models/helloworld.php is not up-to-date as mentioned on this page. You need to copy the code yourself.&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Adding a variable request in the menu type &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
|next=Basic backend &amp;lt;!-- next article subpage name --&amp;gt;}}&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:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Basic_backend&amp;diff=107162</id>
		<title>J3.x:Developing an MVC Component/Basic backend</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Basic_backend&amp;diff=107162"/>
		<updated>2014-01-21T19:53:07Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Chain the query&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|{{CurrentSTSVer|minor}}}}.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Basic backend ==&lt;br /&gt;
Designing the backend interface leads us to create at least a Model-View-Controller triptych. We have to modify the administrator entry point of our component, the &#039;&#039;admin/helloworld.php&#039;&#039; file&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;
// 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 = JControllerLegacy::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;
// Perform the Request task&lt;br /&gt;
$controller-&amp;gt;execute($task);&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the general controller ==&lt;br /&gt;
The entry point now gets an instance of a &#039;&#039;HelloWorld&#039;&#039; prefixed controller. Let&#039;s create a basic controller for the administrator part:&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 JControllerLegacy&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, $urlparams = 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;
}&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 controller will display the &#039;HelloWorlds&#039; view by default.&lt;br /&gt;
&lt;br /&gt;
== Create the view ==&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, create a file &#039;&#039;admin/views/helloworlds/view.html.php&#039;&#039; containing:&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 JViewLegacy&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;
		// Display the template&lt;br /&gt;
		parent::display($tpl);&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;
In Joomla, views display data using layout. With your favorite file manager and editor, put a file &#039;&#039;admin/views/helloworlds/tmpl/default.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/tmpl/default.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworlds/tmpl/default.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;
// load tooltip behavior&lt;br /&gt;
JHtml::_(&#039;behavior.tooltip&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;form action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php?option=com_helloworld&#039;); ?&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;table class=&amp;quot;adminlist&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;thead&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;head&#039;);?&amp;gt;&amp;lt;/thead&amp;gt;&lt;br /&gt;
		&amp;lt;tfoot&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;foot&#039;);?&amp;gt;&amp;lt;/tfoot&amp;gt;&lt;br /&gt;
		&amp;lt;tbody&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;body&#039;);?&amp;gt;&amp;lt;/tbody&amp;gt;&lt;br /&gt;
	&amp;lt;/table&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;
This layout calls several sub-layout (&#039;&#039;head&#039;&#039;, &#039;&#039;foot&#039;&#039; and &#039;&#039;body&#039;&#039;). Each sub-layout corresponds to a file prefixed by the name of the main layout (&#039;&#039;default&#039;&#039;), and an underscore.&lt;br /&gt;
&lt;br /&gt;
Put a file &#039;&#039;admin/views/helloworlds/tmpl/default_head.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/tmpl/default_head.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworlds/tmpl/default_head.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;
?&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
	&amp;lt;th width=&amp;quot;20&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;?php echo JHtml::_(&#039;grid.checkall&#039;); ?&amp;gt;&lt;br /&gt;
	&amp;lt;/th&amp;gt;&lt;br /&gt;
	&amp;lt;th&amp;gt;&lt;br /&gt;
		&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_HEADING_GREETING&#039;); ?&amp;gt;&lt;br /&gt;
	&amp;lt;/th&amp;gt;&lt;br /&gt;
	&amp;lt;th width=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_HEADING_ID&#039;); ?&amp;gt;&lt;br /&gt;
	&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;COM_HELLOWORLD_HELLOWORLD_HEADING_ID&#039;&#039; and &#039;&#039;COM_HELLOWORLD_HELLOWORLD_HEADING_GREETING&#039;&#039; are placeholders which will later be replaced with language-specific text. The [http://api.joomla.org/Joomla-Platform/Language/JText.html JText::_] method translates a string into the current language.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;checkAll&#039;&#039; is a javascript function defined in the Joomla core able to check all items.&lt;br /&gt;
&lt;br /&gt;
Put a file &#039;&#039;admin/views/helloworlds/tmpl/default_body.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/tmpl/default_body.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworlds/tmpl/default_body.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;
?&amp;gt;&lt;br /&gt;
&amp;lt;?php foreach($this-&amp;gt;items as $i =&amp;gt; $item): ?&amp;gt;&lt;br /&gt;
	&amp;lt;tr class=&amp;quot;row&amp;lt;?php echo $i % 2; ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;td&amp;gt;&lt;br /&gt;
			&amp;lt;?php echo JHtml::_(&#039;grid.id&#039;, $i, $item-&amp;gt;id); ?&amp;gt;&lt;br /&gt;
		&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;td&amp;gt;&lt;br /&gt;
			&amp;lt;?php echo $item-&amp;gt;greeting; ?&amp;gt;&lt;br /&gt;
		&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;td&amp;gt;&lt;br /&gt;
			&amp;lt;?php echo $item-&amp;gt;id; ?&amp;gt;&lt;br /&gt;
		&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;?php endforeach; ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;JHtml::_&#039;&#039; is a helper function able to display several HTML output. In this case, it will display a checkbox for the item.&lt;br /&gt;
&lt;br /&gt;
Put a file &#039;&#039;admin/views/helloworlds/tmpl/default_foot.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/tmpl/default_foot.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworlds/tmpl/default_foot.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;
?&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
	&amp;lt;td colspan=&amp;quot;3&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;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;JPagination&#039;&#039; is a Joomla class able to manage and display pagination object.&lt;br /&gt;
&lt;br /&gt;
== Create the model ==&lt;br /&gt;
The &#039;&#039;HelloWorlds&#039;&#039; view asks the model for data. In Joomla, there is a class able to manage a list of data: &#039;&#039;JModelList&#039;&#039;. Class &#039;&#039;JModelList&#039;&#039; and inherited classes need only one method:&lt;br /&gt;
* &#039;&#039;getListQuery&#039;&#039; which constructs an SQL query&lt;br /&gt;
&lt;br /&gt;
and two states:&lt;br /&gt;
* &#039;&#039;list.start&#039;&#039; for determining the list offset&lt;br /&gt;
* &#039;&#039;list.limit&#039;&#039; for determining the list length&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;getItems&#039;&#039; and &#039;&#039;getPagination&#039;&#039; methods are defined in JModelList class. They don&#039;t need to be defined in the &#039;&#039;HelloWorldModelHelloWorlds&#039;&#039; class.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/helloworlds.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/models/helloworlds.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;
// import the Joomla modellist library&lt;br /&gt;
jimport(&#039;joomla.application.component.modellist&#039;);&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorldList Model&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorlds extends JModelList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to build an SQL query to load the list data.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return	string	An SQL query&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getListQuery()&lt;br /&gt;
	{&lt;br /&gt;
		// Create a new query object.		&lt;br /&gt;
		$db = JFactory::getDBO();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		// Select some fields from the hello table&lt;br /&gt;
		$query&lt;br /&gt;
		    -&amp;gt;select(&#039;id,greeting&#039;)&lt;br /&gt;
		    -&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		&lt;br /&gt;
		return $query;&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;
The &#039;&#039;_populateState&#039;&#039; method is, by default, automatically called when a state is read by the &#039;&#039;getState&#039;&#039; method.&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;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-7-basic-backend.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;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&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;version&amp;gt;0.0.7&amp;lt;/version&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;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;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;menu&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&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;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&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;/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;
Now you can see in your component &#039;&#039;&#039;hello-world&#039;&#039;&#039; an array with two colums, two rows and checkboxes. You can click the checkboxes in order to select the different options you want.&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Using the database &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
|next=Adding language management &amp;lt;!-- next article subpage name --&amp;gt;}}&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:presto|Preston Smith]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Basic_backend&amp;diff=107161</id>
		<title>J3.x:Developing an MVC Component/Basic backend</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Basic_backend&amp;diff=107161"/>
		<updated>2014-01-21T19:49:12Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Updating default backend view to me more like Joomla 3 layout&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|{{CurrentSTSVer|minor}}}}.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Basic backend ==&lt;br /&gt;
Designing the backend interface leads us to create at least a Model-View-Controller triptych. We have to modify the administrator entry point of our component, the &#039;&#039;admin/helloworld.php&#039;&#039; file&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;
// 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 = JControllerLegacy::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;
// Perform the Request task&lt;br /&gt;
$controller-&amp;gt;execute($task);&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the general controller ==&lt;br /&gt;
The entry point now gets an instance of a &#039;&#039;HelloWorld&#039;&#039; prefixed controller. Let&#039;s create a basic controller for the administrator part:&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 JControllerLegacy&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, $urlparams = 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;
}&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 controller will display the &#039;HelloWorlds&#039; view by default.&lt;br /&gt;
&lt;br /&gt;
== Create the view ==&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, create a file &#039;&#039;admin/views/helloworlds/view.html.php&#039;&#039; containing:&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 JViewLegacy&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;
		// Display the template&lt;br /&gt;
		parent::display($tpl);&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;
In Joomla, views display data using layout. With your favorite file manager and editor, put a file &#039;&#039;admin/views/helloworlds/tmpl/default.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/tmpl/default.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworlds/tmpl/default.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;
// load tooltip behavior&lt;br /&gt;
JHtml::_(&#039;behavior.tooltip&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;form action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php?option=com_helloworld&#039;); ?&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;table class=&amp;quot;adminlist&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;thead&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;head&#039;);?&amp;gt;&amp;lt;/thead&amp;gt;&lt;br /&gt;
		&amp;lt;tfoot&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;foot&#039;);?&amp;gt;&amp;lt;/tfoot&amp;gt;&lt;br /&gt;
		&amp;lt;tbody&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;body&#039;);?&amp;gt;&amp;lt;/tbody&amp;gt;&lt;br /&gt;
	&amp;lt;/table&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;
This layout calls several sub-layout (&#039;&#039;head&#039;&#039;, &#039;&#039;foot&#039;&#039; and &#039;&#039;body&#039;&#039;). Each sub-layout corresponds to a file prefixed by the name of the main layout (&#039;&#039;default&#039;&#039;), and an underscore.&lt;br /&gt;
&lt;br /&gt;
Put a file &#039;&#039;admin/views/helloworlds/tmpl/default_head.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/tmpl/default_head.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworlds/tmpl/default_head.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;
?&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
	&amp;lt;th width=&amp;quot;20&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;?php echo JHtml::_(&#039;grid.checkall&#039;); ?&amp;gt;&lt;br /&gt;
	&amp;lt;/th&amp;gt;&lt;br /&gt;
	&amp;lt;th&amp;gt;&lt;br /&gt;
		&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_HEADING_GREETING&#039;); ?&amp;gt;&lt;br /&gt;
	&amp;lt;/th&amp;gt;&lt;br /&gt;
	&amp;lt;th width=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_HEADING_ID&#039;); ?&amp;gt;&lt;br /&gt;
	&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;COM_HELLOWORLD_HELLOWORLD_HEADING_ID&#039;&#039; and &#039;&#039;COM_HELLOWORLD_HELLOWORLD_HEADING_GREETING&#039;&#039; are placeholders which will later be replaced with language-specific text. The [http://api.joomla.org/Joomla-Platform/Language/JText.html JText::_] method translates a string into the current language.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;checkAll&#039;&#039; is a javascript function defined in the Joomla core able to check all items.&lt;br /&gt;
&lt;br /&gt;
Put a file &#039;&#039;admin/views/helloworlds/tmpl/default_body.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/tmpl/default_body.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworlds/tmpl/default_body.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;
?&amp;gt;&lt;br /&gt;
&amp;lt;?php foreach($this-&amp;gt;items as $i =&amp;gt; $item): ?&amp;gt;&lt;br /&gt;
	&amp;lt;tr class=&amp;quot;row&amp;lt;?php echo $i % 2; ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;td&amp;gt;&lt;br /&gt;
			&amp;lt;?php echo JHtml::_(&#039;grid.id&#039;, $i, $item-&amp;gt;id); ?&amp;gt;&lt;br /&gt;
		&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;td&amp;gt;&lt;br /&gt;
			&amp;lt;?php echo $item-&amp;gt;greeting; ?&amp;gt;&lt;br /&gt;
		&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;td&amp;gt;&lt;br /&gt;
			&amp;lt;?php echo $item-&amp;gt;id; ?&amp;gt;&lt;br /&gt;
		&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;?php endforeach; ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;JHtml::_&#039;&#039; is a helper function able to display several HTML output. In this case, it will display a checkbox for the item.&lt;br /&gt;
&lt;br /&gt;
Put a file &#039;&#039;admin/views/helloworlds/tmpl/default_foot.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/tmpl/default_foot.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworlds/tmpl/default_foot.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;
?&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
	&amp;lt;td colspan=&amp;quot;3&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;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;JPagination&#039;&#039; is a Joomla class able to manage and display pagination object.&lt;br /&gt;
&lt;br /&gt;
== Create the model ==&lt;br /&gt;
The &#039;&#039;HelloWorlds&#039;&#039; view asks the model for data. In Joomla, there is a class able to manage a list of data: &#039;&#039;JModelList&#039;&#039;. Class &#039;&#039;JModelList&#039;&#039; and inherited classes need only one method:&lt;br /&gt;
* &#039;&#039;getListQuery&#039;&#039; which constructs an SQL query&lt;br /&gt;
&lt;br /&gt;
and two states:&lt;br /&gt;
* &#039;&#039;list.start&#039;&#039; for determining the list offset&lt;br /&gt;
* &#039;&#039;list.limit&#039;&#039; for determining the list length&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;getItems&#039;&#039; and &#039;&#039;getPagination&#039;&#039; methods are defined in JModelList class. They don&#039;t need to be defined in the &#039;&#039;HelloWorldModelHelloWorlds&#039;&#039; class.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/helloworlds.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/models/helloworlds.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;
// import the Joomla modellist library&lt;br /&gt;
jimport(&#039;joomla.application.component.modellist&#039;);&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorldList Model&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorlds extends JModelList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to build an SQL query to load the list data.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return	string	An SQL query&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getListQuery()&lt;br /&gt;
	{&lt;br /&gt;
		// Create a new query object.		&lt;br /&gt;
		$db = JFactory::getDBO();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		// Select some fields&lt;br /&gt;
		$query-&amp;gt;select(&#039;id,greeting&#039;);&lt;br /&gt;
		// From the hello table&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		return $query;&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;
The &#039;&#039;_populateState&#039;&#039; method is, by default, automatically called when a state is read by the &#039;&#039;getState&#039;&#039; method.&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;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-7-basic-backend.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;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&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;version&amp;gt;0.0.7&amp;lt;/version&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;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;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;menu&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&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;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&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;/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;
Now you can see in your component &#039;&#039;&#039;hello-world&#039;&#039;&#039; an array with two colums, two rows and checkboxes. You can click the checkboxes in order to select the different options you want.&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Using the database &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
|next=Adding language management &amp;lt;!-- next article subpage name --&amp;gt;}}&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:presto|Preston Smith]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Basic_backend&amp;diff=107159</id>
		<title>J3.x:Developing an MVC Component/Basic backend</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Basic_backend&amp;diff=107159"/>
		<updated>2014-01-21T19:43:24Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Update request task to match frontend controller&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|{{CurrentSTSVer|minor}}}}.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Basic backend ==&lt;br /&gt;
Designing the backend interface leads us to create at least a Model-View-Controller triptych. We have to modify the administrator entry point of our component, the &#039;&#039;admin/helloworld.php&#039;&#039; file&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;
// 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 = JControllerLegacy::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;
// Perform the Request task&lt;br /&gt;
$controller-&amp;gt;execute($task);&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the general controller ==&lt;br /&gt;
The entry point now gets an instance of a &#039;&#039;HelloWorld&#039;&#039; prefixed controller. Let&#039;s create a basic controller for the administrator part:&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 JControllerLegacy&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, $urlparams = 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;
}&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 controller will display the &#039;HelloWorlds&#039; view by default.&lt;br /&gt;
&lt;br /&gt;
== Create the view ==&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, create a file &#039;&#039;admin/views/helloworlds/view.html.php&#039;&#039; containing:&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 JViewLegacy&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;
		// Display the template&lt;br /&gt;
		parent::display($tpl);&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;
In Joomla, views display data using layout. With your favorite file manager and editor, put a file &#039;&#039;admin/views/helloworlds/tmpl/default.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/tmpl/default.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworlds/tmpl/default.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;
// load tooltip behavior&lt;br /&gt;
JHtml::_(&#039;behavior.tooltip&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;form action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php?option=com_helloworld&#039;); ?&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;table class=&amp;quot;adminlist&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;thead&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;head&#039;);?&amp;gt;&amp;lt;/thead&amp;gt;&lt;br /&gt;
		&amp;lt;tfoot&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;foot&#039;);?&amp;gt;&amp;lt;/tfoot&amp;gt;&lt;br /&gt;
		&amp;lt;tbody&amp;gt;&amp;lt;?php echo $this-&amp;gt;loadTemplate(&#039;body&#039;);?&amp;gt;&amp;lt;/tbody&amp;gt;&lt;br /&gt;
	&amp;lt;/table&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;
This layout calls several sub-layout (&#039;&#039;head&#039;&#039;, &#039;&#039;foot&#039;&#039; and &#039;&#039;body&#039;&#039;). Each sub-layout corresponds to a file prefixed by the name of the main layout (&#039;&#039;default&#039;&#039;), and an underscore.&lt;br /&gt;
&lt;br /&gt;
Put a file &#039;&#039;admin/views/helloworlds/tmpl/default_head.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/tmpl/default_head.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworlds/tmpl/default_head.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;
?&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
	&amp;lt;th width=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_HEADING_ID&#039;); ?&amp;gt;&lt;br /&gt;
	&amp;lt;/th&amp;gt;&lt;br /&gt;
	&amp;lt;th width=&amp;quot;20&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;?php echo JHtml::_(&#039;grid.checkall&#039;); ?&amp;gt;&lt;br /&gt;
	&amp;lt;/th&amp;gt;			&lt;br /&gt;
	&amp;lt;th&amp;gt;&lt;br /&gt;
		&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_HEADING_GREETING&#039;); ?&amp;gt;&lt;br /&gt;
	&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;COM_HELLOWORLD_HELLOWORLD_HEADING_ID&#039;&#039; and &#039;&#039;COM_HELLOWORLD_HELLOWORLD_HEADING_GREETING&#039;&#039; are placeholders which will later be replaced with language-specific text. The [http://api.joomla.org/Joomla-Platform/Language/JText.html JText::_] method translates a string into the current language.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;checkAll&#039;&#039; is a javascript function defined in the Joomla core able to check all items.&lt;br /&gt;
&lt;br /&gt;
Put a file &#039;&#039;admin/views/helloworlds/tmpl/default_body.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/tmpl/default_body.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworlds/tmpl/default_body.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;
?&amp;gt;&lt;br /&gt;
&amp;lt;?php foreach($this-&amp;gt;items as $i =&amp;gt; $item): ?&amp;gt;&lt;br /&gt;
	&amp;lt;tr class=&amp;quot;row&amp;lt;?php echo $i % 2; ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;td&amp;gt;&lt;br /&gt;
			&amp;lt;?php echo $item-&amp;gt;id; ?&amp;gt;&lt;br /&gt;
		&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;td&amp;gt;&lt;br /&gt;
			&amp;lt;?php echo JHtml::_(&#039;grid.id&#039;, $i, $item-&amp;gt;id); ?&amp;gt;&lt;br /&gt;
		&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;td&amp;gt;&lt;br /&gt;
			&amp;lt;?php echo $item-&amp;gt;greeting; ?&amp;gt;&lt;br /&gt;
		&amp;lt;/td&amp;gt;&lt;br /&gt;
	&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;?php endforeach; ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;JHtml::_&#039;&#039; is a helper function able to display several HTML output. In this case, it will display a checkbox for the item.&lt;br /&gt;
&lt;br /&gt;
Put a file &#039;&#039;admin/views/helloworlds/tmpl/default_foot.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/tmpl/default_foot.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/views/helloworlds/tmpl/default_foot.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;
?&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
	&amp;lt;td colspan=&amp;quot;3&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;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;JPagination&#039;&#039; is a Joomla class able to manage and display pagination object.&lt;br /&gt;
&lt;br /&gt;
== Create the model ==&lt;br /&gt;
The &#039;&#039;HelloWorlds&#039;&#039; view asks the model for data. In Joomla, there is a class able to manage a list of data: &#039;&#039;JModelList&#039;&#039;. Class &#039;&#039;JModelList&#039;&#039; and inherited classes need only one method:&lt;br /&gt;
* &#039;&#039;getListQuery&#039;&#039; which constructs an SQL query&lt;br /&gt;
&lt;br /&gt;
and two states:&lt;br /&gt;
* &#039;&#039;list.start&#039;&#039; for determining the list offset&lt;br /&gt;
* &#039;&#039;list.limit&#039;&#039; for determining the list length&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;getItems&#039;&#039; and &#039;&#039;getPagination&#039;&#039; methods are defined in JModelList class. They don&#039;t need to be defined in the &#039;&#039;HelloWorldModelHelloWorlds&#039;&#039; class.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/helloworlds.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/models/helloworlds.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;
// import the Joomla modellist library&lt;br /&gt;
jimport(&#039;joomla.application.component.modellist&#039;);&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorldList Model&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorlds extends JModelList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to build an SQL query to load the list data.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return	string	An SQL query&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getListQuery()&lt;br /&gt;
	{&lt;br /&gt;
		// Create a new query object.		&lt;br /&gt;
		$db = JFactory::getDBO();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		// Select some fields&lt;br /&gt;
		$query-&amp;gt;select(&#039;id,greeting&#039;);&lt;br /&gt;
		// From the hello table&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		return $query;&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;
The &#039;&#039;_populateState&#039;&#039; method is, by default, automatically called when a state is read by the &#039;&#039;getState&#039;&#039; method.&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;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#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;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Using_the_database#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-7-basic-backend.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;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&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;version&amp;gt;0.0.7&amp;lt;/version&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;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;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;menu&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&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;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&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;/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;
Now you can see in your component &#039;&#039;&#039;hello-world&#039;&#039;&#039; an array with two colums, two rows and checkboxes. You can click the checkboxes in order to select the different options you want.&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Using the database &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
|next=Adding language management &amp;lt;!-- next article subpage name --&amp;gt;}}&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:presto|Preston Smith]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=GSOC_2014_Project_Ideas&amp;diff=107145</id>
		<title>GSOC 2014 Project Ideas</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=GSOC_2014_Project_Ideas&amp;diff=107145"/>
		<updated>2014-01-21T12:02:57Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: /* Joomla CMS Ideas */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:GSOC_2014.png|300px|left]]&lt;br /&gt;
&lt;br /&gt;
Welcome to the Joomla! Google Summer of Code (GSoC) 2014 project ideas page. As we move forward with the 2013 version of the Joomla! GSoC, we will use this page to develop possible project ideas. Please note that anyone who is interested can participate in this process. You do not have to be a GSoC student or mentor to suggest possible project ideas. Please keep in mind that projects need to be realistically something that is able to be functionally completed by a student working full time for about eight weeks. Thanks!&lt;br /&gt;
&lt;br /&gt;
Discussion of ideas and other GSoC related items is welcome on our Google Group: https://groups.google.com/forum/?fromgroups#!forum/joomla-gsoc-2013&lt;br /&gt;
&lt;br /&gt;
If you are interested in participating as a student please review the materials on applying that are available at [http://www.google-melange.com/gsoc/document/show/gsoc_program/google/gsoc2013/help_page Google].  We strongly encourage you to ask questions about process and ideas on the mailing list.&lt;br /&gt;
&lt;br /&gt;
If you are interested in serving as a mentor, please fill out the [https://docs.google.com/a/community.joomla.org/spreadsheet/viewform?formkey=dHA2V1lJbThYQXpwMERiRG1FOTZlV3c6MA Mentor Application Form 2013].&lt;br /&gt;
&lt;br /&gt;
== Ideas ==&lt;br /&gt;
&lt;br /&gt;
Opportunities exist for students to work with projects from either the Joomla CMS, the Joomla Framework or in some cases a combination of both.&lt;br /&gt;
&lt;br /&gt;
In addition to this ideas list, the Joomla! Community is able to voice their opinion on features they would like to see via the [http://ideas.joomla.org/ Joomla! Idea Pool].  Those wishing to add ideas to this listing are encouraged to review the Idea Pool and base their idea on the input received there. You can also view the past lists for [[GSOC_2012_Project_Ideas|2013]], [[GSOC_2012_Project_Ideas|2012]], [[Summer_of_Code_2010_Project_Ideas|2010]] and [[Summer_of_Code_2009_Project_Ideas|2009]], which may be useful for reference. We ask that you keep ideas realistic for the time frame that students will have to complete their projects.&lt;br /&gt;
&lt;br /&gt;
Unless a mentor has proposed a specific project, mentors from the mentor pool will be matched with student projects. However members of the mentor pool are available to answer questions on the Joomla GSoC mailing list.&lt;br /&gt;
&lt;br /&gt;
== Joomla CMS Ideas ==&lt;br /&gt;
&lt;br /&gt;
* [http://github.com/joomla/joomla-cms Source Code]&lt;br /&gt;
* [http://groups.google.com/d/forum/joomla-dev-cms Developer Mailing List]&lt;br /&gt;
&lt;br /&gt;
{{tip|Please add your CMS project ideas below. You can use the &#039;&#039;&#039;[[GSOC 2014 Project Ideas/template|GSOC 2014 Project template]]&#039;&#039;&#039;.|title=Adding Project Ideas}}&lt;br /&gt;
&lt;br /&gt;
===Project: Build New Media Manager for CMS 3===&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Brief Explanation:&#039;&#039;&#039; The current media manager is outdated and limited. Build a new media manager to include a better user interface, more robust functionality, and seamless integration for extensions to use. The improvements could include: &lt;br /&gt;
:* Storage of media information in the database (including standard file property information, created by user and date, rights and other meta data and tracking of media as assets).&lt;br /&gt;
:* Allow renaming of files&lt;br /&gt;
:* Automated creation of thumbnails to dimensions that the webmaster can configure&lt;br /&gt;
:* Support for a variety of media types that addresses security concerns &lt;br /&gt;
:* Creation of a number of controllers for media manipulation such as cropping, resizing and filtering and implementation of their use.&lt;br /&gt;
:* Use of nesting for management and display of media options&lt;br /&gt;
:* Management of both local and remote media&lt;br /&gt;
:* Support for creation of collections of media for example for display in a carousel as a separate content type.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Expected Results:&#039;&#039;&#039; A new Media Manager component to improve the usability, functionality, and reusability of the extension.  Work should be fully documented and include system tests as well as unit tests for all new classes.&lt;br /&gt;
&lt;br /&gt;
: The work will likely include creation of a new media management package in the CMS library as well as reusable controllers for media related tasks. &lt;br /&gt;
&lt;br /&gt;
: The work should align with other work in the content model and the student should expect to interact extensively with the team working on the Joomla 3.2 release. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Knowledge Prerequisite:&#039;&#039;&#039;  PHP, MySQL, Javascript, Joomla CMS, Joomla Platform, HTML5, Usability&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Difficulty:&#039;&#039;&#039; Medium&lt;br /&gt;
&lt;br /&gt;
=== Project: Create a baseline component based on the Unified Content Model ===&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Brief explanation:&#039;&#039;&#039; Create a baseline component based on the Unified Content Model which could potentially replace the existing com_content&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Expected Results:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Knowledge Prerequisite:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Difficulty:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Project: Decouple extension dependencies ===&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Brief explanation:&#039;&#039;&#039; In the current version of the CMS, some extensions rely on one another for functionality. The ultimate goal is for each extension to be completely independent so that it could be removed without breaking the functionality of another.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Expected Results:&#039;&#039;&#039; All extensions in the CMS to be completely independent of one another.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Knowledge Prerequisite:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Difficulty:&#039;&#039;&#039; Medium&lt;br /&gt;
&lt;br /&gt;
=== Project: Develop dependency manager ===&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Brief explanation:&#039;&#039;&#039; Distributions are one of the next possible evolutionary steps for the CMS. One key challenge to solve is the management of dependencies that extensions/packages may have.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Expected Results:&#039;&#039;&#039; A working proof of concept that manages the handling of dependencies as well as define requirements that extensions/packages must meet for their dependencies to be managed by this system.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Knowledge Prerequisite:&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Difficulty:&#039;&#039;&#039; Very challenging, but highly rewarding.&lt;br /&gt;
&lt;br /&gt;
=== Project: Test, test, test ===&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Brief explanation:&#039;&#039;&#039; The CMS currently has a fairly large backlog of open issues. Many just need someone to verify them and follow up with the issue originator.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Expected Results:&#039;&#039;&#039; To have all open issues to be acted upon, verified, closed if no longer valid, or tested for merging into the CMS.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Knowledge Prerequisite:&#039;&#039;&#039; Git, patch application.&lt;br /&gt;
&lt;br /&gt;
=== Project: Document CMS features ===&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Brief explanation:&#039;&#039;&#039; Joomla 3 introduced new features, not all of which are fully documented.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Expected Results:&#039;&#039;&#039; Carefully review docs.joomla.org and ensure that all necessary documentation is in place, reorganized if necessary, and namedspaced for the appropriate version number. Either create missing documentation, or lead members of the community in its creation.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Knowledge Prerequisite:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Difficulty:&#039;&#039;&#039; Easy/Medium&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Difficulty:&#039;&#039;&#039; Easy&lt;br /&gt;
&lt;br /&gt;
== Joomla Framework ==&lt;br /&gt;
&lt;br /&gt;
The Joomla Framework project ideas allows for ideas that can work within the Joomla CMS, or could be completely separate applications that have no connection at all. The Joomla Framework allows for applications to be built for the command line, process daemons and the web. &lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
*[http://github.com/joomla/joomla-framework github Source Code]&lt;br /&gt;
*[http://developer.joomla.org/framework/roadmap.html Development Roadmap]&lt;br /&gt;
*[http://groups.google.com/d/forum/joomla-dev-framework Developer Mailing List]&lt;br /&gt;
&lt;br /&gt;
All code contributions must follow Joomla coding standards and include full unit test coverage.&lt;br /&gt;
&lt;br /&gt;
{{tip|Please add your Framework project ideas below. You can use the &#039;&#039;&#039;[[GSOC 2014 Project Ideas/template|GSOC 2014 Project template]]&#039;&#039;&#039;.|title=Adding Project Ideas}}&lt;br /&gt;
&lt;br /&gt;
===Project: Framework Unit Testing===&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Brief explanation:&#039;&#039;&#039; The Joomla Framework has a good suite of automated Unit Tests, but code coverage is lacking in some areas. The goal of this project is to improve the code coverage by writing unit tests for the Joomla Framework.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Expected Results:&#039;&#039;&#039; The student will be expected to review the current [http://developer.joomla.org/coverage/ code coverage report] for the Joomla Framework and write and agreed-upon number of unit tests with particular attention to packages that are below 50% coverage. Preference should be given to non-deprecated classes but the student may choose from either the core tree (/libraries/joomla) or the legacy tree (/libraries/legacy).&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Knowledge Prerequisite:&#039;&#039;&#039; PHP, PHPUnit&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Difficulty:&#039;&#039;&#039; Medium&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Google Summer of Code 2014]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type&amp;diff=107022</id>
		<title>J3.x:Developing an 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=J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type&amp;diff=107022"/>
		<updated>2014-01-17T20:31:34Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: /* Adding a variable request in the menu type */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|{{CurrentSTSVer|minor}}}}.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] 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!2.5 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;&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;
* the name attribute can be passed to the component in the URL. In this case &#039;&#039;?option=com_helloworld&amp;amp;id=1&#039;&#039;  would indicate that you had chosen option 1.&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;
&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&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;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.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 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;/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;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_04#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_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;[[J3.2:Developing a MVC Component_-_Part_02#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_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;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_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 [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-5-adding-a-menu-variable-request.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;
&lt;br /&gt;
== Navigate ==&lt;br /&gt;
&lt;br /&gt;
[[J3.2:Developing a MVC Component - Part 04|Prev: Adding a model to the site part]]&lt;br /&gt;
[[J3.2:Developing a MVC Component - 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;
*[[User:betweenbrain|Matt Thomas]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type&amp;diff=107021</id>
		<title>J3.x:Developing an 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=J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type&amp;diff=107021"/>
		<updated>2014-01-17T20:30:43Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: /* Adding a variable request in the menu type */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|{{CurrentSTSVer|minor}}}}.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] 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!2.5 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;
* the name attribute can be passed to the component in the URL. In this case &#039;&#039;?option=com_helloworld&amp;amp;id=1&#039;&#039;  would indicate that you had chosen option 1.&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;
&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&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;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.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 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;/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;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_04#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_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;[[J3.2:Developing a MVC Component_-_Part_02#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_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;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_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 [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-5-adding-a-menu-variable-request.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;
&lt;br /&gt;
== Navigate ==&lt;br /&gt;
&lt;br /&gt;
[[J3.2:Developing a MVC Component - Part 04|Prev: Adding a model to the site part]]&lt;br /&gt;
[[J3.2:Developing a MVC Component - 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;
*[[User:betweenbrain|Matt Thomas]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type&amp;diff=107020</id>
		<title>J3.x:Developing an 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=J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type&amp;diff=107020"/>
		<updated>2014-01-17T20:30:16Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|{{CurrentSTSVer|minor}}}}.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] 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!2.5 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;
* the name attribute can be passed to the component in the URL. In this case &#039;&#039;?option=com_helloworld&amp;amp;id=1&#039;&#039;  would indicate that you had chosen option 1.&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;
&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
            $id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&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;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.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 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;/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;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_04#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_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;[[J3.2:Developing a MVC Component_-_Part_02#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_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;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_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 [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-5-adding-a-menu-variable-request.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;
&lt;br /&gt;
== Navigate ==&lt;br /&gt;
&lt;br /&gt;
[[J3.2:Developing a MVC Component - Part 04|Prev: Adding a model to the site part]]&lt;br /&gt;
[[J3.2:Developing a MVC Component - 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;
*[[User:betweenbrain|Matt Thomas]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_model_to_the_site_part&amp;diff=107019</id>
		<title>J3.x:Developing an MVC Component/Adding a model to the site part</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_model_to_the_site_part&amp;diff=107019"/>
		<updated>2014-01-17T20:13:07Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|{{CurrentSTSVer|minor}}}}.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Adding a model ==&lt;br /&gt;
In the Joomla framework, models are responsible for managing the data. The first function that has to be written for a model is a &#039;&#039;get&#039;&#039; function. It returns data to the caller. In our case, the caller will be the &#039;&#039;HelloWorldViewHelloWorld&#039;&#039; view. By default, the model named &#039;&#039;HelloWorldModelHelloWorld&#039;&#039; residing in &#039;&#039;site/models/helloworld.php&#039;&#039; is the main model associated to this view. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So let&#039;s have a quick look at the naming conventions with an example, since the naming convention are the actual magic, that make everything work:&lt;br /&gt;
&lt;br /&gt;
The class &#039;&#039;HelloWorldView&#039;&#039;&#039;HelloWorld&#039;&#039;&#039;&#039;&#039; resides in &#039;&#039;site/views/&#039;&#039;&#039;helloworld&#039;&#039;&#039;/view.html.php&#039;&#039; and will make use of the class &#039;&#039;HelloWorldModel&#039;&#039;&#039;HelloWorld&#039;&#039;&#039;&#039;&#039; in the file &#039;&#039;site/models/&#039;&#039;&#039;helloworld&#039;&#039;&#039;.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So let&#039;s just assume we want to use an imaginary view &#039;&#039;fluffy&#039;&#039;, you would have to have:&lt;br /&gt;
&lt;br /&gt;
The class &#039;&#039;HelloWorldView&#039;&#039;&#039;Fluffy&#039;&#039;&#039;&#039;&#039; which resides in &#039;&#039;site/views/&#039;&#039;&#039;fluffy&#039;&#039;&#039;/view.html.php&#039;&#039;. The view will make use of &#039;&#039;HelloWorldModel&#039;&#039;&#039;Fluffy&#039;&#039;&#039;&#039;&#039; in the file &#039;&#039;site/models/&#039;&#039;&#039;fluffy&#039;&#039;&#039;.php&#039;&#039;. Note: the actual screen of the view: &#039;&#039;site/views/&#039;&#039;&#039;fluffy&#039;&#039;&#039;/tmpl/default.php&#039;&#039; is required as well to make this example work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Breaking any of these bold conventions will lead to errors or a blank page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So back to the actual implementation of the single classes:&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a &#039;&#039;site/models/helloworld.php&#039;&#039; file containing:&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;
			$this-&amp;gt;msg = &#039;Hello World!&#039;;&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;
The &#039;&#039;HelloWorldViewHelloWorld&#039;&#039; class asks the model for data using the &#039;&#039;get&#039;&#039; method of the &#039;&#039;JView&#039;&#039; class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/view.html.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/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;
 * HTML View class for the HelloWorld Component&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorld extends JView&lt;br /&gt;
{&lt;br /&gt;
	// Overwriting JView display method&lt;br /&gt;
	function display($tpl = null) &lt;br /&gt;
	{&lt;br /&gt;
		// Assign data to the view&lt;br /&gt;
		$this-&amp;gt;msg = $this-&amp;gt;get(&#039;Msg&#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;
			JLog::add(implode(&#039;&amp;lt;br /&amp;gt;&#039;, $errors), JLog::WARNING, &#039;jerror&#039;);&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&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;
Note: $this-&amp;gt;get() is a member of JView::get which is a proxy to get* methods of the default model where * is populated with the value of the first parameter passed to get()&lt;br /&gt;
&lt;br /&gt;
Also modify your &#039;&#039;helloworld.xml&#039;&#039; file to indicate use of models and 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;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.4&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 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;/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;
== 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;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_03#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_02#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_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;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_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 [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-4-adding-a-site-model.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;
== Navigate ==&lt;br /&gt;
&lt;br /&gt;
[[J3.2:Developing a MVC Component - Part 03|Prev: Adding a menu type to the site part]]&lt;br /&gt;
&lt;br /&gt;
[[J3.2:Developing a MVC Component - Part 05|Next: Adding a variable request in the menu type]]&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:Jossnaz|Lukas Meier]]&lt;br /&gt;
*[[User:betweenbrain|Matt Thomas]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_model_to_the_site_part&amp;diff=107018</id>
		<title>J3.x:Developing an MVC Component/Adding a model to the site part</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_model_to_the_site_part&amp;diff=107018"/>
		<updated>2014-01-17T20:11:40Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|{{CurrentSTSVer|minor}}}}.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Adding a model ==&lt;br /&gt;
In the Joomla framework, models are responsible for managing the data. The first function that has to be written for a model is a &#039;&#039;get&#039;&#039; function. It returns data to the caller. In our case, the caller will be the &#039;&#039;HelloWorldViewHelloWorld&#039;&#039; view. By default, the model named &#039;&#039;HelloWorldModelHelloWorld&#039;&#039; residing in &#039;&#039;site/models/helloworld.php&#039;&#039; is the main model associated to this view. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So let&#039;s have a quick look at the naming conventions with an example, since the naming convention are the actual magic, that make everything work:&lt;br /&gt;
&lt;br /&gt;
The class &#039;&#039;HelloWorldView&#039;&#039;&#039;HelloWorld&#039;&#039;&#039;&#039;&#039; resides in &#039;&#039;site/views/&#039;&#039;&#039;helloworld&#039;&#039;&#039;/view.html.php&#039;&#039; and will make use of the class &#039;&#039;HelloWorldModel&#039;&#039;&#039;HelloWorld&#039;&#039;&#039;&#039;&#039; in the file &#039;&#039;site/models/&#039;&#039;&#039;helloworld&#039;&#039;&#039;.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So let&#039;s just assume we want to use an imaginary view &#039;&#039;fluffy&#039;&#039;, you would have to have:&lt;br /&gt;
&lt;br /&gt;
The class &#039;&#039;HelloWorldView&#039;&#039;&#039;Fluffy&#039;&#039;&#039;&#039;&#039; which resides in &#039;&#039;site/views/&#039;&#039;&#039;fluffy&#039;&#039;&#039;/view.html.php&#039;&#039;. The view will make use of &#039;&#039;HelloWorldModel&#039;&#039;&#039;Fluffy&#039;&#039;&#039;&#039;&#039; in the file &#039;&#039;site/models/&#039;&#039;&#039;fluffy&#039;&#039;&#039;.php&#039;&#039;. Note: the actual screen of the view: &#039;&#039;site/views/&#039;&#039;&#039;fluffy&#039;&#039;&#039;/tmpl/default.php&#039;&#039; is required as well to make this example work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Breaking any of these bold conventions will lead to errors or a blank page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So back to the actual implementation of the single classes:&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a &#039;&#039;site/models/helloworld.php&#039;&#039; file containing:&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;
			$this-&amp;gt;msg = &#039;Hello World!&#039;;&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;
The &#039;&#039;HelloWorldViewHelloWorld&#039;&#039; class asks the model for data using the &#039;&#039;get&#039;&#039; method of the &#039;&#039;JView&#039;&#039; class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/view.html.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/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;
 * HTML View class for the HelloWorld Component&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorld extends JView&lt;br /&gt;
{&lt;br /&gt;
	// Overwriting JView display method&lt;br /&gt;
	function display($tpl = null) &lt;br /&gt;
	{&lt;br /&gt;
		// Assign data to the view&lt;br /&gt;
		$this-&amp;gt;msg = $this-&amp;gt;get(&#039;Msg&#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;
			JLog::add(implode(&#039;&amp;lt;br /&amp;gt;&#039;, $errors), JLog::WARNING, &#039;jerror&#039;);&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&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;
Note: $this-&amp;gt;get() is a member of JView::get which is a proxy to get* methods of the default model where * is populated with the value of the first parameter passed to get()&lt;br /&gt;
&lt;br /&gt;
Also modify your &#039;&#039;helloworld.xml&#039;&#039; file to indicate use of models and 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;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.4&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 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;/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;
== 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;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_03#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_02#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_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;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_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 [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-4-adding-a-site-model.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;
== Navigate ==&lt;br /&gt;
&lt;br /&gt;
[[J3.2:Developing a MVC Component - Part 03|Prev: Adding a menu type to the site part]]&lt;br /&gt;
&lt;br /&gt;
[[J3.2:Developing a MVC Component - Part 05|Next: Adding a variable request in the menu type]]&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:Jossnaz|Lukas Meier]]&lt;br /&gt;
*[[User:betweenbrain|Matt Thomas]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_menu_type_to_the_site_part&amp;diff=107009</id>
		<title>J3.x:Developing an MVC Component/Adding a menu type to the site part</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_menu_type_to_the_site_part&amp;diff=107009"/>
		<updated>2014-01-17T19:43:29Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: /* Packaging the component */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|{{CurrentSTSVer|minor}}}}.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component|Developing a MVC Component for Joomla!3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
Generally speaking, this article describes how to get a link on your joomla page to open a specific page of your component. This gets simply done by adding an xml file to your specific page into your view folder. &lt;br /&gt;
&lt;br /&gt;
E.g.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;site/views/helloworld/tmpl/&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Contains your view page &#039;&#039;default.php&#039;&#039; that we want to open.&lt;br /&gt;
&lt;br /&gt;
A file &#039;&#039;default.xml&#039;&#039; is placed next to this file with some xml. This makes joomla able to recognize the view file &#039;&#039;default.php&#039;&#039; as a menu item.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a menu item type ==&lt;br /&gt;
In the Joomla framework, components are executed using menu items. If you go in the menu manager of your Joomla installation a &#039;&#039;HelloWorld&#039;&#039; menu item type does not yet exist. Adding this functionality is easy in Joomla. Simply put a &#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039; file containing:&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;&lt;br /&gt;
			&amp;lt;![CDATA[COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC]]&amp;gt;&lt;br /&gt;
		&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&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;
For the moment the strings won&#039;t be translated in the administrator interface. We will see in a later article how translation is performed.&lt;br /&gt;
&lt;br /&gt;
Also modify your &#039;&#039;helloworld.xml&#039;&#039; file to indicate a 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;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.3&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 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;/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;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory&lt;br /&gt;
Content of your code directory&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_02#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_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;[[J3.2:Developing a MVC Component_-_Part_02#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_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;
[[File:Com_helloworld-0.0.3.png|thumb|right|Selecting the Menu Item Type]] Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-3-adding-a-site-menu.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. To do so select &amp;quot;Add New Menu Item&amp;quot; from the one of the menus in the &amp;quot;Menus&amp;quot; menu; then you can select COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE for Menu Item Type. Once selected you can see the Link information is populated with the URL for the view.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Navigate ==&lt;br /&gt;
&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!3.2 - Part 02|Prev: Adding a view to the site part]]&lt;br /&gt;
&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!3.2 - Part 04|Next: Adding a model to the site part]]&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:Jossnaz|Lukas Meier]]&lt;br /&gt;
*[[User:betweenbrain|Matt Thomas]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_menu_type_to_the_site_part&amp;diff=107008</id>
		<title>J3.x:Developing an MVC Component/Adding a menu type to the site part</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_menu_type_to_the_site_part&amp;diff=107008"/>
		<updated>2014-01-17T19:41:32Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: /* Adding a menu item type */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|{{CurrentSTSVer|minor}}}}.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component|Developing a MVC Component for Joomla!3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
Generally speaking, this article describes how to get a link on your joomla page to open a specific page of your component. This gets simply done by adding an xml file to your specific page into your view folder. &lt;br /&gt;
&lt;br /&gt;
E.g.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;site/views/helloworld/tmpl/&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Contains your view page &#039;&#039;default.php&#039;&#039; that we want to open.&lt;br /&gt;
&lt;br /&gt;
A file &#039;&#039;default.xml&#039;&#039; is placed next to this file with some xml. This makes joomla able to recognize the view file &#039;&#039;default.php&#039;&#039; as a menu item.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a menu item type ==&lt;br /&gt;
In the Joomla framework, components are executed using menu items. If you go in the menu manager of your Joomla installation a &#039;&#039;HelloWorld&#039;&#039; menu item type does not yet exist. Adding this functionality is easy in Joomla. Simply put a &#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039; file containing:&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;&lt;br /&gt;
			&amp;lt;![CDATA[COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC]]&amp;gt;&lt;br /&gt;
		&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&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;
For the moment the strings won&#039;t be translated in the administrator interface. We will see in a later article how translation is performed.&lt;br /&gt;
&lt;br /&gt;
Also modify your &#039;&#039;helloworld.xml&#039;&#039; file to indicate a 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;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.3&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 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;/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;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory&lt;br /&gt;
Content of your code directory&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_02#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_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;[[J3.2:Developing a MVC Component_-_Part_02#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_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;
[[File:Com_helloworld-0.0.3.png|thumb|right|Selecting the Menu Item Type]] Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-4-adding-a-site-model.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. To do so select &amp;quot;Add New Menu Item&amp;quot; from the one of the menus in the &amp;quot;Menus&amp;quot; menu; then you can select COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE for Menu Item Type. Once selected you can see the Link information is populated with the URL for the view.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Navigate ==&lt;br /&gt;
&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!3.2 - Part 02|Prev: Adding a view to the site part]]&lt;br /&gt;
&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!3.2 - Part 04|Next: Adding a model to the site part]]&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:Jossnaz|Lukas Meier]]&lt;br /&gt;
*[[User:betweenbrain|Matt Thomas]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_menu_type_to_the_site_part&amp;diff=107005</id>
		<title>J3.x:Developing an MVC Component/Adding a menu type to the site part</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_menu_type_to_the_site_part&amp;diff=107005"/>
		<updated>2014-01-17T19:39:16Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|{{CurrentSTSVer|minor}}}}.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component|Developing a MVC Component for Joomla!3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
Generally speaking, this article describes how to get a link on your joomla page to open a specific page of your component. This gets simply done by adding an xml file to your specific page into your view folder. &lt;br /&gt;
&lt;br /&gt;
E.g.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;site/views/helloworld/tmpl/&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Contains your view page &#039;&#039;default.php&#039;&#039; that we want to open.&lt;br /&gt;
&lt;br /&gt;
A file &#039;&#039;default.xml&#039;&#039; is placed next to this file with some xml. This makes joomla able to recognize the view file &#039;&#039;default.php&#039;&#039; as a menu item.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a menu item type ==&lt;br /&gt;
In the Joomla framework, components are executed using menu items. If you go in the menu manager of your Joomla installation a &#039;&#039;HelloWorld&#039;&#039; menu item type does not yet exist. Adding this functionality is easy in Joomla. Simply put a &#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039; file containing:&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;&lt;br /&gt;
			&amp;lt;![CDATA[COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC]]&amp;gt;&lt;br /&gt;
		&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&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;
For the moment the strings won&#039;t be translated in the administrator interface. We will see in a later article how translation is performed.&lt;br /&gt;
&lt;br /&gt;
Also modify your &#039;&#039;helloworld.xml&#039;&#039; file to indicate a 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;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.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.3&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 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;/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;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory&lt;br /&gt;
Content of your code directory&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_02#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_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;[[J3.2:Developing a MVC Component_-_Part_02#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing a MVC Component_-_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;
[[File:Com_helloworld-0.0.3.png|thumb|right|Selecting the Menu Item Type]] Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-4-adding-a-site-model.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. To do so select &amp;quot;Add New Menu Item&amp;quot; from the one of the menus in the &amp;quot;Menus&amp;quot; menu; then you can select COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE for Menu Item Type. Once selected you can see the Link information is populated with the URL for the view.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Navigate ==&lt;br /&gt;
&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!3.2 - Part 02|Prev: Adding a view to the site part]]&lt;br /&gt;
&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!3.2 - Part 04|Next: Adding a model to the site part]]&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:Jossnaz|Lukas Meier]]&lt;br /&gt;
*[[User:betweenbrain|Matt Thomas]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Example_of_a_frontend_update_function&amp;diff=107002</id>
		<title>J3.x:Developing an MVC Component/Example of a frontend update function</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Example_of_a_frontend_update_function&amp;diff=107002"/>
		<updated>2014-01-17T19:26:18Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Created page with &amp;quot;{{:J3.1:Developing a MVC Component}}  {{review}}  This is a multiple-article series of tutorials on how to develop a Model-View-Contoller Component for Joomla! Version {{J...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|{{CurrentSTSVer|minor}}}}.&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_an_update_server&amp;diff=107001</id>
		<title>J3.x:Developing an MVC Component/Adding an update server</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_an_update_server&amp;diff=107001"/>
		<updated>2014-01-17T19:25:44Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Created page with &amp;quot;{{:J3.1:Developing a MVC Component}}  {{review}}  This is a multiple-article series of tutorials on how to develop a Model-View-Contoller Component for Joomla! Version {{J...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|{{CurrentSTSVer|minor}}}}.&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_language_filter_facility&amp;diff=107000</id>
		<title>J3.x:Developing an MVC Component/Using the language filter facility</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_language_filter_facility&amp;diff=107000"/>
		<updated>2014-01-17T19:25:21Z</updated>

		<summary type="html">&lt;p&gt;Betweenbrain: Created page with &amp;quot;{{:J3.1:Developing a MVC Component}}  {{review}}  This is a multiple-article series of tutorials on how to develop a Model-View-Contoller Component for Joomla! Version {{J...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
&lt;br /&gt;
This is a multiple-article series of tutorials on how to develop a Model-View-Contoller [[Component]] for Joomla! Version {{JVer|{{CurrentSTSVer|minor}}}}.&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Betweenbrain</name></author>
	</entry>
</feed>