<?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=Waltsjt</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=Waltsjt"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Waltsjt"/>
	<updated>2026-08-14T22:56:59Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Selecting_data_using_JDatabase&amp;diff=264548</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=264548"/>
		<updated>2015-11-30T02:12:38Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Clarify getNumRows() and identify when you should use getAffectedRows()&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;
&amp;lt;noinclude&amp;gt;{{Joomla version|version=3.x}}{{Joomla version|version=2.5|status=eos}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
{{tip|&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
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+.&amp;lt;/translate&amp;gt;|title=&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Version Note&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
This tutorial is split into two independent parts:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
* Inserting, updating and removing data from the database.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
* Selecting data from one or more tables and retrieving it in a variety of different forms&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;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 [[S:MyLanguage/Inserting,_Updating_and_Removing_data_using_JDatabase|click here]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Introduction== &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==The Query== &amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;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).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To obtain a new instance of the JDatabaseQuery class we use the JDatabaseDriver getQuery method:&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
The JDatabaseDriver::getQuery takes an optional argument, $new, which can be true or false (the default being false).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;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.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;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&amp;lt;/translate&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==Selecting Records from a Single Table== &amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
Below is an example of creating a database query using the &amp;lt;tt&amp;gt;JDatabaseQuery&amp;lt;/tt&amp;gt; class. Using the select, from, where and order methods, we can create queries which are flexible, easily readable and portable:&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The query can also be chained to simplify further:&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Chaining can become useful when queries become longer and more complex.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
Grouping can be achieved simply too.  The following query would count the number of articles in each category.&amp;lt;/translate&amp;gt;&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( 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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;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.&amp;lt;/translate&amp;gt;&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;setLimit(&#039;10&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==Selecting Records from Multiple Tables== &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
Using the JDatabaseQuery&#039;s [http://api.joomla.org/11.4/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).&amp;lt;/translate&amp;gt;&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(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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:25--&amp;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:&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
We can use multiple joins to query across more than two tables:&amp;lt;/translate&amp;gt;&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(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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
Notice how chaining makes the source code much more readable for these longer queries.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;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.&amp;lt;/translate&amp;gt;&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(&#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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;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:&amp;lt;/translate&amp;gt;&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(array(&#039;a.*&#039;))&lt;br /&gt;
    -&amp;gt;select($db-&amp;gt;quoteName(array(&#039;b.username&#039;, &#039;b.name&#039;), array(&#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;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Query Results == &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
The database class contains many methods for working with a query&#039;s result set.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Single Value Result === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== loadResult() ==== &amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
Use &#039;&#039;&#039;loadResult()&#039;&#039;&#039; when you expect just a single value back from your database query.&amp;lt;/translate&amp;gt; &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;
! &amp;lt;translate&amp;gt;&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
id&amp;lt;/translate&amp;gt; !! &amp;lt;translate&amp;gt;&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
name&amp;lt;/translate&amp;gt; !! &amp;lt;translate&amp;gt;&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
email&amp;lt;/translate&amp;gt; !! &amp;lt;translate&amp;gt;&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
username&amp;lt;/translate&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| 1 || style=&amp;quot;background:yellow&amp;quot; | John Smith || &amp;lt;translate&amp;gt;&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
johnsmith@domain.example&amp;lt;/translate&amp;gt; || johnsmith&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Magda Hellman || &amp;lt;translate&amp;gt;&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
magda_h@domain.example&amp;lt;/translate&amp;gt; || magdah&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Yvonne de Gaulle || &amp;lt;translate&amp;gt;&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
ydg@domain.example&amp;lt;/translate&amp;gt; || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
This is often the result of a &#039;count&#039; query to get a number of records:&amp;lt;/translate&amp;gt;&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;
$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;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===Single Row Results === &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:44--&amp;gt;&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.&amp;lt;/translate&amp;gt;&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;
! &amp;lt;translate&amp;gt;&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
id&amp;lt;/translate&amp;gt; !! &amp;lt;translate&amp;gt;&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
name&amp;lt;/translate&amp;gt; !! &amp;lt;translate&amp;gt;&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
email&amp;lt;/translate&amp;gt; !! &amp;lt;translate&amp;gt;&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
username&amp;lt;/translate&amp;gt;&lt;br /&gt;
|- style=&amp;quot;background:yellow&amp;quot;&lt;br /&gt;
| 1 || John Smith || &amp;lt;translate&amp;gt;&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
johnsmith@domain.example&amp;lt;/translate&amp;gt; || johnsmith&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Magda Hellman || &amp;lt;translate&amp;gt;&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
magda_h@domain.example&amp;lt;/translate&amp;gt; || magdah&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Yvonne de Gaulle || &amp;lt;translate&amp;gt;&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
ydg@domain.example&amp;lt;/translate&amp;gt; || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== loadRow() ==== &amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;loadRow()&amp;lt;/tt&amp;gt; returns an indexed array from a single record in the table:&amp;lt;/translate&amp;gt; &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;loadRow();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
will give:&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
You can access the individual values by using:&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
Notes:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
# The array indices are numeric starting from zero.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:57--&amp;gt;&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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== loadAssoc() ==== &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;loadAssoc()&amp;lt;/tt&amp;gt; returns an associated array from a single record in the table:&amp;lt;/translate&amp;gt;&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;loadAssoc();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:60--&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;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can access the individual values by using:&amp;lt;/translate&amp;gt;&amp;lt;pre&amp;gt;$row[&#039;name&#039;] // e.g. $row[&#039;email&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:62--&amp;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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== loadObject() ==== &amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
loadObject returns a PHP object from a single record in the table:&amp;lt;/translate&amp;gt;&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;
$result = $db-&amp;gt;loadObject();&lt;br /&gt;
print_r($result);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:65--&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;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
You can access the individual values by using:&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:67--&amp;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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===Single Column Results === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Each of these results functions will return a single column from the database.&amp;lt;/translate&amp;gt; &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;
! &amp;lt;translate&amp;gt;&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
id&amp;lt;/translate&amp;gt; !! &amp;lt;translate&amp;gt;&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
name&amp;lt;/translate&amp;gt; !! &amp;lt;translate&amp;gt;&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
email&amp;lt;/translate&amp;gt; !! &amp;lt;translate&amp;gt;&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
username&amp;lt;/translate&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| 1 || style=&amp;quot;background:yellow&amp;quot; | John Smith || &amp;lt;translate&amp;gt;&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
johnsmith@domain.example&amp;lt;/translate&amp;gt; || johnsmith&lt;br /&gt;
|-&lt;br /&gt;
| 2 || style=&amp;quot;background:yellow&amp;quot; | Magda Hellman || &amp;lt;translate&amp;gt;&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
magda_h@domain.example&amp;lt;/translate&amp;gt; || magdah&lt;br /&gt;
|-&lt;br /&gt;
| 3 || style=&amp;quot;background:yellow&amp;quot; | Yvonne de Gaulle || &amp;lt;translate&amp;gt;&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
ydg@domain.example&amp;lt;/translate&amp;gt; || ydegaulle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== loadColumn() ==== &amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;loadColumn()&amp;lt;/tt&amp;gt; returns an indexed array from a single column in the table:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&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;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
will give:&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
You can access the individual values by using:&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&lt;br /&gt;
# &amp;lt;tt&amp;gt;loadColumn()&amp;lt;/tt&amp;gt; is equivalent to loadColumn(0).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== loadColumn($index) ==== &amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
loadColumn($index) returns an indexed array from a single column in the table:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&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;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:84--&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;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
You can access the individual values by using:&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
loadColumn($index) allows you to iterate through a series of columns in the results&amp;lt;/translate&amp;gt;&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;
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;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
will give:&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Multi-Row Results === &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
Each of these results functions will return multiple records from the database.&amp;lt;/translate&amp;gt; &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;
! &amp;lt;translate&amp;gt;&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
id&amp;lt;/translate&amp;gt; !! &amp;lt;translate&amp;gt;&amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
name&amp;lt;/translate&amp;gt; !! &amp;lt;translate&amp;gt;&amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
email&amp;lt;/translate&amp;gt; !! &amp;lt;translate&amp;gt;&amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
username&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== loadRowList() ==== &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;loadRowList()&amp;lt;/tt&amp;gt; returns an indexed array of indexed arrays from the table records returned by the query:&amp;lt;/translate&amp;gt;&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;loadRowList();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&amp;lt;/translate&amp;gt;&lt;br /&gt;
&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
You can access the individual rows by using:&amp;lt;/translate&amp;gt;&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
Notes:&lt;br /&gt;
# The array indices are numeric starting from zero.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==== loadAssocList() ==== &amp;lt;!--T:101--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;loadAssocList()&amp;lt;/tt&amp;gt; returns an indexed array of associated arrays from the table records returned by the query:&amp;lt;/translate&amp;gt;&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();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
You can access the individual rows by using:&amp;lt;/translate&amp;gt;&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;==== loadAssocList($key) ==== &amp;lt;!--T:106--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;loadAssocList(&#039;key&#039;)&amp;lt;/tt&amp;gt; returns an associated array - indexed on &#039;key&#039; - of associated arrays from the table records returned by the query:&amp;lt;/translate&amp;gt;&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;username&#039;);&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
You can access the individual rows by using:&amp;lt;/translate&amp;gt;&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;] // e.g. $row[&#039;johnsmith&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:111--&amp;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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==== loadAssocList($key, $column) ==== &amp;lt;!--T:112--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;loadAssocList(&#039;key&#039;, &#039;column&#039;)&amp;lt;/tt&amp;gt; returns an associative array, indexed on &#039;key&#039;, of values from the column named &#039;column&#039; returned by the query:&amp;lt;/translate&amp;gt;&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;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:115--&amp;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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==== loadObjectList() ==== &amp;lt;!--T:116--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;loadObjectList()&amp;lt;/tt&amp;gt; returns an indexed array of PHP objects from the table records returned by the query:&amp;lt;/translate&amp;gt;&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;loadObjectList();&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
You can access the individual rows by using:&amp;lt;/translate&amp;gt;&amp;lt;pre&amp;gt;$row[&#039;index&#039;] // e.g. $row[&#039;2&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;==== loadObjectList($key) ==== &amp;lt;!--T:121--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;loadObjectList(&#039;key&#039;)&amp;lt;/tt&amp;gt; returns an associated array - indexed on &#039;key&#039; - of objects from the table records returned by the query:&amp;lt;/translate&amp;gt;&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;loadObjectList(&#039;username&#039;);&lt;br /&gt;
print_r($row);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
will give (with line breaks added for clarity):&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
You can access the individual rows by using:&amp;lt;/translate&amp;gt;&amp;lt;pre&amp;gt;$row[&#039;key_value&#039;] // e.g. $row[&#039;johnsmith&#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
and you can access the individual values by using:&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:126--&amp;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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Miscellaneous Result Set Methods === &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== getNumRows() ==== &amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;getNumRows()&amp;lt;/tt&amp;gt; will return the number of result rows found by the last SELECT or SHOW 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. To retrieve the number of rows affected by a INSERT, UPDATE, REPLACE or DELETE query, use getAffectedRows().&amp;lt;/translate&amp;gt;&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;
$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;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:130--&amp;gt;&lt;br /&gt;
will return&amp;lt;/translate&amp;gt; &amp;lt;pre&amp;gt;3&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
Note: getNumRows() is only valid for statements like SELECT or SHOW that return an actual result set. If you run getNumRows() after loadRowList() - or any other retrieval method - you will get a PHP Warning:&amp;lt;/translate&amp;gt;&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;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
[[Category:Database]]&lt;br /&gt;
[[Category:JFactory]]&lt;br /&gt;
[[Category:Extension development]]&lt;br /&gt;
[[Category:Development Recommended Reading]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</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=261720</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=261720"/>
		<updated>2015-11-17T22:58:45Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: &amp;quot;htdocs&amp;quot; is implicit in the &amp;lt;path_to_com_helloworld&amp;gt; instruction&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;
{{:J3.1:Developing an MVC Component/&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==Note== &amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
* This tutorial is part of the [[S:MyLanguage/J3.x:Developing_an_MVC_Component/Introduction|Developing a MVC Component for Joomla! 3.x]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
* You can follow the steps below to add a view to the Hello World! component, or you can directly download the [https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-2-adding-a-site-view.zip archive]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==Adding a View to Hello World!== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
In this article we will cover how to add a view to a basic Joomla! component. For this example we will be continuing our work on the [[S:MyLanguage/J3.x:Developing_an_MVC_Component/Developing_a_Basic_Component| Hello World!]] component.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
There are several ways to update a Joomla! component. In this tutorial we will focus option 2.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{| border=1&lt;br /&gt;
 | 1&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
Manually add the files into &amp;lt;tt&amp;gt;&amp;lt;path_to_joomla&amp;gt;/&amp;lt;/tt&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 | 2&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
Update using the Joomla! Extension Manager and the original directory, non-compressed, used for the component install&amp;lt;/translate&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 |3&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Update using the Joomla! Extension Manager and an [[S:MyLanguage/Deploying_an_Update_Server| Update Server]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
To add a view you will need to navigate to &amp;lt;tt&amp;gt;com_helloworld&amp;lt;/tt&amp;gt;, which is the original directory we made for our component. Using your preferred file manager, create or update the following files; as you create or update the files, add the source code for each file which is found in [[#File Details|File Details]].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=1&lt;br /&gt;
 | 1&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
Update:&amp;lt;/translate&amp;gt; [[#site/helloworld.php| helloworld.php]]&lt;br /&gt;
 | &amp;lt;tt&amp;gt;&amp;lt;path_to_com_helloworld&amp;gt;/site/helloworld.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 | 2&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Create:&amp;lt;/translate&amp;gt; [[#site/controller.php| controller.php]]&lt;br /&gt;
 | &amp;lt;tt&amp;gt;&amp;lt;path_to_com_helloworld&amp;gt;/site/controller.php&amp;lt;/tt&amp;gt; &lt;br /&gt;
 |-&lt;br /&gt;
 | 3&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Create:&amp;lt;/translate&amp;gt; [[#index.html| index.html]]&lt;br /&gt;
 | &amp;lt;tt&amp;gt;&amp;lt;path_to_com_helloworld&amp;gt;/site/views/index.html&amp;lt;/tt&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 | 4&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
Create:&amp;lt;/translate&amp;gt; [[#index.html| index.html]]&lt;br /&gt;
 | &amp;lt;tt&amp;gt;&amp;lt;path_to_com_helloworld&amp;gt;/site/views/helloworld/index.html&amp;lt;/tt&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 | 5&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Create:&amp;lt;/translate&amp;gt; [[#site/views/helloworld/view.html.php| view.html.php]]&lt;br /&gt;
 | &amp;lt;tt&amp;gt;&amp;lt;path_to_com_helloworld&amp;gt;/site/views/helloworld/view.html.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 | 6&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
Create:&amp;lt;/translate&amp;gt; [[#site/views/helloworld/tml/default.php| default.php]]&lt;br /&gt;
 | &amp;lt;tt&amp;gt;&amp;lt;path_to_joomla&amp;gt;/components/com_helloworld/views/helloworld/tmpl/default.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 | 7&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
Create:&amp;lt;/translate&amp;gt; [[#index.html| index.html]]&lt;br /&gt;
 | &amp;lt;tt&amp;gt;&amp;lt;path_to_com_helloworld&amp;gt;/site/views/helloworld/tmpl/index.html&amp;lt;/tt&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 | 8&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
Update:&amp;lt;/translate&amp;gt; [[#helloworld.xml| helloworld.xml]]&lt;br /&gt;
 | &amp;lt;tt&amp;gt;&amp;lt;path_to_com_helloworld/helloworld.xml&amp;lt;/tt&amp;gt;&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Updating the Hello World! Component === &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
To update the Hello World! Component in the Joomla! website, please follow the same steps for the [[S:MyLanguage/J3.x:Developing_an_MVC_Component/Developing_a_Basic_Component#Installing the Hello World! Component |original installation]].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==File Details== &amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{vanchor|site/helloworld.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&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;
// 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;
{{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;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&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;
 * Hello World Component Controller&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&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;
{{vanchor|site/views/helloworld/view.html.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&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;
/**&lt;br /&gt;
 * HTML View class for the HelloWorld Component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorld extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Display the Hello World view&lt;br /&gt;
	 *&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  void&lt;br /&gt;
	 */&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;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/views/helloworld/tmpl/default.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
 &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;
{{vanchor|index.html}}&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
Note - the same code is used for all folders&amp;lt;/translate&amp;gt;&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;
{{vanchor|helloworld.xml}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,30,31&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;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.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 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;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 link=&#039;index.php?option=com_helloworld&#039;&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;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Code Explanation == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
In case you were curious as to why this works the way it does.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== helloworld.php ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;gt;&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
This enables for a secure entry point into the Joomla! platform. [[JEXEC| JEXEC]] contains a detailed explanation.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$controller = JControllerLegacy::getInstance(&#039;HelloWorld&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
&#039;&#039;[https://api.joomla.org/cms-3/classes/JControllerLegacy.html JControllerLegacy]&#039;&#039; is a base class for a Joomla! Controller. In order for our website to use controllers, we must extend this class in our component. The &#039;&#039;[https://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 &amp;lt;tt&amp;gt;&amp;lt;path_to_joomla&amp;gt;/htdocs/components/com_helloworld/controller.php&amp;lt;/tt&amp;gt;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
After the controller is created, we instruct the controller to execute the task, as defined in the URL: &amp;lt;tt&amp;gt;&amp;lt;yoursite&amp;gt;/joomla/index.php?option=com_helloworld&amp;amp;task=&amp;lt;task_name&amp;gt;&amp;lt;/tt&amp;gt;. If no task is set, the default task &#039;display&#039; will be assumed. When display is used, the &#039;view&#039; variable will decide what will be displayed. Other common tasks are save, edit, new, etc.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$controller-&amp;gt;redirect();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
The controller might decide to redirect the page, usually after a task like &#039;save&#039; has been completed. This last statement takes care of the actual redirection.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
The main entry point, helloworld.php, essentially passes control to the controller, which handles performing the task that was specified in the request.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== controller.php ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class HelloWorldController extends JControllerLegacy&lt;br /&gt;
{&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;translate&amp;gt;&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
When no task is given in the request variables, the default task will be executed. It&#039;s the display task by default. The JControllerLegacy class has such a task. In our example, it will display a view named HelloWorld.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== view.html.php ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class HelloWorldViewHelloWorld extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
&#039;&#039;[https://api.joomla.org/cms-3/classes/JViewLegacy.html JViewLegacy]&#039;&#039; is a base class for a Joomla! View. In our case, this method will display data using the tmpl/default.php file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== default.php ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
This template file will be included by the JViewLegacy class. Therefore, here, $this refers to the HelloWorldViewHelloWorld class.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== helloworld.xml ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;version&amp;gt;0.0.2&amp;lt;/version&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Updates the version number.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&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;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Tells installer application to add controller.php and the views/directory&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==Component Contents== &amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
At this point in the tutorial, your component should contain the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
{| border=1&lt;br /&gt;
 | 1&lt;br /&gt;
 | &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
this is an XML (manifest) file that tells Joomla! how to install our component.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 | 2&lt;br /&gt;
 | &#039;&#039;[[#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
this is the site entry point to the Hello World! component&amp;lt;/translate&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 | 3&lt;br /&gt;
 | &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
prevents web server from listing directory content&amp;lt;/translate&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 | 4&lt;br /&gt;
 | &#039;&#039;[[#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
file representing the controller&amp;lt;/translate&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 | 5&lt;br /&gt;
 | &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
prevents web server from listing directory content&amp;lt;/translate&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 | 6&lt;br /&gt;
 | &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
prevents web server from listing directory content&amp;lt;/translate&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 | 7&lt;br /&gt;
 | &#039;&#039;[[#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
file representing the view&amp;lt;/translate&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 | 8&lt;br /&gt;
 | &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
prevents web server from listing directory content&amp;lt;/translate&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 | 9&lt;br /&gt;
 | &#039;&#039;[[#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039; &lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
the default view&amp;lt;/translate&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 | 10&lt;br /&gt;
 | &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
prevents web server from listing directory content&amp;lt;/translate&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 | 11&lt;br /&gt;
 | &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
this is the administrator entry point to the Hello World! component&amp;lt;/translate&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 | 12&lt;br /&gt;
 | &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
prevents web server from listing directory content&amp;lt;/translate&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 | 13&lt;br /&gt;
 | &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
prevents web server from listing directory content&amp;lt;/translate&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 | 14&lt;br /&gt;
 | &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
prevents web server from listing directory content&amp;lt;/translate&amp;gt;&lt;br /&gt;
 |-&lt;br /&gt;
 | 15&lt;br /&gt;
 | &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_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;
 | &amp;lt;translate&amp;gt;&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
file allowing to initialise schema version of the com_helloworld component.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
{{notice|&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
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.&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
S:MyLanguage/J3.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Prev: Developing a Basic Component&amp;lt;/translate&amp;gt;|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding_a_menu_type_to_the_site_part|Next: Adding a menu type to the site part&amp;lt;/translate&amp;gt;|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
[[Category:Joomla! 3.x]]&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:Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Getting_Started_with_Joomla!&amp;diff=206820</id>
		<title>J3.x:Getting Started with Joomla!</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Getting_Started_with_Joomla!&amp;diff=206820"/>
		<updated>2015-07-20T21:51:36Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Remove old reverences to LTS/STS and correct some release dates&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review|copyedit}} &lt;br /&gt;
{{{{FULLPAGENAME}}/Getting Started pages header}}&lt;br /&gt;
This series of documents introduces Joomla! to people who have not previously used it. This introduction should help you make the best use of the series.&lt;br /&gt;
==Intro==&lt;br /&gt;
===Which versions are covered?===&lt;br /&gt;
* &#039;&#039;&#039;Version 2.5&#039;&#039;&#039; (the version version that replaced versions 1.6 &amp;amp; 1.7) was released January 2012 and reached end of scheduled support on December 31, 2014.&lt;br /&gt;
* &#039;&#039;&#039;Version {{CurrentSTSVer|minor}}&#039;&#039;&#039; (Is the current version in the 3.x series in anticipation of Joomla 3.5) scheduled for release in October 2015.&lt;br /&gt;
&lt;br /&gt;
There are many similarities between the versions but this tutorial is for &#039;&#039;&#039;Joomla! {{ns}}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Who is it written for?===&lt;br /&gt;
The series is for anyone who wants to use Joomla! Its main focus is:&lt;br /&gt;
* Users with limited computing experience&lt;br /&gt;
* Users who are using Joomla! for a small web site. (e.g. club, association, church or small business)&lt;br /&gt;
&lt;br /&gt;
===See also===&lt;br /&gt;
{{other versions}}&lt;br /&gt;
&lt;br /&gt;
==Understanding Joomla!==&lt;br /&gt;
If you&#039;re having trouble visualizing how Joomla! works, it might be useful for you to think of Joomla! as an [[wp:Operating system|operating system (OS)]], like Microsoft Windows, Apple Mac OS or Linux.&lt;br /&gt;
&lt;br /&gt;
The most important similarity is that both your OS and Joomla! are not really intended for direct use. You need to install applications onto your OS (and extensions for Joomla!) to be able to actually do something useful with your computer (and your web site). Just like your OS, Joomla! comes with a few &#039;&#039;core&#039;&#039; extensions that carry out the most important tasks.&lt;br /&gt;
&lt;br /&gt;
Further similarities and differences can be found in the following table.&lt;br /&gt;
===Comparison Table===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;Joomla! compared to an OS (e.g. MS Windows, Mac OS or Linux)&amp;lt;/big&amp;gt;&lt;br /&gt;
! Joomla! concept&lt;br /&gt;
! OS concept&lt;br /&gt;
|-&lt;br /&gt;
| [[Extension]] ||  Added Application (e.g. Word, Chrome, Music Player, Photoshop)&lt;br /&gt;
|-&lt;br /&gt;
| Core extensions || Built-in applications (e.g. Start button, Screen Saver, File Search) &lt;br /&gt;
|-&lt;br /&gt;
| Database || File system (one type of Files)&lt;br /&gt;
|-&lt;br /&gt;
| File system || File system (another type of Files)&lt;br /&gt;
|-&lt;br /&gt;
| Viewing a page || Using an application (Added or Built-in)&lt;br /&gt;
|-&lt;br /&gt;
| Updating Joomla! || Installing updates for your OS (Security patches and bug fixes)&lt;br /&gt;
|-&lt;br /&gt;
| Migrating between Joomla! versions || Installing a new version of your OS&amp;lt;br/&amp;gt;(e.g. moving from MS Windows XP to MS Windows 7)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== What You Will Need ==&lt;br /&gt;
===An Installed Copy of Joomla!===&lt;br /&gt;
For some parts of these tutorials you must have the use of a Joomla! web site. You can follow along just reading the material, but there is no better way of learning than doing. Here are the options available.&lt;br /&gt;
* [[Use Joomla! on your own computer| &#039;&#039;&#039;Install a copy of Joomla! (with Sample Data) on your own computer.&#039;&#039;&#039;]] This is sometimes referred to as a &#039;localhost&#039; installation.  Installing with Sample Data enables you to to explore a Joomla! site before you have created one for your own content. This is a good option for beginners.&lt;br /&gt;
* [[J3.1:Installing Joomla| &#039;&#039;&#039;Install a copy of Joomla! (with Sample Data) on a Hosting server.&#039;&#039;&#039;]] This is sometimes referred to as a &#039;remote host&#039; installation.  Installing with Sample Data enables you to to explore a Joomla! site before you have created one for your own content. This is a good option for beginners.&lt;br /&gt;
* &#039;&#039;&#039;Use an existing Joomla! web site&#039;&#039;&#039;. If you are going to be adding content to an existing site and do not have much computing experience this is a &#039;&#039;&#039;not a good option&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Alternatives===&lt;br /&gt;
* &#039;&#039;&#039;Use a Demo Installation&#039;&#039;&#039;. Many hosts or script installer sites offer &#039;demo&#039; versions of a Joomla! installation. You will at least be able to make changes, but they will not be permanent. &#039;Demo installations&#039; are reset back to a &#039;fresh&#039; installation state at regular intervals.&lt;br /&gt;
* &#039;&#039;&#039;One-click Installation&#039;&#039;&#039;. Many hosts offer a one-click installation of popular web site programs.&lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
===What to Expect===&lt;br /&gt;
Joomla! is introduced using detailed &#039;hands-on&#039; instructions about adding, altering and manipulating content. At the same time, general points about Joomla! are made which are intended to help people to learn and do more. As the tasks require more background knowledge, so there are fewer hands-on instructions and more general pointers to the extensive documentation available for Joomla!&lt;br /&gt;
===Topics===&lt;br /&gt;
The series is divided into multiple parts as indicated by the browsing menu found at the top of this page. You should move from topic to topic in a left to right progression. Each topic will build upon the previous one. Alternatively, you can go right to the part containing the information sought.&lt;br /&gt;
===Remember===&lt;br /&gt;
As you move from Tutorial topic to the next, you can always refer to the [[glossary]] if you forget the meaning of common terms.&lt;br /&gt;
&lt;br /&gt;
== Topics ==&lt;br /&gt;
These topics should be considered the key building blocks of a Joomla! web site. They will give you a foundation upon which to build your Joomla! web site and knowledge upon.&lt;br /&gt;
======Templates======&lt;br /&gt;
Templates control how a Joomla! powered web site appears for users. A template provides a method of integration between content (Articles) and Applications (Modules) in a specific, controlled view. Templates are how a Joomla! powered web site is end-user presented.&lt;br /&gt;
&lt;br /&gt;
======Categories======&lt;br /&gt;
Every part of Joomla! powered web site or any CMS type of web site needs a method to display and store its content logically. The usual method is by categories and subcategories.  Joomla! allows for multiple ways to display and use content controlled by categorisation. This part of the Tutorial will introduce you to the uses of Joomla! categories.&lt;br /&gt;
&lt;br /&gt;
======Articles======&lt;br /&gt;
Articles are the core content of any Joomla! powered web site. Everyone needs to know the basics of how to edit and create them. This tutorial will help you to understand the inner workings of Joomla! articles and their integration into a web page.&lt;br /&gt;
&lt;br /&gt;
======Menus======&lt;br /&gt;
Every web site has some type of navigation system, or menu. They can vary in style from web site to web site, but they all preform the same function. The menu tutorial will explain how menus control content.&lt;br /&gt;
&lt;br /&gt;
======Modules======&lt;br /&gt;
As you have already learned, Extensions and Core Extensions are like a Computer Application (e.g. Word, Excel, Photoshop, Screensaver, File search). Modules are lightweight Joomla! extensions. A module&#039;s display is controlled by the Template and &#039;Menu&#039; Core Extension. They are used as an integration point for Extensions (Applications) along with Articles(Content) into the page views of a Joomla! web site.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
After you complete all Tutorial Topics, you should be able to create a simple website. &lt;br /&gt;
&lt;br /&gt;
===Summing it all up===&lt;br /&gt;
&lt;br /&gt;
*Templates control the look of a Joomla! web site. &lt;br /&gt;
*Categories create a organisational hierarchy to control web site content. &lt;br /&gt;
*Articles are the main type of web site content. &lt;br /&gt;
*Menus provide a navigational method to use or browse the web site content(pages).&lt;br /&gt;
*Modules provide a means to combine web site content(Articles) with extensions(Applications), regardless of whether they are core or add-on(installed, not core) extensions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-3 columns panel radius floatright&amp;quot; style=&amp;quot;background: lightblue; padding:.3em .50em; font-size:115%;&amp;quot;&amp;gt;&amp;lt;span style==&amp;quot;color:black;&amp;quot;&amp;gt;Proceed to [[J3.0:Getting_Started_with_Templates|Templates &amp;amp;rarr;]]&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
&lt;br /&gt;
==Beyond the Basics==&lt;br /&gt;
There is more to learn about Joomla.&lt;br /&gt;
* &#039;&#039;&#039;Beyond the basics: doing more with Jooomla!&#039;&#039;&#039; - this is not yet completed - it points to ways ahead.&lt;br /&gt;
* [[References|&#039;&#039;&#039;Books, links and helpful resources&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Using_the_JTable_class&amp;diff=205989</id>
		<title>Using the JTable class</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Using_the_JTable_class&amp;diff=205989"/>
		<updated>2015-07-16T13:41:26Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: /* Writing an extension of JTable */ remove &amp;amp;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
This tutorial is for {{JVer|3.x}}&lt;br /&gt;
&lt;br /&gt;
== Introduction to JTable ==&lt;br /&gt;
The [https://api.joomla.org/cms-3/classes/JTable.html JTable] class is an implementation of the [http://en.wikipedia.org/wiki/Active_record_pattern Active Record] design pattern. It is used throughout Joomla! for [http://en.wikipedia.org/wiki/Create,_read,_update_and_delete creating, reading, updating, and deleting aka CRUD tasks] for records in the database table. &lt;br /&gt;
&lt;br /&gt;
Since JTable is an abstract class that forms the basis for all database table classes. Some of the methods listed will be overridden by the child class so you should check the child class documentation for further information. Also take note that as of Joomla 2.5, JTable properties are automatically generated based on the schema of the specified table, which means you don&#039;t need to declare Member variables in your class.&lt;br /&gt;
&lt;br /&gt;
Each physical database table created should have a corresponding class derived from JTable to represent it. JTable provides many methods to make common manipulations to the table much simpler. For example, one of the most common operations you will need to perform is to read a table row into memory given a value for the primary key. This can be done easily using the load method. The table row can then be just as easily updated using the save method, which also performs any predefined sanity checks on the table fields.&lt;br /&gt;
&lt;br /&gt;
== Writing an extension of JTable ==&lt;br /&gt;
To use JTable, you will create an extension of the JTable class. In this example, we have a database table &amp;quot;#__recipes&amp;quot; with an autoincrementing primary key &amp;quot;id&amp;quot; containing all of our recipes. We&#039;ll store this &lt;br /&gt;
&lt;br /&gt;
The only thing we need to do to start using JTables is create a constructor in our extended JTable class. The class constructor will call the parent constructor to get the table, all it needs is the name of the table, the name of the primary key column, and the database instance.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die();&lt;br /&gt;
&lt;br /&gt;
class TableRecipes extends JTable&lt;br /&gt;
{&lt;br /&gt;
	public function __construct($db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct( &#039;#__recipes&#039;, &#039;id&#039;, $db );&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you were using this class as a part of a backend component called &#039;Recipes&#039;, you would place this code in the file /administrator/components/com_recipes/tables/recipes.php.&lt;br /&gt;
&lt;br /&gt;
You can use this functionality in plugins just as components, i.e.. As a general rule you should avoid writing to the database from a module, and use plugins/components for this. Remember to use the built-in [[constants]] when linking to a custom path (outside the &#039;adminstrator/{com_nameofyourcomponent}/tables&#039; folder).&lt;br /&gt;
&lt;br /&gt;
== Using a JTable class extension ==&lt;br /&gt;
&lt;br /&gt;
Once the table class is in place we can use it in our model getTable() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
public function getTable($type = &#039;Recipes&#039;, $prefix = &#039;Table&#039;, $config = array())&lt;br /&gt;
{&lt;br /&gt;
	return JTable::getInstance($type, $prefix, $config);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use your JTable class in any Joomla! extension by using JTable::addIncludePath() in your extension&#039;s source code (use com_nameofyourcomponent in place of com_recipes):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JTable::addIncludePath(JPATH_ADMINISTRATOR . &#039;/components/com_recipes/tables&#039;);&lt;br /&gt;
$row = JTable::getInstance(&#039;recipes&#039;, &#039;Table&#039;, array());&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the lowercase version of the suffix of your class name is used as the first parameter, with the prefix &#039;Table&#039; as the second. Also, the getInstance() member function of JTable returns a JTableObject by reference instead of a value;.&lt;br /&gt;
 &lt;br /&gt;
=== Reserved Database Field Names ===&lt;br /&gt;
Some of the optional features of JTable require the existence of specially-named fields in the database table.  If you require this additional functionality you should ensure that these named fields are present in the table.  These field names should be considered reserved as any attempts to use them for purposes other than those supported by JTable may result in conflict.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field name&lt;br /&gt;
!Methods using the field name&lt;br /&gt;
|-&lt;br /&gt;
|checked_out&lt;br /&gt;
|[[JTable/checkOut|checkOut]], [[JTable/checkIn|checkIn]], [[JTable/isCheckedOut|isCheckedOut]]&lt;br /&gt;
|-&lt;br /&gt;
|checked_out_time&lt;br /&gt;
|[[JTable/checkOut|checkOut]], [[JTable/checkIn|checkIn]], [[JTable/isCheckedOut|isCheckedOut]]&lt;br /&gt;
|-&lt;br /&gt;
|hits&lt;br /&gt;
|[[JTable/hit|hit]]&lt;br /&gt;
|-&lt;br /&gt;
|ordering&lt;br /&gt;
|[[JTable/getNextOrder|getNextOrder]], [[JTable/reorder|reorder]], [[JTable/move|move]]&lt;br /&gt;
|-&lt;br /&gt;
|published&lt;br /&gt;
|[[JTable/publish|publish]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Check-in/check-out ====&lt;br /&gt;
Joomla tables implement a simple mechanism for preventing a [[wikipedia:race condition|race condition]] while editing rows in a database.  This depends on the existence of database fields called &amp;quot;checked_out&amp;quot; and &amp;quot;checked_out_time&amp;quot; and if these fields are present  in the view (JForm) &#039;&#039;&#039;JTable&#039;&#039;&#039; will automatically support this mechanism so that it can be easily used in your tables too.&lt;br /&gt;
&lt;br /&gt;
==== Hit counter ====&lt;br /&gt;
Some Joomla tables contain a field called &amp;quot;hits&amp;quot; which records the number of times that a table row has been accessed. JTable provides a simple method to increment this field: [https://api.joomla.org/cms-3/classes/JTable.html#method_hit hit].&lt;br /&gt;
&lt;br /&gt;
==== Example JForm fields for Reserved database names in JTable ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;state&amp;quot;&lt;br /&gt;
	type=&amp;quot;list&amp;quot;&lt;br /&gt;
	label=&amp;quot;JSTATUS&amp;quot;&lt;br /&gt;
	description=&amp;quot;JFIELD_PUBLISHED_DESC&amp;quot;&lt;br /&gt;
	size=&amp;quot;1&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;JPUBLISHED&amp;lt;/option&amp;gt;&lt;br /&gt;
	&amp;lt;option	value=&amp;quot;0&amp;quot;&amp;gt;JUNPUBLISHED&amp;lt;/option&amp;gt;&lt;br /&gt;
	&amp;lt;option	value=&amp;quot;2&amp;quot;&amp;gt;JARCHIVED&amp;lt;/option&amp;gt;&lt;br /&gt;
	&amp;lt;option	value=&amp;quot;-2&amp;quot;&amp;gt;JTRASHED&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;checked_out&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;checked_out_time&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;created_user_id&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_CREATED_BY_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;created_time&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_CREATED_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;modified_user_id&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_MODIFIED_BY_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;modified_time&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_MODIFIED_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;hits&amp;quot;&lt;br /&gt;
	type=&amp;quot;text&amp;quot;&lt;br /&gt;
	id=&amp;quot;hits&amp;quot;&lt;br /&gt;
	class=&amp;quot;readonly&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_HITS&amp;quot;&lt;br /&gt;
	size=&amp;quot;20&amp;quot;&lt;br /&gt;
	readonly=&amp;quot;true&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Useful Member Functions===&lt;br /&gt;
* [[JTable/load]]&lt;br /&gt;
* [[JTable/bind]]&lt;br /&gt;
* [[JTable/check]]&lt;br /&gt;
* [[JTable/store]]&lt;br /&gt;
* [[JTable/save]] Method to provide a shortcut to binding, checking and storing a JTable instance to the database table.&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
* [[J3.2:Developing an MVC Component/Using the database#admin.2Ftables.2Fhelloworld.php | Part 7 of J3.2:Developing an MVC Component/Using the database]]&lt;br /&gt;
*[[J2.5:Developing a MVC Component/Adding configuration#admin.2Ftables.2Fhelloworld.php | Part 14 of J2.5:Developing a MVC Component/Adding configuration]]&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
When properly extended, JTable gives you all of the basic functions you need for managing and retrieving records in a database table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Extension development]]&lt;br /&gt;
[[Category:JTable]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Using_the_JTable_class&amp;diff=205988</id>
		<title>Using the JTable class</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Using_the_JTable_class&amp;diff=205988"/>
		<updated>2015-07-16T13:36:32Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Add the acronym CRUD&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
This tutorial is for {{JVer|3.x}}&lt;br /&gt;
&lt;br /&gt;
== Introduction to JTable ==&lt;br /&gt;
The [https://api.joomla.org/cms-3/classes/JTable.html JTable] class is an implementation of the [http://en.wikipedia.org/wiki/Active_record_pattern Active Record] design pattern. It is used throughout Joomla! for [http://en.wikipedia.org/wiki/Create,_read,_update_and_delete creating, reading, updating, and deleting aka CRUD tasks] for records in the database table. &lt;br /&gt;
&lt;br /&gt;
Since JTable is an abstract class that forms the basis for all database table classes. Some of the methods listed will be overridden by the child class so you should check the child class documentation for further information. Also take note that as of Joomla 2.5, JTable properties are automatically generated based on the schema of the specified table, which means you don&#039;t need to declare Member variables in your class.&lt;br /&gt;
&lt;br /&gt;
Each physical database table created should have a corresponding class derived from JTable to represent it. JTable provides many methods to make common manipulations to the table much simpler. For example, one of the most common operations you will need to perform is to read a table row into memory given a value for the primary key. This can be done easily using the load method. The table row can then be just as easily updated using the save method, which also performs any predefined sanity checks on the table fields.&lt;br /&gt;
&lt;br /&gt;
== Writing an extension of JTable ==&lt;br /&gt;
To use JTable, you will create an extension of the JTable class. In this example, we have a database table &amp;quot;#__recipes&amp;quot; with an autoincrementing primary key &amp;quot;id&amp;quot; containing all of our recipes. We&#039;ll store this &lt;br /&gt;
&lt;br /&gt;
The only thing we need to do to start using JTables is create a constructor in our extended JTable class. The class constructor will call the parent constructor to get the table, all it needs is the name of the table, the name of the primary key column, and the database instance.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die();&lt;br /&gt;
&lt;br /&gt;
class TableRecipes extends JTable&lt;br /&gt;
{&lt;br /&gt;
	public function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct( &#039;#__recipes&#039;, &#039;id&#039;, $db );&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you were using this class as a part of a backend component called &#039;Recipes&#039;, you would place this code in the file /administrator/components/com_recipes/tables/recipes.php.&lt;br /&gt;
&lt;br /&gt;
You can use this functionality in plugins just as components, i.e.. As a general rule you should avoid writing to the database from a module, and use plugins/components for this. Remember to use the built-in [[constants]] when linking to a custom path (outside the &#039;adminstrator/{com_nameofyourcomponent}/tables&#039; folder).&lt;br /&gt;
&lt;br /&gt;
== Using a JTable class extension ==&lt;br /&gt;
&lt;br /&gt;
Once the table class is in place we can use it in our model getTable() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
public function getTable($type = &#039;Recipes&#039;, $prefix = &#039;Table&#039;, $config = array())&lt;br /&gt;
{&lt;br /&gt;
	return JTable::getInstance($type, $prefix, $config);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use your JTable class in any Joomla! extension by using JTable::addIncludePath() in your extension&#039;s source code (use com_nameofyourcomponent in place of com_recipes):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JTable::addIncludePath(JPATH_ADMINISTRATOR . &#039;/components/com_recipes/tables&#039;);&lt;br /&gt;
$row = JTable::getInstance(&#039;recipes&#039;, &#039;Table&#039;, array());&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the lowercase version of the suffix of your class name is used as the first parameter, with the prefix &#039;Table&#039; as the second. Also, the getInstance() member function of JTable returns a JTableObject by reference instead of a value;.&lt;br /&gt;
 &lt;br /&gt;
=== Reserved Database Field Names ===&lt;br /&gt;
Some of the optional features of JTable require the existence of specially-named fields in the database table.  If you require this additional functionality you should ensure that these named fields are present in the table.  These field names should be considered reserved as any attempts to use them for purposes other than those supported by JTable may result in conflict.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field name&lt;br /&gt;
!Methods using the field name&lt;br /&gt;
|-&lt;br /&gt;
|checked_out&lt;br /&gt;
|[[JTable/checkOut|checkOut]], [[JTable/checkIn|checkIn]], [[JTable/isCheckedOut|isCheckedOut]]&lt;br /&gt;
|-&lt;br /&gt;
|checked_out_time&lt;br /&gt;
|[[JTable/checkOut|checkOut]], [[JTable/checkIn|checkIn]], [[JTable/isCheckedOut|isCheckedOut]]&lt;br /&gt;
|-&lt;br /&gt;
|hits&lt;br /&gt;
|[[JTable/hit|hit]]&lt;br /&gt;
|-&lt;br /&gt;
|ordering&lt;br /&gt;
|[[JTable/getNextOrder|getNextOrder]], [[JTable/reorder|reorder]], [[JTable/move|move]]&lt;br /&gt;
|-&lt;br /&gt;
|published&lt;br /&gt;
|[[JTable/publish|publish]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Check-in/check-out ====&lt;br /&gt;
Joomla tables implement a simple mechanism for preventing a [[wikipedia:race condition|race condition]] while editing rows in a database.  This depends on the existence of database fields called &amp;quot;checked_out&amp;quot; and &amp;quot;checked_out_time&amp;quot; and if these fields are present  in the view (JForm) &#039;&#039;&#039;JTable&#039;&#039;&#039; will automatically support this mechanism so that it can be easily used in your tables too.&lt;br /&gt;
&lt;br /&gt;
==== Hit counter ====&lt;br /&gt;
Some Joomla tables contain a field called &amp;quot;hits&amp;quot; which records the number of times that a table row has been accessed. JTable provides a simple method to increment this field: [https://api.joomla.org/cms-3/classes/JTable.html#method_hit hit].&lt;br /&gt;
&lt;br /&gt;
==== Example JForm fields for Reserved database names in JTable ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;state&amp;quot;&lt;br /&gt;
	type=&amp;quot;list&amp;quot;&lt;br /&gt;
	label=&amp;quot;JSTATUS&amp;quot;&lt;br /&gt;
	description=&amp;quot;JFIELD_PUBLISHED_DESC&amp;quot;&lt;br /&gt;
	size=&amp;quot;1&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;JPUBLISHED&amp;lt;/option&amp;gt;&lt;br /&gt;
	&amp;lt;option	value=&amp;quot;0&amp;quot;&amp;gt;JUNPUBLISHED&amp;lt;/option&amp;gt;&lt;br /&gt;
	&amp;lt;option	value=&amp;quot;2&amp;quot;&amp;gt;JARCHIVED&amp;lt;/option&amp;gt;&lt;br /&gt;
	&amp;lt;option	value=&amp;quot;-2&amp;quot;&amp;gt;JTRASHED&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;checked_out&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;checked_out_time&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;created_user_id&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_CREATED_BY_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;created_time&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_CREATED_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;modified_user_id&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_MODIFIED_BY_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;modified_time&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_MODIFIED_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;hits&amp;quot;&lt;br /&gt;
	type=&amp;quot;text&amp;quot;&lt;br /&gt;
	id=&amp;quot;hits&amp;quot;&lt;br /&gt;
	class=&amp;quot;readonly&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_HITS&amp;quot;&lt;br /&gt;
	size=&amp;quot;20&amp;quot;&lt;br /&gt;
	readonly=&amp;quot;true&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Useful Member Functions===&lt;br /&gt;
* [[JTable/load]]&lt;br /&gt;
* [[JTable/bind]]&lt;br /&gt;
* [[JTable/check]]&lt;br /&gt;
* [[JTable/store]]&lt;br /&gt;
* [[JTable/save]] Method to provide a shortcut to binding, checking and storing a JTable instance to the database table.&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
* [[J3.2:Developing an MVC Component/Using the database#admin.2Ftables.2Fhelloworld.php | Part 7 of J3.2:Developing an MVC Component/Using the database]]&lt;br /&gt;
*[[J2.5:Developing a MVC Component/Adding configuration#admin.2Ftables.2Fhelloworld.php | Part 14 of J2.5:Developing a MVC Component/Adding configuration]]&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
When properly extended, JTable gives you all of the basic functions you need for managing and retrieving records in a database table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Extension development]]&lt;br /&gt;
[[Category:JTable]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Web_developers&amp;diff=205987</id>
		<title>Web developers</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Web_developers&amp;diff=205987"/>
		<updated>2015-07-16T13:30:30Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Add some more information which would be relevant to web developers&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;
{{Chunk:Web developer profile/&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==What is Joomla! and why should I be interested?== &amp;lt;!--T:2--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
Joomla! is the second most popular Content Management System in the world according to [http://cmscrawler.com/completelist CMS Crawler], and is freely available to download and install.  Released under the General Public License v2 and above - read more at [[S:MyLanguage/Extensions_and_GPL#About_Joomla.21_and_the_GPL|Extensions and GPL]], anybody can work with all parts of the Joomla! CMS, make changes, customize it to fit their needs, and use it for commercial projects&amp;lt;/translate&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
The world of website design is rapidly moving towards dynamically served content and away from static websites - Joomla! is well equipped to meet these needs and has the added bonus of a vibrant, enthusiastic community and a phenomenal amount of extensions, allowing you to extend the basic Joomla! installation in a multitude of ways - from creating social networks to eCommerce stores, corporate websites to intranets.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Once you understand the basics of how Joomla! works, it is quick and easy to learn how to extend it through writing custom components, adapting existing code, and creating your own templates.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==Where do I get started?== &amp;lt;!--T:6--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
Firstly, see if there are any Joomla! User Groups near you, or a JoomlaDay&amp;lt;sup&amp;gt;TM&amp;lt;/sup&amp;gt; event you could attend.  Having a community of people you can talk to or ask questions of is really helpful in the process of learning how to use any new system.  It often saves hours, if not days of fiddling or researching to just ask the question and have someone give you an answer (or advise where to find the answer).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://community.joomla.org/user-groups.html &amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
Find your nearest User Group&amp;lt;/translate&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
[http://events.joomla.org/joomladays &amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
Find your nearest JoomlaDay event&amp;lt;/translate&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
Next, create yourself an account on the Joomla! forums.  While the forums are user to user support, there are a LOT of users, and a lot of experienced users for that matter.  Make sure you take the time to read the posting guidelines at the top of the forums before you post, and include all the relevant information.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
While you&#039;re here, see if you might be able to help someone else.  Good practice is to answer one post for every post you make asking for help, as a minimum.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://forum.joomla.org/ &amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Visit the Joomla! forums&amp;lt;/translate&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
Next, create yourself an account here on the Joomla! Documentation Project.  Newcomers are a great help with documentation, as you often see things with a &#039;fresh pair of eyes&#039; and can identify mistakes or pick up errors easier.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
Just click on the link in the top right, and create your account.  If you find any documentation that needs updating or reviewing, simply log in, edit the appropriate item, and submit your revisions. Likewise if you can add any examples (especially to coding/API related documentation) you can do this too!&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==How do I style a Joomla! website to be like my graphics visuals?== &amp;lt;!--T:15--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==Getting started with content== &amp;lt;!--T:16--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{review}}&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
Content is simple to use and manage with Joomla!. This can be done if you are the administrator by using the content manager in the control panel.  There are different types of content that can be used.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
The &#039;article&#039; is one type of content.  This is usually a piece of text that can be displayed on a portion of the page.  It can also include pictures, another type of content, or other links to internal or external sites.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
You can also upload pictures and videos to use on your website.  As long as the content is there in the server side, it can be embedded or linked to be displayed on your page.  It can also work with articles to be placed along with text or just a stand-alone piece of content.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==Finding extensions to keep your client happy!== &amp;lt;!--T:20--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{review}}&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
There are many extensions for Joomla! that will help you to create a website that will fit your client&#039;s needs.  These can be found [http://extensions.joomla.org/ here].  An extension can be easy to find.  They are separated by category and contain small descriptions to let you know if they suite your needs.  They also have in-depth descriptions once clicked on and usually have tutorials on how they can be used.  There is also a rating system based on other users to give you a better idea of the quality of the extension.  This makes things user friendly and helps in making sure that the user gets what they are looking for.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==Search engine optimization with Joomla!== &amp;lt;!--T:22--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==Joomla! Security Guide== &amp;lt;!--T:23--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* [[S:MyLanguage/Category:Security_Checklist|Joomla! Security Checklist]]&lt;br /&gt;
* [[S:MyLanguage/Security and Performance FAQs|Security and Performance FAQs]]&lt;br /&gt;
* [http://vel.joomla.org/ Joomla!® Vulnerable Extensions List]&lt;br /&gt;
* [[S:MyLanguage/Top 10 Stupidest Administrator Tricks|Top 10 Stupidest Administrator Tricks]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;translate&amp;gt;&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Joomla! Security Forums&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [http://forum.joomla.org/viewforum.php?f=372 Joomla! Security Announcements]&lt;br /&gt;
* [http://forum.joomla.org/viewforum.php?f=432 Joomla! 1.5 Security Forum]&lt;br /&gt;
* [http://forum.joomla.org/viewforum.php?f=267 Joomla! 1.0 Security Forum]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==See also== &amp;lt;!--T:26--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
* [[S:MyLanguage/Developers|Developers]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
* [[S:MyLanguage/Secure_coding_guidelines|Secure Coding Guidelines]]&lt;br /&gt;
* [[S:MyLanguage/Securing_Joomla_extensions|Securing Joomla Extensions]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
[[Category:Joomla! user profiles]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Using_the_JTable_class&amp;diff=205986</id>
		<title>Using the JTable class</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Using_the_JTable_class&amp;diff=205986"/>
		<updated>2015-07-16T13:14:11Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: This article should be reviewed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
This tutorial is for {{JVer|3.x}}&lt;br /&gt;
&lt;br /&gt;
== Introduction to JTable ==&lt;br /&gt;
The [https://api.joomla.org/cms-3/classes/JTable.html JTable] class is an implementation of the [http://en.wikipedia.org/wiki/Active_record_pattern Active Record] design pattern. It is used throughout Joomla! for [http://en.wikipedia.org/wiki/Create,_read,_update_and_delete creating, reading, updating, and deleting] records in the database table. &lt;br /&gt;
&lt;br /&gt;
Since JTable is an abstract class that forms the basis for all database table classes. Some of the methods listed will be overridden by the child class so you should check the child class documentation for further information. Also take note that as of Joomla 2.5, JTable properties are automatically generated based on the schema of the specified table, which means you don&#039;t need to declare Member variables in your class.&lt;br /&gt;
&lt;br /&gt;
Each physical database table created should have a corresponding class derived from JTable to represent it. JTable provides many methods to make common manipulations to the table much simpler. For example, one of the most common operations you will need to perform is to read a table row into memory given a value for the primary key. This can be done easily using the load method. The table row can then be just as easily updated using the save method, which also performs any predefined sanity checks on the table fields.&lt;br /&gt;
&lt;br /&gt;
== Writing an extension of JTable ==&lt;br /&gt;
To use JTable, you will create an extension of the JTable class. In this example, we have a database table &amp;quot;#__recipes&amp;quot; with an autoincrementing primary key &amp;quot;id&amp;quot; containing all of our recipes. We&#039;ll store this &lt;br /&gt;
&lt;br /&gt;
The only thing we need to do to start using JTables is create a constructor in our extended JTable class. The class constructor will call the parent constructor to get the table, all it needs is the name of the table, the name of the primary key column, and the database instance.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die();&lt;br /&gt;
&lt;br /&gt;
class TableRecipes extends JTable&lt;br /&gt;
{&lt;br /&gt;
	public function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct( &#039;#__recipes&#039;, &#039;id&#039;, $db );&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you were using this class as a part of a backend component called &#039;Recipes&#039;, you would place this code in the file /administrator/components/com_recipes/tables/recipes.php.&lt;br /&gt;
&lt;br /&gt;
You can use this functionality in plugins just as components, i.e.. As a general rule you should avoid writing to the database from a module, and use plugins/components for this. Remember to use the built-in [[constants]] when linking to a custom path (outside the &#039;adminstrator/{com_nameofyourcomponent}/tables&#039; folder).&lt;br /&gt;
&lt;br /&gt;
== Using a JTable class extension ==&lt;br /&gt;
&lt;br /&gt;
Once the table class is in place we can use it in our model getTable() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
public function getTable($type = &#039;Recipes&#039;, $prefix = &#039;Table&#039;, $config = array())&lt;br /&gt;
{&lt;br /&gt;
	return JTable::getInstance($type, $prefix, $config);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use your JTable class in any Joomla! extension by using JTable::addIncludePath() in your extension&#039;s source code (use com_nameofyourcomponent in place of com_recipes):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JTable::addIncludePath(JPATH_ADMINISTRATOR . &#039;/components/com_recipes/tables&#039;);&lt;br /&gt;
$row = JTable::getInstance(&#039;recipes&#039;, &#039;Table&#039;, array());&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the lowercase version of the suffix of your class name is used as the first parameter, with the prefix &#039;Table&#039; as the second. Also, the getInstance() member function of JTable returns a JTableObject by reference instead of a value;.&lt;br /&gt;
 &lt;br /&gt;
=== Reserved Database Field Names ===&lt;br /&gt;
Some of the optional features of JTable require the existence of specially-named fields in the database table.  If you require this additional functionality you should ensure that these named fields are present in the table.  These field names should be considered reserved as any attempts to use them for purposes other than those supported by JTable may result in conflict.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field name&lt;br /&gt;
!Methods using the field name&lt;br /&gt;
|-&lt;br /&gt;
|checked_out&lt;br /&gt;
|[[JTable/checkOut|checkOut]], [[JTable/checkIn|checkIn]], [[JTable/isCheckedOut|isCheckedOut]]&lt;br /&gt;
|-&lt;br /&gt;
|checked_out_time&lt;br /&gt;
|[[JTable/checkOut|checkOut]], [[JTable/checkIn|checkIn]], [[JTable/isCheckedOut|isCheckedOut]]&lt;br /&gt;
|-&lt;br /&gt;
|hits&lt;br /&gt;
|[[JTable/hit|hit]]&lt;br /&gt;
|-&lt;br /&gt;
|ordering&lt;br /&gt;
|[[JTable/getNextOrder|getNextOrder]], [[JTable/reorder|reorder]], [[JTable/move|move]]&lt;br /&gt;
|-&lt;br /&gt;
|published&lt;br /&gt;
|[[JTable/publish|publish]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Check-in/check-out ====&lt;br /&gt;
Joomla tables implement a simple mechanism for preventing a [[wikipedia:race condition|race condition]] while editing rows in a database.  This depends on the existence of database fields called &amp;quot;checked_out&amp;quot; and &amp;quot;checked_out_time&amp;quot; and if these fields are present  in the view (JForm) &#039;&#039;&#039;JTable&#039;&#039;&#039; will automatically support this mechanism so that it can be easily used in your tables too.&lt;br /&gt;
&lt;br /&gt;
==== Hit counter ====&lt;br /&gt;
Some Joomla tables contain a field called &amp;quot;hits&amp;quot; which records the number of times that a table row has been accessed. JTable provides a simple method to increment this field: [https://api.joomla.org/cms-3/classes/JTable.html#method_hit hit].&lt;br /&gt;
&lt;br /&gt;
==== Example JForm fields for Reserved database names in JTable ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;state&amp;quot;&lt;br /&gt;
	type=&amp;quot;list&amp;quot;&lt;br /&gt;
	label=&amp;quot;JSTATUS&amp;quot;&lt;br /&gt;
	description=&amp;quot;JFIELD_PUBLISHED_DESC&amp;quot;&lt;br /&gt;
	size=&amp;quot;1&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;JPUBLISHED&amp;lt;/option&amp;gt;&lt;br /&gt;
	&amp;lt;option	value=&amp;quot;0&amp;quot;&amp;gt;JUNPUBLISHED&amp;lt;/option&amp;gt;&lt;br /&gt;
	&amp;lt;option	value=&amp;quot;2&amp;quot;&amp;gt;JARCHIVED&amp;lt;/option&amp;gt;&lt;br /&gt;
	&amp;lt;option	value=&amp;quot;-2&amp;quot;&amp;gt;JTRASHED&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;checked_out&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;checked_out_time&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;created_user_id&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_CREATED_BY_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;created_time&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_CREATED_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;modified_user_id&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_MODIFIED_BY_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;modified_time&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_MODIFIED_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;hits&amp;quot;&lt;br /&gt;
	type=&amp;quot;text&amp;quot;&lt;br /&gt;
	id=&amp;quot;hits&amp;quot;&lt;br /&gt;
	class=&amp;quot;readonly&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_HITS&amp;quot;&lt;br /&gt;
	size=&amp;quot;20&amp;quot;&lt;br /&gt;
	readonly=&amp;quot;true&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Useful Member Functions===&lt;br /&gt;
* [[JTable/load]]&lt;br /&gt;
* [[JTable/bind]]&lt;br /&gt;
* [[JTable/check]]&lt;br /&gt;
* [[JTable/store]]&lt;br /&gt;
* [[JTable/save]] Method to provide a shortcut to binding, checking and storing a JTable instance to the database table.&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
* [[J3.2:Developing an MVC Component/Using the database#admin.2Ftables.2Fhelloworld.php | Part 7 of J3.2:Developing an MVC Component/Using the database]]&lt;br /&gt;
*[[J2.5:Developing a MVC Component/Adding configuration#admin.2Ftables.2Fhelloworld.php | Part 14 of J2.5:Developing a MVC Component/Adding configuration]]&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
When properly extended, JTable gives you all of the basic functions you need for managing and retrieving records in a database table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Extension development]]&lt;br /&gt;
[[Category:JTable]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Using_the_JTable_class&amp;diff=205815</id>
		<title>Using the JTable class</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Using_the_JTable_class&amp;diff=205815"/>
		<updated>2015-07-14T19:03:37Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: fix 3.2 link following a -&amp;gt; an in MVC title change&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial is for {{JVer|3.x}}&lt;br /&gt;
&lt;br /&gt;
== Introduction to JTable ==&lt;br /&gt;
The [https://api.joomla.org/cms-3/classes/JTable.html JTable] class is an implementation of the [http://en.wikipedia.org/wiki/Active_record_pattern Active Record] design pattern. It is used throughout Joomla! for [http://en.wikipedia.org/wiki/Create,_read,_update_and_delete creating, reading, updating, and deleting] records in the database table. &lt;br /&gt;
&lt;br /&gt;
Since JTable is an abstract class that forms the basis for all database table classes. Some of the methods listed will be overridden by the child class so you should check the child class documentation for further information. Also take note that as of Joomla 2.5, JTable properties are automatically generated based on the schema of the specified table, which means you don&#039;t need to declare Member variables in your class.&lt;br /&gt;
&lt;br /&gt;
Each physical database table created should have a corresponding class derived from JTable to represent it. JTable provides many methods to make common manipulations to the table much simpler. For example, one of the most common operations you will need to perform is to read a table row into memory given a value for the primary key. This can be done easily using the load method. The table row can then be just as easily updated using the save method, which also performs any predefined sanity checks on the table fields.&lt;br /&gt;
&lt;br /&gt;
== Writing an extension of JTable ==&lt;br /&gt;
To use JTable, you will create an extension of the JTable class. In this example, we have a database table &amp;quot;#__recipes&amp;quot; with an autoincrementing primary key &amp;quot;id&amp;quot; containing all of our recipes. We&#039;ll store this &lt;br /&gt;
&lt;br /&gt;
The only thing we need to do to start using JTables is create a constructor in our extended JTable class. The class constructor will call the parent constructor to get the table, all it needs is the name of the table, the name of the primary key column, and the database instance.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die();&lt;br /&gt;
&lt;br /&gt;
class TableRecipes extends JTable&lt;br /&gt;
{&lt;br /&gt;
	public function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct( &#039;#__recipes&#039;, &#039;id&#039;, $db );&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you were using this class as a part of a backend component called &#039;Recipes&#039;, you would place this code in the file /administrator/components/com_recipes/tables/recipes.php.&lt;br /&gt;
&lt;br /&gt;
You can use this functionality in plugins just as components, i.e.. As a general rule you should avoid writing to the database from a module, and use plugins/components for this. Remember to use the built-in [[constants]] when linking to a custom path (outside the &#039;adminstrator/{com_nameofyourcomponent}/tables&#039; folder).&lt;br /&gt;
&lt;br /&gt;
== Using a JTable class extension ==&lt;br /&gt;
&lt;br /&gt;
Once the table class is in place we can use it in our model getTable() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
public function getTable($type = &#039;Recipes&#039;, $prefix = &#039;Table&#039;, $config = array())&lt;br /&gt;
{&lt;br /&gt;
	return JTable::getInstance($type, $prefix, $config);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use your JTable class in any Joomla! extension by using JTable::addIncludePath() in your extension&#039;s source code (use com_nameofyourcomponent in place of com_recipes):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JTable::addIncludePath(JPATH_ADMINISTRATOR . &#039;/components/com_recipes/tables&#039;);&lt;br /&gt;
$row = JTable::getInstance(&#039;recipes&#039;, &#039;Table&#039;, array());&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the lowercase version of the suffix of your class name is used as the first parameter, with the prefix &#039;Table&#039; as the second. Also, the getInstance() member function of JTable returns a JTableObject by reference instead of a value;.&lt;br /&gt;
 &lt;br /&gt;
=== Reserved Database Field Names ===&lt;br /&gt;
Some of the optional features of JTable require the existence of specially-named fields in the database table.  If you require this additional functionality you should ensure that these named fields are present in the table.  These field names should be considered reserved as any attempts to use them for purposes other than those supported by JTable may result in conflict.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field name&lt;br /&gt;
!Methods using the field name&lt;br /&gt;
|-&lt;br /&gt;
|checked_out&lt;br /&gt;
|[[JTable/checkOut|checkOut]], [[JTable/checkIn|checkIn]], [[JTable/isCheckedOut|isCheckedOut]]&lt;br /&gt;
|-&lt;br /&gt;
|checked_out_time&lt;br /&gt;
|[[JTable/checkOut|checkOut]], [[JTable/checkIn|checkIn]], [[JTable/isCheckedOut|isCheckedOut]]&lt;br /&gt;
|-&lt;br /&gt;
|hits&lt;br /&gt;
|[[JTable/hit|hit]]&lt;br /&gt;
|-&lt;br /&gt;
|ordering&lt;br /&gt;
|[[JTable/getNextOrder|getNextOrder]], [[JTable/reorder|reorder]], [[JTable/move|move]]&lt;br /&gt;
|-&lt;br /&gt;
|published&lt;br /&gt;
|[[JTable/publish|publish]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Check-in/check-out ====&lt;br /&gt;
Joomla tables implement a simple mechanism for preventing a [[wikipedia:race condition|race condition]] while editing rows in a database.  This depends on the existence of database fields called &amp;quot;checked_out&amp;quot; and &amp;quot;checked_out_time&amp;quot; and if these fields are present  in the view (JForm) &#039;&#039;&#039;JTable&#039;&#039;&#039; will automatically support this mechanism so that it can be easily used in your tables too.&lt;br /&gt;
&lt;br /&gt;
==== Hit counter ====&lt;br /&gt;
Some Joomla tables contain a field called &amp;quot;hits&amp;quot; which records the number of times that a table row has been accessed. JTable provides a simple method to increment this field: [https://api.joomla.org/cms-3/classes/JTable.html#method_hit hit].&lt;br /&gt;
&lt;br /&gt;
==== Example JForm fields for Reserved database names in JTable ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;state&amp;quot;&lt;br /&gt;
	type=&amp;quot;list&amp;quot;&lt;br /&gt;
	label=&amp;quot;JSTATUS&amp;quot;&lt;br /&gt;
	description=&amp;quot;JFIELD_PUBLISHED_DESC&amp;quot;&lt;br /&gt;
	size=&amp;quot;1&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;JPUBLISHED&amp;lt;/option&amp;gt;&lt;br /&gt;
	&amp;lt;option	value=&amp;quot;0&amp;quot;&amp;gt;JUNPUBLISHED&amp;lt;/option&amp;gt;&lt;br /&gt;
	&amp;lt;option	value=&amp;quot;2&amp;quot;&amp;gt;JARCHIVED&amp;lt;/option&amp;gt;&lt;br /&gt;
	&amp;lt;option	value=&amp;quot;-2&amp;quot;&amp;gt;JTRASHED&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;checked_out&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;checked_out_time&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;created_user_id&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_CREATED_BY_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;created_time&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_CREATED_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;modified_user_id&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_MODIFIED_BY_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;modified_time&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_MODIFIED_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;hits&amp;quot;&lt;br /&gt;
	type=&amp;quot;text&amp;quot;&lt;br /&gt;
	id=&amp;quot;hits&amp;quot;&lt;br /&gt;
	class=&amp;quot;readonly&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_HITS&amp;quot;&lt;br /&gt;
	size=&amp;quot;20&amp;quot;&lt;br /&gt;
	readonly=&amp;quot;true&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Useful Member Functions===&lt;br /&gt;
* [[JTable/load]]&lt;br /&gt;
* [[JTable/bind]]&lt;br /&gt;
* [[JTable/check]]&lt;br /&gt;
* [[JTable/store]]&lt;br /&gt;
* [[JTable/save]] Method to provide a shortcut to binding, checking and storing a JTable instance to the database table.&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
* [[J3.2:Developing an MVC Component/Using the database#admin.2Ftables.2Fhelloworld.php | Part 7 of J3.2:Developing an MVC Component/Using the database]]&lt;br /&gt;
*[[J2.5:Developing a MVC Component/Adding configuration#admin.2Ftables.2Fhelloworld.php | Part 14 of J2.5:Developing a MVC Component/Adding configuration]]&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
When properly extended, JTable gives you all of the basic functions you need for managing and retrieving records in a database table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Extension development]]&lt;br /&gt;
[[Category:JTable]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=API16:JTable/getKeyName&amp;diff=205713</id>
		<title>API16:JTable/getKeyName</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=API16:JTable/getKeyName&amp;diff=205713"/>
		<updated>2015-07-14T15:26:16Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: try fixing links by adding API16: prefix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Description===&lt;br /&gt;
Method to get the primary key field name for the table.&lt;br /&gt;
&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:JTable/getKeyName|Edit Descripton]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Description:API16:JTable/getKeyName}}&lt;br /&gt;
&lt;br /&gt;
===Syntax===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;getKeyName()&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
string The name of the primary key for the table. &lt;br /&gt;
&lt;br /&gt;
===Defined in===&lt;br /&gt;
libraries/joomla/database/table.php&lt;br /&gt;
===Importing===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;jimport( &#039;joomla.database.table&#039; );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Source Body===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
public function getKeyName()&lt;br /&gt;
{&lt;br /&gt;
        return $this-&amp;gt;_tbl_key;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&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:API16:JTable/getKeyName|Edit See Also]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
{{SeeAlso:API16:JTable/getKeyName}}&lt;br /&gt;
&lt;br /&gt;
===Examples===&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=getKeyName&lt;br /&gt;
 category=JTable&lt;br /&gt;
 category=CodeExample&lt;br /&gt;
 category=MethodExample&lt;br /&gt;
 include=*&lt;br /&gt;
 format= ,,,&lt;br /&gt;
&amp;lt;/dpl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Retrieving_request_data_using_JInput&amp;diff=205188</id>
		<title>Retrieving request data using JInput</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Retrieving_request_data_using_JInput&amp;diff=205188"/>
		<updated>2015-07-13T16:31:30Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Remove reference to the J 1.7.1 release, and change the paragraph to make sense with the current release.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version|2.5,3.1|platform=11.1,12.1}}&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
To be able to use JInput as described here, you must be using Joomla 2.5.0 or above.&lt;br /&gt;
&lt;br /&gt;
Please note there are known issues with JInput and Magic Quotes (Deprecated in PHP 5.3.0 and removed in PHP 5.4.0). Most servers have these turned off - however it is important to bear this in mind whilst developing a component. For this reason all core components in Joomla 2.5.x still use JRequest. As of Joomla 3.0+ magic quotes is required to be disabled and thus this is no longer an issue.&lt;br /&gt;
&lt;br /&gt;
==Using JInput==&lt;br /&gt;
To use JInput you must first create the object by using this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$jinput = JFactory::getApplication()-&amp;gt;input;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Getting Values===&lt;br /&gt;
To get a value from JInput, you can use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$foo = $jinput-&amp;gt;get(&#039;varname&#039;, &#039;default_value&#039;, &#039;filter&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The filter defaults to &amp;lt;code&amp;gt;cmd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Available filters are:&lt;br /&gt;
&lt;br /&gt;
*INT&lt;br /&gt;
*INTEGER&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Only use the first integer value&lt;br /&gt;
preg_match(&#039;/-?[0-9]+/&#039;, (string) $source, $matches);&lt;br /&gt;
$result = @ (int) $matches[0];&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*UINT&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Only use the first integer value&lt;br /&gt;
preg_match(&#039;/-?[0-9]+/&#039;, (string) $source, $matches);&lt;br /&gt;
$result = @ abs((int) $matches[0]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*FLOAT&lt;br /&gt;
*DOUBLE&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Only use the first floating point value&lt;br /&gt;
preg_match(&#039;/-?[0-9]+(\.[0-9]+)?/&#039;, (string) $source, $matches);&lt;br /&gt;
$result = @ (float) $matches[0];&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*BOOL&lt;br /&gt;
*BOOLEAN&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$result = (bool) $source;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*WORD&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Only allow characters a-z, and underscores&lt;br /&gt;
$result = (string) preg_replace(&#039;/[^A-Z_]/i&#039;, &#039;&#039;, $source);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*ALNUM&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Allow a-z and 0-9 only&lt;br /&gt;
$result = (string) preg_replace(&#039;/[^A-Z0-9]/i&#039;, &#039;&#039;, $source);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*CMD&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Allow a-z, 0-9, underscore, dot, dash. Also remove leading dots from result. &lt;br /&gt;
$result = (string) preg_replace(&#039;/[^A-Z0-9_\.-]/i&#039;, &#039;&#039;, $source);&lt;br /&gt;
$result = ltrim($result, &#039;.&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*BASE64&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Allow a-z, 0-9, slash, plus, equals.&lt;br /&gt;
$result = (string) preg_replace(&#039;/[^A-Z0-9\/+=]/i&#039;, &#039;&#039;, $source);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*STRING&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Converts the input to a plain text string; strips all tags / attributes.&lt;br /&gt;
$result = (string) $this-&amp;gt;_remove($this-&amp;gt;_decode((string) $source));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*HTML&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Converts the input to a string; strips all HTML tags / attributes.&lt;br /&gt;
$result = (string) $this-&amp;gt;_remove($this-&amp;gt;_decode((string) $source));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*ARRAY&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Attempts to convert the input to an array.&lt;br /&gt;
$result = (array) $source;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*PATH&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Converts the input into a string and validates it as a path. (e.g. path/to/file.png or path/to/dir)&lt;br /&gt;
// Note: Does NOT accept absolute paths, or paths ending in a trailing slash.&lt;br /&gt;
// For a visual representation of the pattern matching used, see http://www.regexper.com/#^[A-Za-z0-9_-]%2B[A-Za-z0-9_\.-]*%28[\\\\\%2F][A-Za-z0-9_-]%2B[A-Za-z0-9_\.-]*%29*%24&lt;br /&gt;
// Will return null if the input was invalid.&lt;br /&gt;
$pattern = &#039;/^[A-Za-z0-9_-]+[A-Za-z0-9_\.-]*([\\\\\/][A-Za-z0-9_-]+[A-Za-z0-9_\.-]*)*$/&#039;;&lt;br /&gt;
preg_match($pattern, (string) $source, $matches);&lt;br /&gt;
$result = @ (string) $matches[0];&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*RAW&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// The raw input. No sanitation provided.&lt;br /&gt;
$result = $source;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*USERNAME&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Strips all invalid username characters.&lt;br /&gt;
$result = (string) preg_replace(&#039;/[\x00-\x1F\x7F&amp;lt;&amp;gt;&amp;quot;\&#039;%&amp;amp;]/&#039;, &#039;&#039;, $source)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively instead of adding the filter you can use the JInput type specific methods:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Instead of:&lt;br /&gt;
$input-&amp;gt;get(&#039;name&#039;, &#039;&#039;, &#039;STR&#039;);&lt;br /&gt;
// you can use:&lt;br /&gt;
$input-&amp;gt;getString(&#039;name&#039;, &#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
// Instead of:&lt;br /&gt;
$input-&amp;gt;get(&#039;memberId&#039;, 0, &#039;INT&#039;);&lt;br /&gt;
// you can use:&lt;br /&gt;
$input-&amp;gt;getInt(&#039;memberId&#039;, 0);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Getting Multiple Values===&lt;br /&gt;
&lt;br /&gt;
To retrieve a number of values you can use the &amp;lt;code&amp;gt;getArray()&amp;lt;/code&amp;gt; method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$fooValues = $jinput-&amp;gt;getArray(array(&#039;var1&#039; =&amp;gt; &#039;&#039;, &#039;var2&#039; =&amp;gt; &#039;&#039;, &#039;var3&#039; =&amp;gt; &#039;&#039;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or, if you want to determine the data to get step by step:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$fooArray = array();&lt;br /&gt;
$fooArray[&#039;var1&#039;] = &#039;&#039;;&lt;br /&gt;
$fooArray[&#039;var2&#039;] = &#039;&#039;;&lt;br /&gt;
$fooArray[&#039;var3&#039;] = &#039;&#039;;&lt;br /&gt;
$fooValues = $jinput-&amp;gt;getArray($fooArray);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;$fooValues&amp;lt;/code&amp;gt; will be an array that consists of the same keys as used in &amp;lt;code&amp;gt;$fooArray&amp;lt;/code&amp;gt;, but with values attached.&lt;br /&gt;
&lt;br /&gt;
You can also specify different filters for each of the inputs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;gt;&lt;br /&gt;
$fooValues = $jinput-&amp;gt;getArray(array(&lt;br /&gt;
    &#039;var1&#039; =&amp;gt; &#039;int&#039;,&lt;br /&gt;
    &#039;var2&#039; =&amp;gt; &#039;float&#039;,&lt;br /&gt;
    &#039;var3&#039; =&amp;gt; &#039;word&#039;&lt;br /&gt;
));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also nest arrays to get more complicated hierarchies of values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$fooValues = $jinput-&amp;gt;getArray(array(&lt;br /&gt;
    &#039;jform&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;title&#039; =&amp;gt; &#039;string&#039;,&lt;br /&gt;
        &#039;quantity&#039; =&amp;gt; &#039;int&#039;,&lt;br /&gt;
        &#039;state&#039; =&amp;gt; &#039;int&#039;&lt;br /&gt;
    )&lt;br /&gt;
));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Getting Values from a Specific Super Global===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$foo = $jinput-&amp;gt;get-&amp;gt;get(&#039;varname&#039;, &#039;default_value&#039;, &#039;filter&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$foo = $jinput-&amp;gt;post-&amp;gt;get(&#039;varname&#039;, &#039;default_value&#039;, &#039;filter&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$foo = $jinput-&amp;gt;server-&amp;gt;get(&#039;varname&#039;, &#039;default_value&#039;, &#039;filter&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To retrieve an entire object, you can use:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$foo = $jinput-&amp;gt;get(&#039;varname&#039;, null, null);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting Values===&lt;br /&gt;
&lt;br /&gt;
To set a value via JInput, you can use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$jinput-&amp;gt;set(&#039;varname&#039;, $foo);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Retrieving File Data===&lt;br /&gt;
&lt;br /&gt;
The format that PHP returns file data in for arrays can at times be awkward, especially when dealing with arrays of files. JInputFiles provides a convenient interface for making life a little easier, grouping the data by file.&lt;br /&gt;
&lt;br /&gt;
Suppose you have a form like:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;form action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php?option=com_example&amp;amp;task=file.submit&#039;); ?&amp;gt;&amp;quot; enctype=&amp;quot;multipart/form-data&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;input type=&amp;quot;file&amp;quot; name=&amp;quot;jform1[test][]&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;input type=&amp;quot;file&amp;quot; name=&amp;quot;jform1[test][]&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Normally, PHP would put these in an array called &amp;lt;code&amp;gt;$_FILES&amp;lt;/code&amp;gt; that looked like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Array&lt;br /&gt;
(&lt;br /&gt;
    [jform1] =&amp;gt; Array&lt;br /&gt;
        (&lt;br /&gt;
            [name] =&amp;gt; Array&lt;br /&gt;
                (&lt;br /&gt;
                    [test] =&amp;gt; Array&lt;br /&gt;
                        (&lt;br /&gt;
                            [0] =&amp;gt; youtube_icon.png&lt;br /&gt;
                            [1] =&amp;gt; Younger_Son_2.jpg&lt;br /&gt;
                        )&lt;br /&gt;
&lt;br /&gt;
                )&lt;br /&gt;
&lt;br /&gt;
            [type] =&amp;gt; Array&lt;br /&gt;
                (&lt;br /&gt;
                    [test] =&amp;gt; Array&lt;br /&gt;
                        (&lt;br /&gt;
                            [0] =&amp;gt; image/png&lt;br /&gt;
                            [1] =&amp;gt; image/jpeg&lt;br /&gt;
                        )&lt;br /&gt;
&lt;br /&gt;
                )&lt;br /&gt;
&lt;br /&gt;
            [tmp_name] =&amp;gt; Array&lt;br /&gt;
                (&lt;br /&gt;
                    [test] =&amp;gt; Array&lt;br /&gt;
                        (&lt;br /&gt;
                            [0] =&amp;gt; /tmp/phpXoIpSD&lt;br /&gt;
                            [1] =&amp;gt; /tmp/phpWDE7ye&lt;br /&gt;
                        )&lt;br /&gt;
&lt;br /&gt;
                )&lt;br /&gt;
&lt;br /&gt;
            [error] =&amp;gt; Array&lt;br /&gt;
                (&lt;br /&gt;
                    [test] =&amp;gt; Array&lt;br /&gt;
                        (&lt;br /&gt;
                            [0] =&amp;gt; 0&lt;br /&gt;
                            [1] =&amp;gt; 0&lt;br /&gt;
                        )&lt;br /&gt;
&lt;br /&gt;
                )&lt;br /&gt;
&lt;br /&gt;
            [size] =&amp;gt; Array&lt;br /&gt;
                (&lt;br /&gt;
                    [test] =&amp;gt; Array&lt;br /&gt;
                        (&lt;br /&gt;
                            [0] =&amp;gt; 34409&lt;br /&gt;
                            [1] =&amp;gt; 99529&lt;br /&gt;
                        )&lt;br /&gt;
&lt;br /&gt;
                )&lt;br /&gt;
&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JInputFiles produces a result that is cleaner and easier to work with:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$files = $input-&amp;gt;files-&amp;gt;get(&#039;jform1&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$files&amp;lt;/code&amp;gt; then becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Array&lt;br /&gt;
(&lt;br /&gt;
    [test] =&amp;gt; Array&lt;br /&gt;
        (&lt;br /&gt;
            [0] =&amp;gt; Array&lt;br /&gt;
                (&lt;br /&gt;
                    [name] =&amp;gt; youtube_icon.png&lt;br /&gt;
                    [type] =&amp;gt; image/png&lt;br /&gt;
                    [tmp_name] =&amp;gt; /tmp/phpXoIpSD&lt;br /&gt;
                    [error] =&amp;gt; 0&lt;br /&gt;
                    [size] =&amp;gt; 34409&lt;br /&gt;
                )&lt;br /&gt;
&lt;br /&gt;
            [1] =&amp;gt; Array&lt;br /&gt;
                (&lt;br /&gt;
                    [name] =&amp;gt; Younger_Son_2.jpg&lt;br /&gt;
                    [type] =&amp;gt; image/jpeg&lt;br /&gt;
                    [tmp_name] =&amp;gt; /tmp/phpWDE7ye&lt;br /&gt;
                    [error] =&amp;gt; 0&lt;br /&gt;
                    [size] =&amp;gt; 99529&lt;br /&gt;
                )&lt;br /&gt;
&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this way, the data from each file element is consolidated into a single array and can be indexed in a more straightforward manner.&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
This is based on an email discussion: [https://groups.google.com/d/msg/joomla-dev-framework/LbALkK1ifMo/5waSiIlb21gJ Framework List 23 July 2011]&lt;br /&gt;
&lt;br /&gt;
The idea behind JInput is to abstract out the input source to allow code to be reused in different applications and in different contexts.  What I mean by this is that you could have a controller that grabs data from an input source.  Instead of always getting it from the request (i.e. get and post variables), you get it from JInput.  So say for instance you have a MVC triad in your component that is meant to get data from the browser as a client (a typical web application).  Now suppose you want to reuse that same code but interface with it using JSON.  Instead of rewriting your triad, you just extend JInput and have it grab it data from a parsed json object and perform any translation that you need to perform.&lt;br /&gt;
&lt;br /&gt;
The plan is to have JApplication instantiate JInput in its constructor.  Then in your code you get the input object from the application and get your input from there.  It will be a public property in Japplication so that it can be swapped out of that is appropriate.&lt;br /&gt;
&lt;br /&gt;
We get the added benefit that we get rid of the static JRequest which makes a whole bunch the code a whole lot easier to test because you can inject mock inputs directly instead of trying to fudge with hackish dependencies.&lt;br /&gt;
&lt;br /&gt;
The end result will be that your code will get the input object from the application (we will probably add something to JController at some point to make it more convenient to use there as well).&lt;br /&gt;
&lt;br /&gt;
Once you have your JInput object, you use it fairly in a fairly similar manner to how JRequest is used:&lt;br /&gt;
$input-&amp;gt;get(&#039;varname&#039;, &#039;default_value&#039;, &#039;filter&#039;);&lt;br /&gt;
&lt;br /&gt;
Where filter is a filter that is supported by JFilterInput.  JInput::clean proxies to JFilter.  We&#039;ll have to tweak JFilter a little bit so that it is more extensible.  It defaults to cmd so that developers have to be intentional about things if they want to have more lenient filtering.&lt;br /&gt;
&lt;br /&gt;
There is also a getArray method that allows you to specify an array of key and filter pairs so that you can get a whole array of filtered input.&lt;br /&gt;
&lt;br /&gt;
If you want to get data from a specific super global array, you can do $input-&amp;gt;get-&amp;gt;get(...) or $input-&amp;gt;post-&amp;gt;get(...).&lt;br /&gt;
&lt;br /&gt;
JApplication is deprecated, Use JApplicationCms instead unless specified otherwise.  JRequest is deprecated but will remain in the CMS through the 3.x series at a minimum. As such, it is easiest to still use JRequest with CMS applications. In the future get the JInput object from the application instead.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_ACL&amp;diff=202931</id>
		<title>J3.x:Developing an MVC Component/Adding ACL</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_ACL&amp;diff=202931"/>
		<updated>2015-07-09T18:47:33Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: getCmd() is deprecated use get() instead.&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;
{{review}}&lt;br /&gt;
{{:J3.1:Developing a MVC Component/&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;translate&amp;gt;== Introduction == &amp;lt;!--T:2--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
This tutorial is part of the [[S:MyLanguage/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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Adding Access Control == &amp;lt;!--T:4--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
With Joomla!&#039;s Access Control we can define which user groups are allowed or denied to do which actions in your component. In this example we use actions that are defined in the core. For the component as a whole: core.admin (access to the configuration) and core.manage (access to the backend). And at various levels actions like create, delete and edit. Besides those core actions you can define your own actions, but that is often not necessary and is not shown in this example. View/Read Access is not managed via those actions but with View Access Levels; see general documentation about Joomla!&#039;s ACL for that.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
In the #__assets table the actual list is stored: which user groups are allowed or denied to do which actions on which resources (assets). This is the implementation of the Access Control List (ACL).&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
In this article we will show how to add and use access permissions at several levels of granularity: for your component as a whole, for the categories and for the individual items.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
Note: in this HelloWorld example we are working in the backend, so the only access level available are &#039;&#039;administrator&#039;&#039; and &#039;&#039;superuser&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
To test this tutorial first create a new administrator user and then set its permissions (working as superuser).&lt;br /&gt;
After loggin in as administrator you will see the changes.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Minimal ACL requirements at the component level == &amp;lt;!--T:10--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
There are 2 actions that need to be defined at the component level for a Joomla! 2.5+ component to offer basic ACL support:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Configure&#039;&#039;&#039; (core.admin): which groups are allowed to configure the component level permissions via the &#039;Options&#039; toolbar button?&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Access Component&#039;&#039;&#039; (core.manage): which groups are allowed to access the component&#039;s backend?&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
This basic ACL support is done in 4 simple steps:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
* [[#Add_the_2_minimal_component_level_actions_to_access.xml|Add the 2 minimal component level actions to access.xml]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
* [[#Add_the_permissions_fieldset_to_config.xml|Add the permissions fieldset to config.xml]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
* [[#Add_the_.27Options.27_toolbar_button_when_user_is_authorised_for_it|Add the &#039;Options&#039; toolbar button]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
* [[#Restrict_the_access_to_the_component.27s_backend_to_authorised_usergroups|Restrict the access to the component&#039;s backend]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Add the 2 minimal component level actions to access.xml === &amp;lt;!--T:19--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
A minimal ACL &amp;lt;/tt&amp;gt;access.xml&amp;lt;/tt&amp;gt; would consist of only those 2 basic actions:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Basic admin/access.xml&amp;lt;/tt&amp;gt;&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;access component=&amp;quot;com_helloworld&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;section name=&amp;quot;component&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.admin&amp;quot; title=&amp;quot;JACTION_ADMIN&amp;quot; description=&amp;quot;JACTION_ADMIN_COMPONENT_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.manage&amp;quot; title=&amp;quot;JACTION_MANAGE&amp;quot; description=&amp;quot;JACTION_MANAGE_COMPONENT_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/access&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
See &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_categories#admin/access.xml|admin/access.xml]]&#039;&#039; for the current and more elaborate version.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Add the permissions fieldset to config.xml === &amp;lt;!--T:22--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
Add the following permissions fieldset to &amp;lt;tt&amp;gt;admin/config.xml&amp;lt;/tt&amp;gt; in order to be able to set our component level permissions.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset&lt;br /&gt;
		name=&amp;quot;permissions&amp;quot;&lt;br /&gt;
		label=&amp;quot;JCONFIG_PERMISSIONS_LABEL&amp;quot;&lt;br /&gt;
		description=&amp;quot;JCONFIG_PERMISSIONS_DESC&amp;quot;&lt;br /&gt;
	&amp;gt;&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
			name=&amp;quot;rules&amp;quot;&lt;br /&gt;
			type=&amp;quot;rules&amp;quot;&lt;br /&gt;
			label=&amp;quot;JCONFIG_PERMISSIONS_LABEL&amp;quot;&lt;br /&gt;
			class=&amp;quot;inputbox&amp;quot;&lt;br /&gt;
			validate=&amp;quot;rules&amp;quot;&lt;br /&gt;
			filter=&amp;quot;rules&amp;quot;&lt;br /&gt;
			component=&amp;quot;com_helloworld&amp;quot;&lt;br /&gt;
			section=&amp;quot;component&amp;quot;&lt;br /&gt;
		/&amp;gt;&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
See the [[#admin.2Fconfig.xml|more elaborate config.xml example]] further downwards for the exact place where to insert this code.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Add the &#039;Options&#039; toolbar button when user is authorised for it === &amp;lt;!--T:25--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
In the &amp;lt;tt&amp;gt;admin/views/helloworlds/view.html.php&amp;lt;/tt&amp;gt; file you can add the following code to check if the user can edit the preferences:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;2-3,5&amp;quot;&amp;gt;&lt;br /&gt;
    // Options button.&lt;br /&gt;
    if (JFactory::getUser()-&amp;gt;authorise(&#039;core.admin&#039;, &#039;com_helloworld&#039;)) &lt;br /&gt;
    {&lt;br /&gt;
	JToolBarHelper::preferences(&#039;com_helloworld&#039;);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
See further downwards for a [[#admin/views/helloworlds/view.html.php|more elaborated example of &#039;&#039;admin/views/helloworlds/view.html.php&#039;&#039;]] where this &#039;&#039;JToolBarHelper::preferences(&#039;com_helloworld&#039;)&#039;&#039; is done in an addToolBar()-method together with the other toolbar buttons and the &#039;&#039;JUser-&amp;gt;authorise()&#039;&#039;-check is done with JHelperContent, resulting in the $canDo-property.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Restrict the access to the component&#039;s backend to authorised usergroups === &amp;lt;!--T:28--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
To control the access to the backend of the component add the following lines to the &amp;lt;tt&amp;gt;admin/helloworld.php&amp;lt;/tt&amp;gt; entry-file:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Access check: is this user allowed to access the backend of this component?&lt;br /&gt;
if (!JFactory::getUser()-&amp;gt;authorise(&#039;core.manage&#039;, &#039;com_helloworld&#039;)) &lt;br /&gt;
{&lt;br /&gt;
	throw new Exception(JText::_(&#039;JERROR_ALERTNOAUTHOR&#039;));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
See further downwards for the [[#admin/helloworld.php|whole code of the &#039;&#039;admin/helloworld.php&#039;&#039; file]].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Adding more actions, also at category level and item level == &amp;lt;!--T:31--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
When adding more actions and more levels, the above described 4 steps are done too:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
* [[#Describing_the_actions_you_want_to_control_the_access_to|Add the actions to access.xml; here we can add more actions and levels]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* [[#Adding_the_setting_of_permissions_in_the_component.27s_Preferences|Add the permissions-fieldset to config.xml]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
* [[#Displaying_only_the_right_toolbar_buttons|Add the &#039;Options&#039; toolbar button]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
* [[#Restricting_access_to_the_component|Restrict the access to the component&#039;s backend&lt;br /&gt;
]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
In addition we also have to do the following steps:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
* [[#Add_the_asset_id_column_to_the_database_table|Add an asset_id to the item&#039;s database table for item level access control]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
* [[#Setting_the_permission_values_in_the_assets_table|Store the permissions in the assets table. Especially take care of setting the asset_id of the parent-asset]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
* [[#Showing_the_setting_of_permissions_on_the_item_level|Make the settings of the permissions at the item level editable]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
* [[#Adding_language_strings|Add some language strings]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Describing the actions you want to control the access to === &amp;lt;!--T:42--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
Each component (or part of it) has its own set of permissions that can be controlled. They are described in an &amp;lt;tt&amp;gt;access.xml&amp;lt;/tt&amp;gt; file located at the root of the &#039;&#039;admin&#039;&#039; folder. In this helloworld-example the actions to which access is controlled are divided in three sections: at the component level, the category level and the item level. An &#039;item&#039; is called a &#039;message&#039; in our example component, hence the name of the third section.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/access.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/access.xml&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;10-16&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;access component=&amp;quot;com_helloworld&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;section name=&amp;quot;component&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.admin&amp;quot; title=&amp;quot;JACTION_ADMIN&amp;quot; description=&amp;quot;JACTION_ADMIN_COMPONENT_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.manage&amp;quot; title=&amp;quot;JACTION_MANAGE&amp;quot; description=&amp;quot;JACTION_MANAGE_COMPONENT_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.create&amp;quot; title=&amp;quot;JACTION_CREATE&amp;quot; description=&amp;quot;JACTION_CREATE_COMPONENT_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.delete&amp;quot; title=&amp;quot;JACTION_DELETE&amp;quot; description=&amp;quot;JACTION_DELETE_COMPONENT_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.edit&amp;quot; title=&amp;quot;JACTION_EDIT&amp;quot; description=&amp;quot;JACTION_EDIT_COMPONENT_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/section&amp;gt;&lt;br /&gt;
	&amp;lt;section name=&amp;quot;category&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.create&amp;quot; title=&amp;quot;JACTION_CREATE&amp;quot; description=&amp;quot;COM_CATEGORIES_ACCESS_CREATE_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.delete&amp;quot; title=&amp;quot;JACTION_DELETE&amp;quot; description=&amp;quot;COM_CATEGORIES_ACCESS_DELETE_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.edit&amp;quot; title=&amp;quot;JACTION_EDIT&amp;quot; description=&amp;quot;COM_CATEGORIES_ACCESS_EDIT_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.edit.state&amp;quot; title=&amp;quot;JACTION_EDITSTATE&amp;quot; description=&amp;quot;COM_CATEGORIES_ACCESS_EDITSTATE_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.edit.own&amp;quot; title=&amp;quot;JACTION_EDITOWN&amp;quot; description=&amp;quot;COM_CATEGORIES_ACCESS_EDITOWN_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/section&amp;gt;&lt;br /&gt;
	&amp;lt;section name=&amp;quot;message&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.delete&amp;quot; title=&amp;quot;JACTION_DELETE&amp;quot; description=&amp;quot;COM_HELLOWORLD_ACCESS_DELETE_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.edit&amp;quot; title=&amp;quot;JACTION_EDIT&amp;quot; description=&amp;quot;COM_HELLOWORLD_ACCESS_EDIT_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/access&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Adding the setting of permissions in the component&#039;s Preferences === &amp;lt;!--T:44--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Since we now use Access Control permissions in our component, we need to be able to set them at the component level. That is done in the Preferences of this component: the screen you see after clicking the &#039;Options&#039; button. The config.xml-file is a form-definition for those Preferences. We could define the component level actions here too, as a child of the &amp;quot;rules&amp;quot; field-tag, but it is now preferred to also put those actions in &amp;lt;tt&amp;gt;access.xml&amp;lt;/tt&amp;gt; in that way all access rules for this component are on one spot.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/config.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/config.xml&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;19-34&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;config&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset&lt;br /&gt;
		name=&amp;quot;greetings&amp;quot;&lt;br /&gt;
		label=&amp;quot;COM_HELLOWORLD_CONFIG_GREETING_SETTINGS_LABEL&amp;quot;&lt;br /&gt;
		description=&amp;quot;COM_HELLOWORLD_CONFIG_GREETING_SETTINGS_DESC&amp;quot;&lt;br /&gt;
	&amp;gt;&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
			name=&amp;quot;show_category&amp;quot;&lt;br /&gt;
			type=&amp;quot;radio&amp;quot;&lt;br /&gt;
			label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_SHOW_CATEGORY_LABEL&amp;quot;&lt;br /&gt;
			description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_SHOW_CATEGORY_DESC&amp;quot;&lt;br /&gt;
			default=&amp;quot;0&amp;quot;&lt;br /&gt;
		&amp;gt;&lt;br /&gt;
			&amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JHIDE&amp;lt;/option&amp;gt;&lt;br /&gt;
			&amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JSHOW&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;fieldset&lt;br /&gt;
		name=&amp;quot;permissions&amp;quot;&lt;br /&gt;
		label=&amp;quot;JCONFIG_PERMISSIONS_LABEL&amp;quot;&lt;br /&gt;
		description=&amp;quot;JCONFIG_PERMISSIONS_DESC&amp;quot;&lt;br /&gt;
	&amp;gt;&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
			name=&amp;quot;rules&amp;quot;&lt;br /&gt;
			type=&amp;quot;rules&amp;quot;&lt;br /&gt;
			label=&amp;quot;JCONFIG_PERMISSIONS_LABEL&amp;quot;&lt;br /&gt;
			class=&amp;quot;inputbox&amp;quot;&lt;br /&gt;
			validate=&amp;quot;rules&amp;quot;&lt;br /&gt;
			filter=&amp;quot;rules&amp;quot;&lt;br /&gt;
			component=&amp;quot;com_helloworld&amp;quot;&lt;br /&gt;
			section=&amp;quot;component&amp;quot;&lt;br /&gt;
		/&amp;gt;&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/config&amp;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;translate&amp;gt;=== Displaying only the right toolbar buttons === &amp;lt;!--T:46--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
Which toolbar buttons to display depends on the Access Control permissions for the user. We put all permissions for this user in the $canDo property of the view; so we can eventually refer to it in layouts (in the edit-form for example).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
In the &amp;lt;tt&amp;gt;admin/views/helloworlds/view.html.php&amp;lt;/tt&amp;gt;, put this code:&amp;lt;/translate&amp;gt;&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;
&amp;lt;tt&amp;gt;admin/views/helloworlds/view.html.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;42-44,83-85,87-89,91-93,95-98,100&amp;quot; &amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&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;
/**&lt;br /&gt;
 * HelloWorlds View&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorlds extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Display the Hello World view&lt;br /&gt;
	 *&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  void&lt;br /&gt;
	 */&lt;br /&gt;
	function display($tpl = null)&lt;br /&gt;
	{&lt;br /&gt;
		&lt;br /&gt;
		// Get application&lt;br /&gt;
		$app = JFactory::getApplication();&lt;br /&gt;
		$context = &amp;quot;helloworld.list.admin.helloworld&amp;quot;;&lt;br /&gt;
		// Get data from the model&lt;br /&gt;
		$this-&amp;gt;items		= $this-&amp;gt;get(&#039;Items&#039;);&lt;br /&gt;
		$this-&amp;gt;pagination	= $this-&amp;gt;get(&#039;Pagination&#039;);&lt;br /&gt;
		$this-&amp;gt;state		= $this-&amp;gt;get(&#039;State&#039;);&lt;br /&gt;
		$this-&amp;gt;filter_order	= $app-&amp;gt;getUserStateFromRequest($context.&#039;filter_order&#039;, &#039;filter_order&#039;, &#039;greeting&#039;, &#039;cmd&#039;);&lt;br /&gt;
		$this-&amp;gt;filter_order_Dir = $app-&amp;gt;getUserStateFromRequest($context.&#039;filter_order_Dir&#039;, &#039;filter_order_Dir&#039;, &#039;asc&#039;, &#039;cmd&#039;);&lt;br /&gt;
		$this-&amp;gt;filterForm    	= $this-&amp;gt;get(&#039;FilterForm&#039;);&lt;br /&gt;
		$this-&amp;gt;activeFilters 	= $this-&amp;gt;get(&#039;ActiveFilters&#039;);&lt;br /&gt;
&lt;br /&gt;
		// What Access Permissions does this user have? What can (s)he do?&lt;br /&gt;
		$this-&amp;gt;canDo = JHelperContent::getActions();&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;
			throw new Exception(implode(&amp;quot;\n&amp;quot;, $errors), 500);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		// Set the submenu&lt;br /&gt;
		HelloWorldHelper::addSubmenu(&#039;helloworlds&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Set the toolbar and number of found items&lt;br /&gt;
		$this-&amp;gt;addToolBar();&lt;br /&gt;
&lt;br /&gt;
		// Display the template&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
&lt;br /&gt;
		// Set the document&lt;br /&gt;
		$this-&amp;gt;setDocument();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Add the page title and toolbar.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  void&lt;br /&gt;
	 *&lt;br /&gt;
	 * @since   1.6&lt;br /&gt;
	 */&lt;br /&gt;
	protected function addToolBar()&lt;br /&gt;
	{&lt;br /&gt;
		$title = JText::_(&#039;COM_HELLOWORLD_MANAGER_HELLOWORLDS&#039;);&lt;br /&gt;
&lt;br /&gt;
		if ($this-&amp;gt;pagination-&amp;gt;total)&lt;br /&gt;
		{&lt;br /&gt;
			$title .= &amp;quot;&amp;lt;span style=&#039;font-size: 0.5em; vertical-align: middle;&#039;&amp;gt;(&amp;quot; . $this-&amp;gt;pagination-&amp;gt;total . &amp;quot;)&amp;lt;/span&amp;gt;&amp;quot;;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		JToolBarHelper::title($title, &#039;helloworld&#039;);&lt;br /&gt;
&lt;br /&gt;
		if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.create&#039;)) &lt;br /&gt;
		{&lt;br /&gt;
			JToolBarHelper::addNew(&#039;helloworld.add&#039;, &#039;JTOOLBAR_NEW&#039;);&lt;br /&gt;
		}&lt;br /&gt;
		if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.edit&#039;)) &lt;br /&gt;
		{&lt;br /&gt;
			JToolBarHelper::editList(&#039;helloworld.edit&#039;, &#039;JTOOLBAR_EDIT&#039;);&lt;br /&gt;
		}&lt;br /&gt;
		if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.delete&#039;)) &lt;br /&gt;
		{&lt;br /&gt;
			JToolBarHelper::deleteList(&#039;&#039;, &#039;helloworlds.delete&#039;, &#039;JTOOLBAR_DELETE&#039;);&lt;br /&gt;
		}&lt;br /&gt;
		if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.admin&#039;)) &lt;br /&gt;
		{&lt;br /&gt;
			JToolBarHelper::divider();&lt;br /&gt;
			JToolBarHelper::preferences(&#039;com_helloworld&#039;);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to set up the document properties&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return void&lt;br /&gt;
	 */&lt;br /&gt;
	protected function setDocument() &lt;br /&gt;
	{&lt;br /&gt;
		$document = JFactory::getDocument();&lt;br /&gt;
		$document-&amp;gt;setTitle(JText::_(&#039;COM_HELLOWORLD_ADMINISTRATION&#039;));&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the &#039;&#039;admin/views/helloworld/view.html.php&#039;&#039;, put this code&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; highlight=&amp;quot;23,39-41,76-78,81-89,93-112&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&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;
/**&lt;br /&gt;
 * HelloWorld View&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorld extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	protected $form;&lt;br /&gt;
	protected $item;&lt;br /&gt;
	protected $script;&lt;br /&gt;
	protected $canDo;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Display the Hello World view&lt;br /&gt;
	 *&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  void&lt;br /&gt;
	 */&lt;br /&gt;
	public function display($tpl = null)&lt;br /&gt;
	{&lt;br /&gt;
		// Get the Data&lt;br /&gt;
		$this-&amp;gt;form = $this-&amp;gt;get(&#039;Form&#039;);&lt;br /&gt;
		$this-&amp;gt;item = $this-&amp;gt;get(&#039;Item&#039;);&lt;br /&gt;
		$this-&amp;gt;script = $this-&amp;gt;get(&#039;Script&#039;);&lt;br /&gt;
&lt;br /&gt;
		// What Access Permissions does this user have? What can (s)he do?&lt;br /&gt;
		$this-&amp;gt;canDo = JHelperContent::getActions($this-&amp;gt;item-&amp;gt;id);&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;
			throw new Exception(implode(&amp;quot;\n&amp;quot;, $errors), 500);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		// Set the toolbar&lt;br /&gt;
		$this-&amp;gt;addToolBar();&lt;br /&gt;
&lt;br /&gt;
		// Display the template&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
&lt;br /&gt;
		// Set the document&lt;br /&gt;
		$this-&amp;gt;setDocument();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Add the page title and toolbar.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  void&lt;br /&gt;
	 *&lt;br /&gt;
	 * @since   1.6&lt;br /&gt;
	 */&lt;br /&gt;
	protected function addToolBar()&lt;br /&gt;
	{&lt;br /&gt;
		$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
&lt;br /&gt;
		// Hide Joomla Administrator Main menu&lt;br /&gt;
		$input-&amp;gt;set(&#039;hidemainmenu&#039;, true);&lt;br /&gt;
&lt;br /&gt;
		$isNew = ($this-&amp;gt;item-&amp;gt;id == 0);&lt;br /&gt;
&lt;br /&gt;
		JToolBarHelper::title($isNew ? JText::_(&#039;COM_HELLOWORLD_MANAGER_HELLOWORLD_NEW&#039;)&lt;br /&gt;
		                             : JText::_(&#039;COM_HELLOWORLD_MANAGER_HELLOWORLD_EDIT&#039;), &#039;helloworld&#039;);&lt;br /&gt;
		// Build the actions for new and existing records.&lt;br /&gt;
		if ($isNew)&lt;br /&gt;
		{&lt;br /&gt;
			// For new records, check the create permission.&lt;br /&gt;
			if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.create&#039;)) &lt;br /&gt;
			{&lt;br /&gt;
				JToolBarHelper::apply(&#039;helloworld.apply&#039;, &#039;JTOOLBAR_APPLY&#039;);&lt;br /&gt;
				JToolBarHelper::save(&#039;helloworld.save&#039;, &#039;JTOOLBAR_SAVE&#039;);&lt;br /&gt;
				JToolBarHelper::custom(&#039;helloworld.save2new&#039;, &#039;save-new.png&#039;, &#039;save-new_f2.png&#039;,&lt;br /&gt;
				                       &#039;JTOOLBAR_SAVE_AND_NEW&#039;, false);&lt;br /&gt;
			}&lt;br /&gt;
			JToolBarHelper::cancel(&#039;helloworld.cancel&#039;, &#039;JTOOLBAR_CANCEL&#039;);&lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.edit&#039;))&lt;br /&gt;
			{&lt;br /&gt;
				// We can save the new record&lt;br /&gt;
				JToolBarHelper::apply(&#039;helloworld.apply&#039;, &#039;JTOOLBAR_APPLY&#039;);&lt;br /&gt;
				JToolBarHelper::save(&#039;helloworld.save&#039;, &#039;JTOOLBAR_SAVE&#039;);&lt;br /&gt;
 &lt;br /&gt;
				// We can save this record, but check the create permission to see&lt;br /&gt;
				// if we can return to make a new one.&lt;br /&gt;
				if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.create&#039;)) &lt;br /&gt;
				{&lt;br /&gt;
					JToolBarHelper::custom(&#039;helloworld.save2new&#039;, &#039;save-new.png&#039;, &#039;save-new_f2.png&#039;,&lt;br /&gt;
					                       &#039;JTOOLBAR_SAVE_AND_NEW&#039;, false);&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.create&#039;)) &lt;br /&gt;
			{&lt;br /&gt;
				JToolBarHelper::custom(&#039;helloworld.save2copy&#039;, &#039;save-copy.png&#039;, &#039;save-copy_f2.png&#039;,&lt;br /&gt;
				                       &#039;JTOOLBAR_SAVE_AS_COPY&#039;, false);&lt;br /&gt;
			}&lt;br /&gt;
			JToolBarHelper::cancel(&#039;helloworld.cancel&#039;, &#039;JTOOLBAR_CLOSE&#039;);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to set up the document properties&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return void&lt;br /&gt;
	 */&lt;br /&gt;
	protected function setDocument() &lt;br /&gt;
	{&lt;br /&gt;
		$isNew = ($this-&amp;gt;item-&amp;gt;id == 0);&lt;br /&gt;
		$document = JFactory::getDocument();&lt;br /&gt;
		$document-&amp;gt;setTitle($isNew ? JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_CREATING&#039;)&lt;br /&gt;
		                           : JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_EDITING&#039;));&lt;br /&gt;
		$document-&amp;gt;addScript(JURI::root() . $this-&amp;gt;script);&lt;br /&gt;
		$document-&amp;gt;addScript(JURI::root() . &amp;quot;/administrator/components/com_helloworld&amp;quot;&lt;br /&gt;
		                                  . &amp;quot;/views/helloworld/submitbutton.js&amp;quot;);&lt;br /&gt;
		JText::script(&#039;COM_HELLOWORLD_HELLOWORLD_ERROR_UNACCEPTABLE&#039;);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
These two files use the &#039;&#039;getActions&#039;&#039; method defined in the &amp;lt;tt&amp;gt;admin/helpers/helloworld.php&amp;lt;/tt&amp;gt; file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
In the helper-file, put this code:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/helpers/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/helpers/helloworld.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;50-72&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&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;
/**&lt;br /&gt;
 * HelloWorld component helper.&lt;br /&gt;
 *&lt;br /&gt;
 * @param   string  $submenu  The name of the active view.&lt;br /&gt;
 *&lt;br /&gt;
 * @return  void&lt;br /&gt;
 *&lt;br /&gt;
 * @since   1.6&lt;br /&gt;
 */&lt;br /&gt;
abstract class HelloWorldHelper&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Configure the Linkbar.&lt;br /&gt;
	 */&lt;br /&gt;
	public static function addSubmenu($submenu) &lt;br /&gt;
	{&lt;br /&gt;
		JSubMenuHelper::addEntry(&lt;br /&gt;
			JText::_(&#039;COM_HELLOWORLD_SUBMENU_MESSAGES&#039;),&lt;br /&gt;
			&#039;index.php?option=com_helloworld&#039;,&lt;br /&gt;
			$submenu == &#039;messages&#039;&lt;br /&gt;
		);&lt;br /&gt;
&lt;br /&gt;
		JSubMenuHelper::addEntry(&lt;br /&gt;
			JText::_(&#039;COM_HELLOWORLD_SUBMENU_CATEGORIES&#039;),&lt;br /&gt;
			&#039;index.php?option=com_categories&amp;amp;view=categories&amp;amp;extension=com_helloworld&#039;,&lt;br /&gt;
			$submenu == &#039;categories&#039;&lt;br /&gt;
		);&lt;br /&gt;
&lt;br /&gt;
		// set some global property&lt;br /&gt;
		$document = JFactory::getDocument();&lt;br /&gt;
		$document-&amp;gt;addStyleDeclaration(&#039;.icon-48-helloworld &#039; .&lt;br /&gt;
		                               &#039;{background-image: url(../media/com_helloworld/images/tux-48x48.png);}&#039;);&lt;br /&gt;
		if ($submenu == &#039;categories&#039;) &lt;br /&gt;
		{&lt;br /&gt;
			$document-&amp;gt;setTitle(JText::_(&#039;COM_HELLOWORLD_ADMINISTRATION_CATEGORIES&#039;));&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the actions&lt;br /&gt;
	 */&lt;br /&gt;
	public static function getActions($messageId = 0)&lt;br /&gt;
	{	&lt;br /&gt;
		$result	= new JObject;&lt;br /&gt;
&lt;br /&gt;
		if (empty($messageId)) {&lt;br /&gt;
			$assetName = &#039;com_helloworld&#039;;&lt;br /&gt;
		}&lt;br /&gt;
		else {&lt;br /&gt;
			$assetName = &#039;com_helloworld.message.&#039;.(int) $messageId;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$actions = JAccess::getActions(&#039;com_helloworld&#039;, &#039;component&#039;);&lt;br /&gt;
&lt;br /&gt;
		foreach ($actions as $action) {&lt;br /&gt;
			$result-&amp;gt;set($action-&amp;gt;name, JFactory::getUser()-&amp;gt;authorise($action-&amp;gt;name, $assetName));&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $result;&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;
&amp;lt;translate&amp;gt;=== Restricting access to the component === &amp;lt;!--T:51--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
The main idea in ACL is to restrict actions to groups of users. The first action to be restricted is access to the administrative backend of the component itself. With your favorite file editor, edit the &amp;lt;tt&amp;gt;admin/helloworld.php&amp;lt;/tt&amp;gt; file and add the lines with the access check.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/helloworld.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;17-22&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// Set some global property&lt;br /&gt;
$document = JFactory::getDocument();&lt;br /&gt;
$document-&amp;gt;addStyleDeclaration(&#039;.icon-helloworld {background-image: url(../media/com_helloworld/images/tux-16x16.png);}&#039;);&lt;br /&gt;
&lt;br /&gt;
// Access check: is this user allowed to access the backend of this component?&lt;br /&gt;
if (!JFactory::getUser()-&amp;gt;authorise(&#039;core.manage&#039;, &#039;com_helloworld&#039;))&lt;br /&gt;
{&lt;br /&gt;
	throw new Exception(JText::_(&#039;JERROR_ALERTNOAUTHOR&#039;));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Require helper file&lt;br /&gt;
JLoader::register(&#039;HelloWorldHelper&#039;, JPATH_COMPONENT . &#039;/helpers/helloworld.php&#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;
$controller-&amp;gt;execute(JFactory::getApplication()-&amp;gt;input-&amp;gt;get(&#039;task&#039;));;&lt;br /&gt;
&lt;br /&gt;
// Redirect if set by the controller&lt;br /&gt;
$controller-&amp;gt;redirect();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Add the asset_id column to the database table === &amp;lt;!--T:53--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
In order to be able to work with JTable an asset_id column has to be added to the database #__helloworld table.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
So, &amp;lt;tt&amp;gt;admin/sql/install.mysql.utf8.sql&amp;lt;/tt&amp;gt; becomes:&amp;lt;/translate&amp;gt;&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;
&amp;lt;tt&amp;gt;admin/sql/install.mysql.utf8.sql&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;mysql&amp;quot; highlight=&amp;quot;5&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;
	`asset_id` INT(10)     NOT NULL DEFAULT &#039;0&#039;,&lt;br /&gt;
	`greeting` VARCHAR(25) NOT NULL,&lt;br /&gt;
	`published` tinyint(4) NOT NULL,&lt;br /&gt;
	`catid`	    int(11)    NOT NULL DEFAULT &#039;0&#039;,&lt;br /&gt;
	`params`   VARCHAR(1024) NOT NULL DEFAULT &#039;&#039;,&lt;br /&gt;
	PRIMARY KEY (`id`)&lt;br /&gt;
)&lt;br /&gt;
	ENGINE =MyISAM&lt;br /&gt;
	AUTO_INCREMENT =0&lt;br /&gt;
	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;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
For updates we add a sql-update-file:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/updates/mysql/0.0.14.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/sql/updates/mysql/0.0.14.sql&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;mysql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER TABLE`#__helloworld` ADD COLUMN `asset_id` INT(10) UNSIGNED NOT NULL DEFAULT &#039;0&#039; AFTER `id`;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Restricting access to the messages === &amp;lt;!--T:57--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
So far we have restricted access to the component itself, but we also need to do that at &#039;&#039;message&#039;&#039; level.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
To check the &#039;&#039;&#039;&amp;quot;core.delete&amp;quot;&#039;&#039;&#039; permission you need to modify the model class: &amp;lt;tt&amp;gt;admin/models/helloworld.php&amp;lt;/tt&amp;gt; by adding these lines:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/models/helloworld.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;php&#039; highlight=&amp;quot;96-105&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&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;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelAdmin&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a table object, load it if necessary.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   string  $type    The table name. Optional.&lt;br /&gt;
	 * @param   string  $prefix  The class prefix. Optional.&lt;br /&gt;
	 * @param   array   $config  Configuration array for model. Optional.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  JTable  A JTable object&lt;br /&gt;
	 *&lt;br /&gt;
	 * @since   1.6&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;
	/**&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;
	 *&lt;br /&gt;
	 * @return  mixed    A JForm object on success, false on failure&lt;br /&gt;
	 *&lt;br /&gt;
	 * @since   1.6&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(&lt;br /&gt;
			&#039;com_helloworld.helloworld&#039;,&lt;br /&gt;
			&#039;helloworld&#039;,&lt;br /&gt;
			array(&lt;br /&gt;
				&#039;control&#039; =&amp;gt; &#039;jform&#039;,&lt;br /&gt;
				&#039;load_data&#039; =&amp;gt; $loadData&lt;br /&gt;
			)&lt;br /&gt;
		);&lt;br /&gt;
&lt;br /&gt;
		if (empty($form))&lt;br /&gt;
		{&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $form;&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get the script that have to be included on the form&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return string	Script files&lt;br /&gt;
	 */&lt;br /&gt;
	public function getScript() &lt;br /&gt;
	{&lt;br /&gt;
		return &#039;administrator/components/com_helloworld/models/forms/helloworld.js&#039;;&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;
	 *&lt;br /&gt;
	 * @since   1.6&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(&lt;br /&gt;
			&#039;com_helloworld.edit.helloworld.data&#039;,&lt;br /&gt;
			array()&lt;br /&gt;
		);&lt;br /&gt;
&lt;br /&gt;
		if (empty($data))&lt;br /&gt;
		{&lt;br /&gt;
			$data = $this-&amp;gt;getItem();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $data;&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to check if it&#039;s OK to delete a message. Overwrites JModelAdmin::canDelete&lt;br /&gt;
	 */&lt;br /&gt;
	protected function canDelete($record)&lt;br /&gt;
	{&lt;br /&gt;
		if( !empty( $record-&amp;gt;id ) )&lt;br /&gt;
		{&lt;br /&gt;
			return JFactory::getUser()-&amp;gt;authorise( &amp;quot;core.delete&amp;quot;, &amp;quot;com_helloworld.message.&amp;quot; . $record-&amp;gt;id );&lt;br /&gt;
		}&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
To check &#039;&#039;&#039;&amp;quot;core.edit&amp;quot;&#039;&#039;&#039; (and &#039;&#039;&#039;core.add&#039;&#039;&#039; if you wish) you need to update the sub-controller (&#039;&#039;not&#039;&#039; the model). I am not sure why this is so, but that&#039;s how other standard Joomla components do it. You need to add the following lines in the file: &amp;lt;tt&amp;gt;admin/controllers/helloworld.php&amp;lt;/tt&amp;gt;&amp;lt;/translate&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;
&amp;lt;tt&amp;gt;admin/controllers/helloworld.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;  highlight=&amp;quot;21-49&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&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;
/**&lt;br /&gt;
 * HelloWorld Controller&lt;br /&gt;
 *&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 * @since       0.0.9&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldControllerHelloWorld extends JControllerForm&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	* Implement to allowAdd or not&lt;br /&gt;
	*&lt;br /&gt;
	* Not used at this time (but you can look at how other components use it....)&lt;br /&gt;
	* Overwrites: JControllerForm::allowAdd&lt;br /&gt;
	*&lt;br /&gt;
	* @param array $data&lt;br /&gt;
	* @return bool&lt;br /&gt;
	*/&lt;br /&gt;
	protected function allowAdd($data = array())&lt;br /&gt;
	{&lt;br /&gt;
		return parent::allowAdd($data);&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	* Implement to allow edit or not&lt;br /&gt;
	* Overwrites: JControllerForm::allowEdit&lt;br /&gt;
	*&lt;br /&gt;
	* @param array $data&lt;br /&gt;
	* @param string $key&lt;br /&gt;
	* @return bool&lt;br /&gt;
	*/&lt;br /&gt;
	protected function allowEdit($data = array(), $key = &#039;id&#039;)&lt;br /&gt;
	{&lt;br /&gt;
		$id = isset( $data[ $key ] ) ? $data[ $key ] : 0;&lt;br /&gt;
		if( !empty( $id ) )&lt;br /&gt;
		{&lt;br /&gt;
			return JFactory::getUser()-&amp;gt;authorise( &amp;quot;core.edit&amp;quot;, &amp;quot;com_helloworld.message.&amp;quot; . $id );&lt;br /&gt;
		}&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
Please note that &#039;&#039;allowAdd&#039;&#039; simply calls its parent. I&#039;ve put it here in case you want to actually use it in your component. If you look at your &amp;lt;tt&amp;gt;admin/access.xml&amp;lt;/tt&amp;gt; file, you will notice there is no &#039;&#039;core.add&#039;&#039; action defined for &amp;quot;messages&amp;quot;, so you will need to add it there as well if you want to be able to configure it in the interface.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Setting the permission values in the assets table === &amp;lt;!--T:62--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
In order to store permissions for each message in the assets database table, we have to instruct the table class associated with the model to save those permissions in the assets table.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
JTable not only provides an interface for storing the data of the record itself in the item&#039;s database table, but also for storing the permissions for that record in the assets database table. Therefore we must add information to the bind()-method about the permission-values. We also  have to provide the asset name, asset title and the id of the asset parent via the helloworld JTable. Therefore we override 3 methods:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
* _getAssetName(): a unique name for this asset, by which it can be retrieved&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* _getAssetTitle(): a more human-friendly way to identify the asset (not necessary unique)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
* _getAssetParentId(): the asset_id of the parent in the asset database table (from whom permissions are inherited)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/tables/helloworld.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;45-52,80-133&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&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   JDatabaseDriver  &amp;amp;$db  A 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;
	 * Overloaded bind function&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param       array           named array&lt;br /&gt;
	 * @return      null|string     null is operation was satisfactory, otherwise returns an error&lt;br /&gt;
	 * @see JTable:bind&lt;br /&gt;
	 * @since 1.5&lt;br /&gt;
	 */&lt;br /&gt;
	public function bind($array, $ignore = &#039;&#039;)&lt;br /&gt;
	{&lt;br /&gt;
		if (isset($array[&#039;params&#039;]) &amp;amp;&amp;amp; is_array($array[&#039;params&#039;]))&lt;br /&gt;
		{&lt;br /&gt;
			// Convert the params field to a string.&lt;br /&gt;
			$parameter = new JRegistry;&lt;br /&gt;
			$parameter-&amp;gt;loadArray($array[&#039;params&#039;]);&lt;br /&gt;
			$array[&#039;params&#039;] = (string)$parameter;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		// Bind the rules.&lt;br /&gt;
		if (isset($array[&#039;rules&#039;]) &amp;amp;&amp;amp; is_array($array[&#039;rules&#039;]))&lt;br /&gt;
		{&lt;br /&gt;
			$rules = new JAccessRules($array[&#039;rules&#039;]);&lt;br /&gt;
			$this-&amp;gt;setRules($rules);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return parent::bind($array, $ignore);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Overloaded load function&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param       int $pk primary key&lt;br /&gt;
	 * @param       boolean $reset reset data&lt;br /&gt;
	 * @return      boolean&lt;br /&gt;
	 * @see JTable:load&lt;br /&gt;
	 */&lt;br /&gt;
	public function load($pk = null, $reset = true)&lt;br /&gt;
	{&lt;br /&gt;
		if (parent::load($pk, $reset))&lt;br /&gt;
		{&lt;br /&gt;
			// Convert the params field to a registry.&lt;br /&gt;
			$params = new JRegistry;&lt;br /&gt;
			$params-&amp;gt;loadString($this-&amp;gt;params, &#039;JSON&#039;);&lt;br /&gt;
&lt;br /&gt;
			$this-&amp;gt;params = $params;&lt;br /&gt;
			return true;&lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to compute the default name of the asset.&lt;br /&gt;
	 * The default name is in the form `table_name.id`&lt;br /&gt;
	 * where id is the value of the primary key of the table.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return	string&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	protected function _getAssetName()&lt;br /&gt;
	{&lt;br /&gt;
		$k = $this-&amp;gt;_tbl_key;&lt;br /&gt;
		return &#039;com_helloworld.message.&#039;.(int) $this-&amp;gt;$k;&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to return the title to use for the asset table.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return	string&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	protected function _getAssetTitle()&lt;br /&gt;
	{&lt;br /&gt;
		return $this-&amp;gt;greeting;&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get the asset-parent-id of the item&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return	int&lt;br /&gt;
	 */&lt;br /&gt;
	protected function _getAssetParentId(JTable $table = NULL, $id = NULL)&lt;br /&gt;
	{&lt;br /&gt;
		// We will retrieve the parent-asset from the Asset-table&lt;br /&gt;
		$assetParent = JTable::getInstance(&#039;Asset&#039;);&lt;br /&gt;
		// Default: if no asset-parent can be found we take the global asset&lt;br /&gt;
		$assetParentId = $assetParent-&amp;gt;getRootId();&lt;br /&gt;
&lt;br /&gt;
		// Find the parent-asset&lt;br /&gt;
		if (($this-&amp;gt;catid)&amp;amp;&amp;amp; !empty($this-&amp;gt;catid))&lt;br /&gt;
		{&lt;br /&gt;
			// The item has a category as asset-parent&lt;br /&gt;
			$assetParent-&amp;gt;loadByName(&#039;com_helloworld.category.&#039; . (int) $this-&amp;gt;catid);&lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			// The item has the component as asset-parent&lt;br /&gt;
			$assetParent-&amp;gt;loadByName(&#039;com_helloworld&#039;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		// Return the found asset-parent-id&lt;br /&gt;
		if ($assetParent-&amp;gt;id)&lt;br /&gt;
		{&lt;br /&gt;
			$assetParentId=$assetParent-&amp;gt;id;&lt;br /&gt;
		}&lt;br /&gt;
		return $assetParentId;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
This code for _getAssetParentId() above uses JTableAsset to retrieve the asset_id of the asset-parent. This is different from the code in the current version of com_content, where the asset_id of the category is retrieved from the #__categories database table. That is another possibility; many ways leading to Rome. In com_content however, if an item would not be under a category, then the asset_id of the global asset is returned. That would of course not be right, but is fixed there by providing a default category &amp;quot;uncategorised&amp;quot;, so that an article is &#039;&#039;always&#039;&#039; under a category. That is why you cannot just copy the code of _getAssetParentId() in com_content to your own component. The code above is more general.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Showing the setting of permissions on the item level === &amp;lt;!--T:69--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
Adding the rules field to the form-definition of the edit-form.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/forms/helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/models/forms/helloworld.xml&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;55-74&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;form&lt;br /&gt;
				addrulepath=&amp;quot;/administrator/components/com_helloworld/models/rules&amp;quot;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset&lt;br /&gt;
				name=&amp;quot;details&amp;quot;&lt;br /&gt;
				label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_DETAILS&amp;quot;&lt;br /&gt;
	&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 validate-greeting&amp;quot;&lt;br /&gt;
				validate=&amp;quot;greeting&amp;quot;&lt;br /&gt;
				required=&amp;quot;true&amp;quot;&lt;br /&gt;
				default=&amp;quot;&amp;quot;&lt;br /&gt;
				/&amp;gt;&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
				name=&amp;quot;catid&amp;quot;&lt;br /&gt;
				type=&amp;quot;category&amp;quot;&lt;br /&gt;
				extension=&amp;quot;com_helloworld&amp;quot;&lt;br /&gt;
				class=&amp;quot;inputbox&amp;quot;&lt;br /&gt;
				default=&amp;quot;&amp;quot;&lt;br /&gt;
				label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_CATID_LABEL&amp;quot;&lt;br /&gt;
				description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_CATID_DESC&amp;quot;&lt;br /&gt;
				required=&amp;quot;true&amp;quot;&lt;br /&gt;
		&amp;gt;&lt;br /&gt;
			&amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JOPTION_SELECT_CATEGORY&amp;lt;/option&amp;gt;&lt;br /&gt;
		&amp;lt;/field&amp;gt;&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset&lt;br /&gt;
				name=&amp;quot;params&amp;quot;&lt;br /&gt;
				label=&amp;quot;JGLOBAL_FIELDSET_DISPLAY_OPTIONS&amp;quot;&lt;br /&gt;
		&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;show_category&amp;quot;&lt;br /&gt;
					type=&amp;quot;list&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_SHOW_CATEGORY_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_SHOW_CATEGORY_DESC&amp;quot;&lt;br /&gt;
					default=&amp;quot;&amp;quot;&lt;br /&gt;
			&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&amp;quot;&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JHIDE&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JSHOW&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;fieldset&lt;br /&gt;
			name=&amp;quot;accesscontrol&amp;quot;&lt;br /&gt;
			label=&amp;quot;COM_HELLOWORLD_FIELDSET_RULES&amp;quot;&lt;br /&gt;
	&amp;gt;&lt;br /&gt;
    	&amp;lt;field&lt;br /&gt;
				name=&amp;quot;asset_id&amp;quot;&lt;br /&gt;
				type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
				filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
				/&amp;gt;&lt;br /&gt;
    	&amp;lt;field&lt;br /&gt;
				name=&amp;quot;rules&amp;quot;&lt;br /&gt;
				type=&amp;quot;rules&amp;quot;&lt;br /&gt;
				label=&amp;quot;COM_HELLOWORLD_FIELD_RULES_LABEL&amp;quot;&lt;br /&gt;
				filter=&amp;quot;rules&amp;quot;&lt;br /&gt;
				validate=&amp;quot;rules&amp;quot;&lt;br /&gt;
				class=&amp;quot;inputbox&amp;quot;&lt;br /&gt;
				component=&amp;quot;com_helloworld&amp;quot;&lt;br /&gt;
				section=&amp;quot;message&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;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
Now the ACL interface is displayed at the bottom of the Helloworld editform too (the &#039;&#039;edit.php&#039;&#039; file automatically get the fieldsets from the above xml).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Adding language strings === &amp;lt;!--T:72--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
We used 4 language strings that have to be added to the backend language-file.&amp;lt;/translate&amp;gt;&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;
&amp;lt;tt&amp;gt;admin/language/en-GB/en-GB.com_helloworld.ini&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot; highlight=&amp;quot;41-44&amp;quot;&amp;gt;&lt;br /&gt;
; Joomla! Project&lt;br /&gt;
; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.&lt;br /&gt;
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php&lt;br /&gt;
; Note : All ini files need to be saved as UTF-8&lt;br /&gt;
&lt;br /&gt;
COM_HELLOWORLD_ADMINISTRATION=&amp;quot;HelloWorld - Administration&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_ADMINISTRATION_CATEGORIES=&amp;quot;HelloWorld - Categories&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_NUM=&amp;quot;#&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLDS_FILTER=&amp;quot;Filters&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PUBLISHED=&amp;quot;Published&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLDS_NAME=&amp;quot;Name&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_ID=&amp;quot;Id&amp;quot;&lt;br /&gt;
&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_CREATING=&amp;quot;HelloWorld - Creating&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_DETAILS=&amp;quot;Details&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_EDITING=&amp;quot;HelloWorld - Editing&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_ERROR_UNACCEPTABLE=&amp;quot;Some values are unacceptable&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_CATID_DESC=&amp;quot;The category the messages belongs to&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_CATID_LABEL=&amp;quot;Category&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC=&amp;quot;This message will be displayed&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL=&amp;quot;Message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_SHOW_CATEGORY_LABEL=&amp;quot;Show category&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_SHOW_CATEGORY_DESC=&amp;quot;If set to Show, the title of the message&amp;amp;rsquo;s category will show.&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_HEADING_GREETING=&amp;quot;Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_HEADING_ID=&amp;quot;Id&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MANAGER_HELLOWORLD_EDIT=&amp;quot;HelloWorld manager: Edit Message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MANAGER_HELLOWORLD_NEW=&amp;quot;HelloWorld manager: New Message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MANAGER_HELLOWORLDS=&amp;quot;HelloWorld manager&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_EDIT_HELLOWORLD=&amp;quot;Edit message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_N_ITEMS_DELETED_1=&amp;quot;One message deleted&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_N_ITEMS_DELETED_MORE=&amp;quot;%d messages deleted&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_N_ITEMS_PUBLISHED=&amp;quot;%d message(s) published&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_N_ITEMS_UNPUBLISHED=&amp;quot;%d message(s) unpublished&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_GREETING_LABEL=&amp;quot;Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_GREETING_DESC=&amp;quot;Add Hello World Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_SUBMENU_MESSAGES=&amp;quot;Messages&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_SUBMENU_CATEGORIES=&amp;quot;Categories&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_CONFIGURATION=&amp;quot;HelloWorld Configuration&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_CONFIG_GREETING_SETTINGS_LABEL=&amp;quot;Messages settings&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_CONFIG_GREETING_SETTINGS_DESC=&amp;quot;Settings that will be applied to all messages by default&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_FIELDSET_RULES=&amp;quot;Message Permissions&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_FIELD_RULES_LABEL=&amp;quot;Permissions&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_ACCESS_DELETE_DESC=&amp;quot;Is this group allowed to edit this message?&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_ACCESS_DELETE_DESC=&amp;quot;Is this group allowed to delete this message?&amp;quot;&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;translate&amp;gt;== Further reading == &amp;lt;!--T:74--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
More information on actions, assets and ACL can be found on the following pages:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
* General information and use: [[S:MyLanguage/Access Control List/1.6-2.5/Tutorial|Access Control List/1.6-2.5/Tutorial]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* Technical information, under construction: [[S:MyLanguage/ACL Technique in Joomla!|ACL Technique in Joomla!]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* [[S:MyLanguage/How to implement actions in your code|How to implement actions in your code]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* [[S:MyLanguage/Adding ACL rules to your component|Adding ACL rules to your component]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Deprecated classes == &amp;lt;!--T:80--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
For the moment we leave the &#039;&#039;&#039;deprecated JError&#039;&#039;&#039;-references as they are. They will probably still be available in Joomla! 3.x. We cannot just change them to JLog::add() statements because in Joomla! 2.5 the messages will then not be enqueued (as there is no messagequeue-logger added as is in /libraries/cms.php in Joomla! 3.0). Other solutions, like using $app-&amp;gt;enqueueMessage() or directly throwing PHP-exceptions as showstopper are also possible, but then there would still be numerous references to JError throughout the application. For instance in the view, we now check for errors raised in the model with: &amp;lt;span style=&amp;quot;color:#900&amp;quot;&amp;gt;count($errors = $this-&amp;gt;get(&#039;Errors&#039;))&amp;lt;/span&amp;gt;, which uses JError from the JOBject that was the base for JModel. To get the same functionality without using JError at all, we would have to change the way the Model raises those errors and warnings now. If we want to make an application that would work in Joomla! 2.5 and 3.x we can continue using JError. The moment we want to use our 3.x extensions also in 4.x we will have to change this (and probably a lot more too). This tutorial is now primarily focused on Joomla! 3.x. So: we notice the upcoming change, but leave it there for the moment.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
Since Joomla! 2.5.5 the MVC-base-classes JController, JModel and JView got proxies JControllerLegacy, JModelLegacy and JViewLegacy. You are recommended to use those proxies instead of the original classes to be forward compatibility with Joomla! CMS 3.x legacy classes.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Packaging the component == &amp;lt;!--T:83--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Content of your code directory&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Using_the_database#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/J3.x:Developing a MVC Component/Adding language management#site.2Flanguage.2Fen-GB.2Fen-GB.com_helloworld.ini|site/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Basic_backend#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_configuration#admin/config.xml|admin/config.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Basic_backend#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_categories#admin/access.xml|admin/access.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_categories#admin/helpers/helloworld.php|admin/helpers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/helpers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_categories#admin/sql/updates/mysql/0.0.12.sql|admin/sql/updates/mysql/0.0.12.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_configuration#admin/sql/updates/mysql/0.0.13.sql|admin/sql/updates/mysql/0.0.13.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_ACL#admin/sql/updates/mysql/0.0.14.sql|admin/sql/updates/mysql/0.0.14.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Basic_backend#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_backend_actions#admin/models/helloworlds.php|admin/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_verifications#admin/models/forms/helloworld.js|admin/models/forms/helloworld.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_backend_actions#admin/models/forms/helloworld.xml|admin/models/forms/helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_verifications#admin/models/rules/greeting.php|admin/models/rules/greeting.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/rules/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_backend_actions#admin/controllers/helloworld.php|admin/controllers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_backend_actions#admin/controllers/helloworlds.php|admin/controllers/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_backend_actions#admin/views/helloworld/view.html.php|admin/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_backend_actions#admin/views/helloworld/tmpl/edit.php|admin/views/helloworld/tmpl/edit.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_verifications#admin/views/helloworld/submitbutton.js|admin/views/helloworld/submitbutton.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Using_the_database#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.x:Developing a MVC Component/Adding language management#admin.2Flanguage.2Fen-GB.2Fen-GB.com_helloworld.ini|admin/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.x:Developing a MVC Component/Adding language management#admin.2Flanguage.2Fen-GB.2Fen-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|media/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|media/images/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.x:Developing_a_MVC_Component/Adding_decorations_to_the_backend#Adding_some_icons|media/images/tux-16x16.png]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.x:Developing_a_MVC_Component/Adding_decorations_to_the_backend#Adding_some_icons|media/images/tux-48x48.png]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-14-adding-ACL.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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&amp;gt;&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;February 2015&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.14&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 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;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;languages folder=&amp;quot;site/language&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
        &amp;lt;/languages&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;media destination=&amp;quot;com_helloworld&amp;quot; folder=&amp;quot;media&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;images&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/media&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039; img=&amp;quot;../media/com_helloworld/images/tux-16x16.png&amp;quot;&amp;gt;COM_HELLOWORLD_MENU&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;config.xml&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;filename&amp;gt;access.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- views files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- controllers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- helpers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;helpers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
		&amp;lt;languages folder=&amp;quot;admin/language&amp;quot;&amp;gt;&lt;br /&gt;
        		&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;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;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;
&amp;lt;translate&amp;gt;== Contributors == &amp;lt;!--T:86--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
*[[User:Dwarkesh0204|Dwarkesh Soni]]&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User:florian_denizot|Florian Denizot]]&lt;br /&gt;
*[[User:HermanPeeren|Herman Peeren]]&lt;br /&gt;
* TDZweb (Ståle Rolf Sæbøe), Elin Waring, Neil via https://groups.google.com/forum/#!topic/joomla-dev-general/aCH3GNA91m4&lt;br /&gt;
*[[User:Scionescire|Scionescire]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&amp;lt;translate&amp;gt;&amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
S:MyLanguage/J3.x:Developing_a_MVC_Component/Adding configuration|Prev: Adding configuration&amp;lt;/translate&amp;gt;|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&amp;lt;translate&amp;gt;&amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
S:MyLanguage/J3.x:Developing_a_MVC_Component/Adding an install-uninstall-update script file|Next: Adding an install-uninstall-update script file&amp;lt;/translate&amp;gt;|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
[[Category:Joomla! 3.x]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_ACL&amp;diff=202928</id>
		<title>J3.x:Developing an MVC Component/Adding ACL</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_ACL&amp;diff=202928"/>
		<updated>2015-07-09T18:46:31Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: This is the J3.x example not J2.5, somethings should just be fixed&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;
{{review}}&lt;br /&gt;
{{:J3.1:Developing a MVC Component/&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;translate&amp;gt;== Introduction == &amp;lt;!--T:2--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
This tutorial is part of the [[S:MyLanguage/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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Adding Access Control == &amp;lt;!--T:4--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
With Joomla!&#039;s Access Control we can define which user groups are allowed or denied to do which actions in your component. In this example we use actions that are defined in the core. For the component as a whole: core.admin (access to the configuration) and core.manage (access to the backend). And at various levels actions like create, delete and edit. Besides those core actions you can define your own actions, but that is often not necessary and is not shown in this example. View/Read Access is not managed via those actions but with View Access Levels; see general documentation about Joomla!&#039;s ACL for that.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
In the #__assets table the actual list is stored: which user groups are allowed or denied to do which actions on which resources (assets). This is the implementation of the Access Control List (ACL).&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
In this article we will show how to add and use access permissions at several levels of granularity: for your component as a whole, for the categories and for the individual items.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
Note: in this HelloWorld example we are working in the backend, so the only access level available are &#039;&#039;administrator&#039;&#039; and &#039;&#039;superuser&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
To test this tutorial first create a new administrator user and then set its permissions (working as superuser).&lt;br /&gt;
After loggin in as administrator you will see the changes.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Minimal ACL requirements at the component level == &amp;lt;!--T:10--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
There are 2 actions that need to be defined at the component level for a Joomla! 2.5+ component to offer basic ACL support:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Configure&#039;&#039;&#039; (core.admin): which groups are allowed to configure the component level permissions via the &#039;Options&#039; toolbar button?&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Access Component&#039;&#039;&#039; (core.manage): which groups are allowed to access the component&#039;s backend?&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
This basic ACL support is done in 4 simple steps:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
* [[#Add_the_2_minimal_component_level_actions_to_access.xml|Add the 2 minimal component level actions to access.xml]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
* [[#Add_the_permissions_fieldset_to_config.xml|Add the permissions fieldset to config.xml]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
* [[#Add_the_.27Options.27_toolbar_button_when_user_is_authorised_for_it|Add the &#039;Options&#039; toolbar button]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
* [[#Restrict_the_access_to_the_component.27s_backend_to_authorised_usergroups|Restrict the access to the component&#039;s backend]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Add the 2 minimal component level actions to access.xml === &amp;lt;!--T:19--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
A minimal ACL &amp;lt;/tt&amp;gt;access.xml&amp;lt;/tt&amp;gt; would consist of only those 2 basic actions:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Basic admin/access.xml&amp;lt;/tt&amp;gt;&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;access component=&amp;quot;com_helloworld&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;section name=&amp;quot;component&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.admin&amp;quot; title=&amp;quot;JACTION_ADMIN&amp;quot; description=&amp;quot;JACTION_ADMIN_COMPONENT_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.manage&amp;quot; title=&amp;quot;JACTION_MANAGE&amp;quot; description=&amp;quot;JACTION_MANAGE_COMPONENT_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/access&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
See &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_categories#admin/access.xml|admin/access.xml]]&#039;&#039; for the current and more elaborate version.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Add the permissions fieldset to config.xml === &amp;lt;!--T:22--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
Add the following permissions fieldset to &amp;lt;tt&amp;gt;admin/config.xml&amp;lt;/tt&amp;gt; in order to be able to set our component level permissions.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset&lt;br /&gt;
		name=&amp;quot;permissions&amp;quot;&lt;br /&gt;
		label=&amp;quot;JCONFIG_PERMISSIONS_LABEL&amp;quot;&lt;br /&gt;
		description=&amp;quot;JCONFIG_PERMISSIONS_DESC&amp;quot;&lt;br /&gt;
	&amp;gt;&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
			name=&amp;quot;rules&amp;quot;&lt;br /&gt;
			type=&amp;quot;rules&amp;quot;&lt;br /&gt;
			label=&amp;quot;JCONFIG_PERMISSIONS_LABEL&amp;quot;&lt;br /&gt;
			class=&amp;quot;inputbox&amp;quot;&lt;br /&gt;
			validate=&amp;quot;rules&amp;quot;&lt;br /&gt;
			filter=&amp;quot;rules&amp;quot;&lt;br /&gt;
			component=&amp;quot;com_helloworld&amp;quot;&lt;br /&gt;
			section=&amp;quot;component&amp;quot;&lt;br /&gt;
		/&amp;gt;&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
See the [[#admin.2Fconfig.xml|more elaborate config.xml example]] further downwards for the exact place where to insert this code.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Add the &#039;Options&#039; toolbar button when user is authorised for it === &amp;lt;!--T:25--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
In the &amp;lt;tt&amp;gt;admin/views/helloworlds/view.html.php&amp;lt;/tt&amp;gt; file you can add the following code to check if the user can edit the preferences:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;2-3,5&amp;quot;&amp;gt;&lt;br /&gt;
    // Options button.&lt;br /&gt;
    if (JFactory::getUser()-&amp;gt;authorise(&#039;core.admin&#039;, &#039;com_helloworld&#039;)) &lt;br /&gt;
    {&lt;br /&gt;
	JToolBarHelper::preferences(&#039;com_helloworld&#039;);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
See further downwards for a [[#admin/views/helloworlds/view.html.php|more elaborated example of &#039;&#039;admin/views/helloworlds/view.html.php&#039;&#039;]] where this &#039;&#039;JToolBarHelper::preferences(&#039;com_helloworld&#039;)&#039;&#039; is done in an addToolBar()-method together with the other toolbar buttons and the &#039;&#039;JUser-&amp;gt;authorise()&#039;&#039;-check is done with JHelperContent, resulting in the $canDo-property.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Restrict the access to the component&#039;s backend to authorised usergroups === &amp;lt;!--T:28--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
To control the access to the backend of the component add the following lines to the &amp;lt;tt&amp;gt;admin/helloworld.php&amp;lt;/tt&amp;gt; entry-file:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Access check: is this user allowed to access the backend of this component?&lt;br /&gt;
if (!JFactory::getUser()-&amp;gt;authorise(&#039;core.manage&#039;, &#039;com_helloworld&#039;)) &lt;br /&gt;
{&lt;br /&gt;
	throw new Exception(JText::_(&#039;JERROR_ALERTNOAUTHOR&#039;));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
See further downwards for the [[#admin/helloworld.php|whole code of the &#039;&#039;admin/helloworld.php&#039;&#039; file]].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Adding more actions, also at category level and item level == &amp;lt;!--T:31--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
When adding more actions and more levels, the above described 4 steps are done too:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
* [[#Describing_the_actions_you_want_to_control_the_access_to|Add the actions to access.xml; here we can add more actions and levels]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* [[#Adding_the_setting_of_permissions_in_the_component.27s_Preferences|Add the permissions-fieldset to config.xml]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
* [[#Displaying_only_the_right_toolbar_buttons|Add the &#039;Options&#039; toolbar button]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
* [[#Restricting_access_to_the_component|Restrict the access to the component&#039;s backend&lt;br /&gt;
]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
In addition we also have to do the following steps:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
* [[#Add_the_asset_id_column_to_the_database_table|Add an asset_id to the item&#039;s database table for item level access control]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
* [[#Setting_the_permission_values_in_the_assets_table|Store the permissions in the assets table. Especially take care of setting the asset_id of the parent-asset]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
* [[#Showing_the_setting_of_permissions_on_the_item_level|Make the settings of the permissions at the item level editable]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
* [[#Adding_language_strings|Add some language strings]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Describing the actions you want to control the access to === &amp;lt;!--T:42--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
Each component (or part of it) has its own set of permissions that can be controlled. They are described in an &amp;lt;tt&amp;gt;access.xml&amp;lt;/tt&amp;gt; file located at the root of the &#039;&#039;admin&#039;&#039; folder. In this helloworld-example the actions to which access is controlled are divided in three sections: at the component level, the category level and the item level. An &#039;item&#039; is called a &#039;message&#039; in our example component, hence the name of the third section.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/access.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/access.xml&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;10-16&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;access component=&amp;quot;com_helloworld&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;section name=&amp;quot;component&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.admin&amp;quot; title=&amp;quot;JACTION_ADMIN&amp;quot; description=&amp;quot;JACTION_ADMIN_COMPONENT_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.manage&amp;quot; title=&amp;quot;JACTION_MANAGE&amp;quot; description=&amp;quot;JACTION_MANAGE_COMPONENT_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.create&amp;quot; title=&amp;quot;JACTION_CREATE&amp;quot; description=&amp;quot;JACTION_CREATE_COMPONENT_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.delete&amp;quot; title=&amp;quot;JACTION_DELETE&amp;quot; description=&amp;quot;JACTION_DELETE_COMPONENT_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.edit&amp;quot; title=&amp;quot;JACTION_EDIT&amp;quot; description=&amp;quot;JACTION_EDIT_COMPONENT_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/section&amp;gt;&lt;br /&gt;
	&amp;lt;section name=&amp;quot;category&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.create&amp;quot; title=&amp;quot;JACTION_CREATE&amp;quot; description=&amp;quot;COM_CATEGORIES_ACCESS_CREATE_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.delete&amp;quot; title=&amp;quot;JACTION_DELETE&amp;quot; description=&amp;quot;COM_CATEGORIES_ACCESS_DELETE_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.edit&amp;quot; title=&amp;quot;JACTION_EDIT&amp;quot; description=&amp;quot;COM_CATEGORIES_ACCESS_EDIT_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.edit.state&amp;quot; title=&amp;quot;JACTION_EDITSTATE&amp;quot; description=&amp;quot;COM_CATEGORIES_ACCESS_EDITSTATE_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.edit.own&amp;quot; title=&amp;quot;JACTION_EDITOWN&amp;quot; description=&amp;quot;COM_CATEGORIES_ACCESS_EDITOWN_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/section&amp;gt;&lt;br /&gt;
	&amp;lt;section name=&amp;quot;message&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.delete&amp;quot; title=&amp;quot;JACTION_DELETE&amp;quot; description=&amp;quot;COM_HELLOWORLD_ACCESS_DELETE_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;action name=&amp;quot;core.edit&amp;quot; title=&amp;quot;JACTION_EDIT&amp;quot; description=&amp;quot;COM_HELLOWORLD_ACCESS_EDIT_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/access&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Adding the setting of permissions in the component&#039;s Preferences === &amp;lt;!--T:44--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Since we now use Access Control permissions in our component, we need to be able to set them at the component level. That is done in the Preferences of this component: the screen you see after clicking the &#039;Options&#039; button. The config.xml-file is a form-definition for those Preferences. We could define the component level actions here too, as a child of the &amp;quot;rules&amp;quot; field-tag, but it is now preferred to also put those actions in &amp;lt;tt&amp;gt;access.xml&amp;lt;/tt&amp;gt; in that way all access rules for this component are on one spot.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/config.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/config.xml&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;19-34&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;config&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset&lt;br /&gt;
		name=&amp;quot;greetings&amp;quot;&lt;br /&gt;
		label=&amp;quot;COM_HELLOWORLD_CONFIG_GREETING_SETTINGS_LABEL&amp;quot;&lt;br /&gt;
		description=&amp;quot;COM_HELLOWORLD_CONFIG_GREETING_SETTINGS_DESC&amp;quot;&lt;br /&gt;
	&amp;gt;&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
			name=&amp;quot;show_category&amp;quot;&lt;br /&gt;
			type=&amp;quot;radio&amp;quot;&lt;br /&gt;
			label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_SHOW_CATEGORY_LABEL&amp;quot;&lt;br /&gt;
			description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_SHOW_CATEGORY_DESC&amp;quot;&lt;br /&gt;
			default=&amp;quot;0&amp;quot;&lt;br /&gt;
		&amp;gt;&lt;br /&gt;
			&amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JHIDE&amp;lt;/option&amp;gt;&lt;br /&gt;
			&amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JSHOW&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;fieldset&lt;br /&gt;
		name=&amp;quot;permissions&amp;quot;&lt;br /&gt;
		label=&amp;quot;JCONFIG_PERMISSIONS_LABEL&amp;quot;&lt;br /&gt;
		description=&amp;quot;JCONFIG_PERMISSIONS_DESC&amp;quot;&lt;br /&gt;
	&amp;gt;&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
			name=&amp;quot;rules&amp;quot;&lt;br /&gt;
			type=&amp;quot;rules&amp;quot;&lt;br /&gt;
			label=&amp;quot;JCONFIG_PERMISSIONS_LABEL&amp;quot;&lt;br /&gt;
			class=&amp;quot;inputbox&amp;quot;&lt;br /&gt;
			validate=&amp;quot;rules&amp;quot;&lt;br /&gt;
			filter=&amp;quot;rules&amp;quot;&lt;br /&gt;
			component=&amp;quot;com_helloworld&amp;quot;&lt;br /&gt;
			section=&amp;quot;component&amp;quot;&lt;br /&gt;
		/&amp;gt;&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/config&amp;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;translate&amp;gt;=== Displaying only the right toolbar buttons === &amp;lt;!--T:46--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
Which toolbar buttons to display depends on the Access Control permissions for the user. We put all permissions for this user in the $canDo property of the view; so we can eventually refer to it in layouts (in the edit-form for example).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
In the &amp;lt;tt&amp;gt;admin/views/helloworlds/view.html.php&amp;lt;/tt&amp;gt;, put this code:&amp;lt;/translate&amp;gt;&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;
&amp;lt;tt&amp;gt;admin/views/helloworlds/view.html.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;42-44,83-85,87-89,91-93,95-98,100&amp;quot; &amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&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;
/**&lt;br /&gt;
 * HelloWorlds View&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorlds extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Display the Hello World view&lt;br /&gt;
	 *&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  void&lt;br /&gt;
	 */&lt;br /&gt;
	function display($tpl = null)&lt;br /&gt;
	{&lt;br /&gt;
		&lt;br /&gt;
		// Get application&lt;br /&gt;
		$app = JFactory::getApplication();&lt;br /&gt;
		$context = &amp;quot;helloworld.list.admin.helloworld&amp;quot;;&lt;br /&gt;
		// Get data from the model&lt;br /&gt;
		$this-&amp;gt;items		= $this-&amp;gt;get(&#039;Items&#039;);&lt;br /&gt;
		$this-&amp;gt;pagination	= $this-&amp;gt;get(&#039;Pagination&#039;);&lt;br /&gt;
		$this-&amp;gt;state		= $this-&amp;gt;get(&#039;State&#039;);&lt;br /&gt;
		$this-&amp;gt;filter_order	= $app-&amp;gt;getUserStateFromRequest($context.&#039;filter_order&#039;, &#039;filter_order&#039;, &#039;greeting&#039;, &#039;cmd&#039;);&lt;br /&gt;
		$this-&amp;gt;filter_order_Dir = $app-&amp;gt;getUserStateFromRequest($context.&#039;filter_order_Dir&#039;, &#039;filter_order_Dir&#039;, &#039;asc&#039;, &#039;cmd&#039;);&lt;br /&gt;
		$this-&amp;gt;filterForm    	= $this-&amp;gt;get(&#039;FilterForm&#039;);&lt;br /&gt;
		$this-&amp;gt;activeFilters 	= $this-&amp;gt;get(&#039;ActiveFilters&#039;);&lt;br /&gt;
&lt;br /&gt;
		// What Access Permissions does this user have? What can (s)he do?&lt;br /&gt;
		$this-&amp;gt;canDo = JHelperContent::getActions();&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;
			throw new Exception(implode(&amp;quot;\n&amp;quot;, $errors), 500);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		// Set the submenu&lt;br /&gt;
		HelloWorldHelper::addSubmenu(&#039;helloworlds&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Set the toolbar and number of found items&lt;br /&gt;
		$this-&amp;gt;addToolBar();&lt;br /&gt;
&lt;br /&gt;
		// Display the template&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
&lt;br /&gt;
		// Set the document&lt;br /&gt;
		$this-&amp;gt;setDocument();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Add the page title and toolbar.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  void&lt;br /&gt;
	 *&lt;br /&gt;
	 * @since   1.6&lt;br /&gt;
	 */&lt;br /&gt;
	protected function addToolBar()&lt;br /&gt;
	{&lt;br /&gt;
		$title = JText::_(&#039;COM_HELLOWORLD_MANAGER_HELLOWORLDS&#039;);&lt;br /&gt;
&lt;br /&gt;
		if ($this-&amp;gt;pagination-&amp;gt;total)&lt;br /&gt;
		{&lt;br /&gt;
			$title .= &amp;quot;&amp;lt;span style=&#039;font-size: 0.5em; vertical-align: middle;&#039;&amp;gt;(&amp;quot; . $this-&amp;gt;pagination-&amp;gt;total . &amp;quot;)&amp;lt;/span&amp;gt;&amp;quot;;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		JToolBarHelper::title($title, &#039;helloworld&#039;);&lt;br /&gt;
&lt;br /&gt;
		if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.create&#039;)) &lt;br /&gt;
		{&lt;br /&gt;
			JToolBarHelper::addNew(&#039;helloworld.add&#039;, &#039;JTOOLBAR_NEW&#039;);&lt;br /&gt;
		}&lt;br /&gt;
		if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.edit&#039;)) &lt;br /&gt;
		{&lt;br /&gt;
			JToolBarHelper::editList(&#039;helloworld.edit&#039;, &#039;JTOOLBAR_EDIT&#039;);&lt;br /&gt;
		}&lt;br /&gt;
		if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.delete&#039;)) &lt;br /&gt;
		{&lt;br /&gt;
			JToolBarHelper::deleteList(&#039;&#039;, &#039;helloworlds.delete&#039;, &#039;JTOOLBAR_DELETE&#039;);&lt;br /&gt;
		}&lt;br /&gt;
		if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.admin&#039;)) &lt;br /&gt;
		{&lt;br /&gt;
			JToolBarHelper::divider();&lt;br /&gt;
			JToolBarHelper::preferences(&#039;com_helloworld&#039;);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to set up the document properties&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return void&lt;br /&gt;
	 */&lt;br /&gt;
	protected function setDocument() &lt;br /&gt;
	{&lt;br /&gt;
		$document = JFactory::getDocument();&lt;br /&gt;
		$document-&amp;gt;setTitle(JText::_(&#039;COM_HELLOWORLD_ADMINISTRATION&#039;));&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the &#039;&#039;admin/views/helloworld/view.html.php&#039;&#039;, put this code&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; highlight=&amp;quot;23,39-41,76-78,81-89,93-112&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&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;
/**&lt;br /&gt;
 * HelloWorld View&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorld extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	protected $form;&lt;br /&gt;
	protected $item;&lt;br /&gt;
	protected $script;&lt;br /&gt;
	protected $canDo;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Display the Hello World view&lt;br /&gt;
	 *&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  void&lt;br /&gt;
	 */&lt;br /&gt;
	public function display($tpl = null)&lt;br /&gt;
	{&lt;br /&gt;
		// Get the Data&lt;br /&gt;
		$this-&amp;gt;form = $this-&amp;gt;get(&#039;Form&#039;);&lt;br /&gt;
		$this-&amp;gt;item = $this-&amp;gt;get(&#039;Item&#039;);&lt;br /&gt;
		$this-&amp;gt;script = $this-&amp;gt;get(&#039;Script&#039;);&lt;br /&gt;
&lt;br /&gt;
		// What Access Permissions does this user have? What can (s)he do?&lt;br /&gt;
		$this-&amp;gt;canDo = JHelperContent::getActions($this-&amp;gt;item-&amp;gt;id);&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;
			throw new Exception(implode(&amp;quot;\n&amp;quot;, $errors), 500);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		// Set the toolbar&lt;br /&gt;
		$this-&amp;gt;addToolBar();&lt;br /&gt;
&lt;br /&gt;
		// Display the template&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
&lt;br /&gt;
		// Set the document&lt;br /&gt;
		$this-&amp;gt;setDocument();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Add the page title and toolbar.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  void&lt;br /&gt;
	 *&lt;br /&gt;
	 * @since   1.6&lt;br /&gt;
	 */&lt;br /&gt;
	protected function addToolBar()&lt;br /&gt;
	{&lt;br /&gt;
		$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
&lt;br /&gt;
		// Hide Joomla Administrator Main menu&lt;br /&gt;
		$input-&amp;gt;set(&#039;hidemainmenu&#039;, true);&lt;br /&gt;
&lt;br /&gt;
		$isNew = ($this-&amp;gt;item-&amp;gt;id == 0);&lt;br /&gt;
&lt;br /&gt;
		JToolBarHelper::title($isNew ? JText::_(&#039;COM_HELLOWORLD_MANAGER_HELLOWORLD_NEW&#039;)&lt;br /&gt;
		                             : JText::_(&#039;COM_HELLOWORLD_MANAGER_HELLOWORLD_EDIT&#039;), &#039;helloworld&#039;);&lt;br /&gt;
		// Build the actions for new and existing records.&lt;br /&gt;
		if ($isNew)&lt;br /&gt;
		{&lt;br /&gt;
			// For new records, check the create permission.&lt;br /&gt;
			if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.create&#039;)) &lt;br /&gt;
			{&lt;br /&gt;
				JToolBarHelper::apply(&#039;helloworld.apply&#039;, &#039;JTOOLBAR_APPLY&#039;);&lt;br /&gt;
				JToolBarHelper::save(&#039;helloworld.save&#039;, &#039;JTOOLBAR_SAVE&#039;);&lt;br /&gt;
				JToolBarHelper::custom(&#039;helloworld.save2new&#039;, &#039;save-new.png&#039;, &#039;save-new_f2.png&#039;,&lt;br /&gt;
				                       &#039;JTOOLBAR_SAVE_AND_NEW&#039;, false);&lt;br /&gt;
			}&lt;br /&gt;
			JToolBarHelper::cancel(&#039;helloworld.cancel&#039;, &#039;JTOOLBAR_CANCEL&#039;);&lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.edit&#039;))&lt;br /&gt;
			{&lt;br /&gt;
				// We can save the new record&lt;br /&gt;
				JToolBarHelper::apply(&#039;helloworld.apply&#039;, &#039;JTOOLBAR_APPLY&#039;);&lt;br /&gt;
				JToolBarHelper::save(&#039;helloworld.save&#039;, &#039;JTOOLBAR_SAVE&#039;);&lt;br /&gt;
 &lt;br /&gt;
				// We can save this record, but check the create permission to see&lt;br /&gt;
				// if we can return to make a new one.&lt;br /&gt;
				if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.create&#039;)) &lt;br /&gt;
				{&lt;br /&gt;
					JToolBarHelper::custom(&#039;helloworld.save2new&#039;, &#039;save-new.png&#039;, &#039;save-new_f2.png&#039;,&lt;br /&gt;
					                       &#039;JTOOLBAR_SAVE_AND_NEW&#039;, false);&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.create&#039;)) &lt;br /&gt;
			{&lt;br /&gt;
				JToolBarHelper::custom(&#039;helloworld.save2copy&#039;, &#039;save-copy.png&#039;, &#039;save-copy_f2.png&#039;,&lt;br /&gt;
				                       &#039;JTOOLBAR_SAVE_AS_COPY&#039;, false);&lt;br /&gt;
			}&lt;br /&gt;
			JToolBarHelper::cancel(&#039;helloworld.cancel&#039;, &#039;JTOOLBAR_CLOSE&#039;);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to set up the document properties&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return void&lt;br /&gt;
	 */&lt;br /&gt;
	protected function setDocument() &lt;br /&gt;
	{&lt;br /&gt;
		$isNew = ($this-&amp;gt;item-&amp;gt;id == 0);&lt;br /&gt;
		$document = JFactory::getDocument();&lt;br /&gt;
		$document-&amp;gt;setTitle($isNew ? JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_CREATING&#039;)&lt;br /&gt;
		                           : JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_EDITING&#039;));&lt;br /&gt;
		$document-&amp;gt;addScript(JURI::root() . $this-&amp;gt;script);&lt;br /&gt;
		$document-&amp;gt;addScript(JURI::root() . &amp;quot;/administrator/components/com_helloworld&amp;quot;&lt;br /&gt;
		                                  . &amp;quot;/views/helloworld/submitbutton.js&amp;quot;);&lt;br /&gt;
		JText::script(&#039;COM_HELLOWORLD_HELLOWORLD_ERROR_UNACCEPTABLE&#039;);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
These two files use the &#039;&#039;getActions&#039;&#039; method defined in the &amp;lt;tt&amp;gt;admin/helpers/helloworld.php&amp;lt;/tt&amp;gt; file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
In the helper-file, put this code:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/helpers/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/helpers/helloworld.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;50-72&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&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;
/**&lt;br /&gt;
 * HelloWorld component helper.&lt;br /&gt;
 *&lt;br /&gt;
 * @param   string  $submenu  The name of the active view.&lt;br /&gt;
 *&lt;br /&gt;
 * @return  void&lt;br /&gt;
 *&lt;br /&gt;
 * @since   1.6&lt;br /&gt;
 */&lt;br /&gt;
abstract class HelloWorldHelper&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Configure the Linkbar.&lt;br /&gt;
	 */&lt;br /&gt;
	public static function addSubmenu($submenu) &lt;br /&gt;
	{&lt;br /&gt;
		JSubMenuHelper::addEntry(&lt;br /&gt;
			JText::_(&#039;COM_HELLOWORLD_SUBMENU_MESSAGES&#039;),&lt;br /&gt;
			&#039;index.php?option=com_helloworld&#039;,&lt;br /&gt;
			$submenu == &#039;messages&#039;&lt;br /&gt;
		);&lt;br /&gt;
&lt;br /&gt;
		JSubMenuHelper::addEntry(&lt;br /&gt;
			JText::_(&#039;COM_HELLOWORLD_SUBMENU_CATEGORIES&#039;),&lt;br /&gt;
			&#039;index.php?option=com_categories&amp;amp;view=categories&amp;amp;extension=com_helloworld&#039;,&lt;br /&gt;
			$submenu == &#039;categories&#039;&lt;br /&gt;
		);&lt;br /&gt;
&lt;br /&gt;
		// set some global property&lt;br /&gt;
		$document = JFactory::getDocument();&lt;br /&gt;
		$document-&amp;gt;addStyleDeclaration(&#039;.icon-48-helloworld &#039; .&lt;br /&gt;
		                               &#039;{background-image: url(../media/com_helloworld/images/tux-48x48.png);}&#039;);&lt;br /&gt;
		if ($submenu == &#039;categories&#039;) &lt;br /&gt;
		{&lt;br /&gt;
			$document-&amp;gt;setTitle(JText::_(&#039;COM_HELLOWORLD_ADMINISTRATION_CATEGORIES&#039;));&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the actions&lt;br /&gt;
	 */&lt;br /&gt;
	public static function getActions($messageId = 0)&lt;br /&gt;
	{	&lt;br /&gt;
		$result	= new JObject;&lt;br /&gt;
&lt;br /&gt;
		if (empty($messageId)) {&lt;br /&gt;
			$assetName = &#039;com_helloworld&#039;;&lt;br /&gt;
		}&lt;br /&gt;
		else {&lt;br /&gt;
			$assetName = &#039;com_helloworld.message.&#039;.(int) $messageId;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$actions = JAccess::getActions(&#039;com_helloworld&#039;, &#039;component&#039;);&lt;br /&gt;
&lt;br /&gt;
		foreach ($actions as $action) {&lt;br /&gt;
			$result-&amp;gt;set($action-&amp;gt;name, JFactory::getUser()-&amp;gt;authorise($action-&amp;gt;name, $assetName));&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $result;&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;
&amp;lt;translate&amp;gt;=== Restricting access to the component === &amp;lt;!--T:51--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
The main idea in ACL is to restrict actions to groups of users. The first action to be restricted is access to the administrative backend of the component itself. With your favorite file editor, edit the &amp;lt;tt&amp;gt;admin/helloworld.php&amp;lt;/tt&amp;gt; file and add the lines with the access check.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/helloworld.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;17-22&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// Set some global property&lt;br /&gt;
$document = JFactory::getDocument();&lt;br /&gt;
$document-&amp;gt;addStyleDeclaration(&#039;.icon-helloworld {background-image: url(../media/com_helloworld/images/tux-16x16.png);}&#039;);&lt;br /&gt;
&lt;br /&gt;
// Access check: is this user allowed to access the backend of this component?&lt;br /&gt;
if (!JFactory::getUser()-&amp;gt;authorise(&#039;core.manage&#039;, &#039;com_helloworld&#039;))&lt;br /&gt;
{&lt;br /&gt;
	throw new Exception(JText::_(&#039;JERROR_ALERTNOAUTHOR&#039;));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Require helper file&lt;br /&gt;
JLoader::register(&#039;HelloWorldHelper&#039;, JPATH_COMPONENT . &#039;/helpers/helloworld.php&#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;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Add the asset_id column to the database table === &amp;lt;!--T:53--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
In order to be able to work with JTable an asset_id column has to be added to the database #__helloworld table.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
So, &amp;lt;tt&amp;gt;admin/sql/install.mysql.utf8.sql&amp;lt;/tt&amp;gt; becomes:&amp;lt;/translate&amp;gt;&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;
&amp;lt;tt&amp;gt;admin/sql/install.mysql.utf8.sql&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;mysql&amp;quot; highlight=&amp;quot;5&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;
	`asset_id` INT(10)     NOT NULL DEFAULT &#039;0&#039;,&lt;br /&gt;
	`greeting` VARCHAR(25) NOT NULL,&lt;br /&gt;
	`published` tinyint(4) NOT NULL,&lt;br /&gt;
	`catid`	    int(11)    NOT NULL DEFAULT &#039;0&#039;,&lt;br /&gt;
	`params`   VARCHAR(1024) NOT NULL DEFAULT &#039;&#039;,&lt;br /&gt;
	PRIMARY KEY (`id`)&lt;br /&gt;
)&lt;br /&gt;
	ENGINE =MyISAM&lt;br /&gt;
	AUTO_INCREMENT =0&lt;br /&gt;
	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;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
For updates we add a sql-update-file:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/updates/mysql/0.0.14.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/sql/updates/mysql/0.0.14.sql&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;mysql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER TABLE`#__helloworld` ADD COLUMN `asset_id` INT(10) UNSIGNED NOT NULL DEFAULT &#039;0&#039; AFTER `id`;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Restricting access to the messages === &amp;lt;!--T:57--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
So far we have restricted access to the component itself, but we also need to do that at &#039;&#039;message&#039;&#039; level.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
To check the &#039;&#039;&#039;&amp;quot;core.delete&amp;quot;&#039;&#039;&#039; permission you need to modify the model class: &amp;lt;tt&amp;gt;admin/models/helloworld.php&amp;lt;/tt&amp;gt; by adding these lines:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/models/helloworld.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;php&#039; highlight=&amp;quot;96-105&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&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;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelAdmin&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a table object, load it if necessary.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   string  $type    The table name. Optional.&lt;br /&gt;
	 * @param   string  $prefix  The class prefix. Optional.&lt;br /&gt;
	 * @param   array   $config  Configuration array for model. Optional.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  JTable  A JTable object&lt;br /&gt;
	 *&lt;br /&gt;
	 * @since   1.6&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;
	/**&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;
	 *&lt;br /&gt;
	 * @return  mixed    A JForm object on success, false on failure&lt;br /&gt;
	 *&lt;br /&gt;
	 * @since   1.6&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(&lt;br /&gt;
			&#039;com_helloworld.helloworld&#039;,&lt;br /&gt;
			&#039;helloworld&#039;,&lt;br /&gt;
			array(&lt;br /&gt;
				&#039;control&#039; =&amp;gt; &#039;jform&#039;,&lt;br /&gt;
				&#039;load_data&#039; =&amp;gt; $loadData&lt;br /&gt;
			)&lt;br /&gt;
		);&lt;br /&gt;
&lt;br /&gt;
		if (empty($form))&lt;br /&gt;
		{&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $form;&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get the script that have to be included on the form&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return string	Script files&lt;br /&gt;
	 */&lt;br /&gt;
	public function getScript() &lt;br /&gt;
	{&lt;br /&gt;
		return &#039;administrator/components/com_helloworld/models/forms/helloworld.js&#039;;&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;
	 *&lt;br /&gt;
	 * @since   1.6&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(&lt;br /&gt;
			&#039;com_helloworld.edit.helloworld.data&#039;,&lt;br /&gt;
			array()&lt;br /&gt;
		);&lt;br /&gt;
&lt;br /&gt;
		if (empty($data))&lt;br /&gt;
		{&lt;br /&gt;
			$data = $this-&amp;gt;getItem();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $data;&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to check if it&#039;s OK to delete a message. Overwrites JModelAdmin::canDelete&lt;br /&gt;
	 */&lt;br /&gt;
	protected function canDelete($record)&lt;br /&gt;
	{&lt;br /&gt;
		if( !empty( $record-&amp;gt;id ) )&lt;br /&gt;
		{&lt;br /&gt;
			return JFactory::getUser()-&amp;gt;authorise( &amp;quot;core.delete&amp;quot;, &amp;quot;com_helloworld.message.&amp;quot; . $record-&amp;gt;id );&lt;br /&gt;
		}&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
To check &#039;&#039;&#039;&amp;quot;core.edit&amp;quot;&#039;&#039;&#039; (and &#039;&#039;&#039;core.add&#039;&#039;&#039; if you wish) you need to update the sub-controller (&#039;&#039;not&#039;&#039; the model). I am not sure why this is so, but that&#039;s how other standard Joomla components do it. You need to add the following lines in the file: &amp;lt;tt&amp;gt;admin/controllers/helloworld.php&amp;lt;/tt&amp;gt;&amp;lt;/translate&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;
&amp;lt;tt&amp;gt;admin/controllers/helloworld.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;  highlight=&amp;quot;21-49&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&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;
/**&lt;br /&gt;
 * HelloWorld Controller&lt;br /&gt;
 *&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 * @since       0.0.9&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldControllerHelloWorld extends JControllerForm&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	* Implement to allowAdd or not&lt;br /&gt;
	*&lt;br /&gt;
	* Not used at this time (but you can look at how other components use it....)&lt;br /&gt;
	* Overwrites: JControllerForm::allowAdd&lt;br /&gt;
	*&lt;br /&gt;
	* @param array $data&lt;br /&gt;
	* @return bool&lt;br /&gt;
	*/&lt;br /&gt;
	protected function allowAdd($data = array())&lt;br /&gt;
	{&lt;br /&gt;
		return parent::allowAdd($data);&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	* Implement to allow edit or not&lt;br /&gt;
	* Overwrites: JControllerForm::allowEdit&lt;br /&gt;
	*&lt;br /&gt;
	* @param array $data&lt;br /&gt;
	* @param string $key&lt;br /&gt;
	* @return bool&lt;br /&gt;
	*/&lt;br /&gt;
	protected function allowEdit($data = array(), $key = &#039;id&#039;)&lt;br /&gt;
	{&lt;br /&gt;
		$id = isset( $data[ $key ] ) ? $data[ $key ] : 0;&lt;br /&gt;
		if( !empty( $id ) )&lt;br /&gt;
		{&lt;br /&gt;
			return JFactory::getUser()-&amp;gt;authorise( &amp;quot;core.edit&amp;quot;, &amp;quot;com_helloworld.message.&amp;quot; . $id );&lt;br /&gt;
		}&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
Please note that &#039;&#039;allowAdd&#039;&#039; simply calls its parent. I&#039;ve put it here in case you want to actually use it in your component. If you look at your &amp;lt;tt&amp;gt;admin/access.xml&amp;lt;/tt&amp;gt; file, you will notice there is no &#039;&#039;core.add&#039;&#039; action defined for &amp;quot;messages&amp;quot;, so you will need to add it there as well if you want to be able to configure it in the interface.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Setting the permission values in the assets table === &amp;lt;!--T:62--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
In order to store permissions for each message in the assets database table, we have to instruct the table class associated with the model to save those permissions in the assets table.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
JTable not only provides an interface for storing the data of the record itself in the item&#039;s database table, but also for storing the permissions for that record in the assets database table. Therefore we must add information to the bind()-method about the permission-values. We also  have to provide the asset name, asset title and the id of the asset parent via the helloworld JTable. Therefore we override 3 methods:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
* _getAssetName(): a unique name for this asset, by which it can be retrieved&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* _getAssetTitle(): a more human-friendly way to identify the asset (not necessary unique)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
* _getAssetParentId(): the asset_id of the parent in the asset database table (from whom permissions are inherited)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/tables/helloworld.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;45-52,80-133&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&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   JDatabaseDriver  &amp;amp;$db  A 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;
	 * Overloaded bind function&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param       array           named array&lt;br /&gt;
	 * @return      null|string     null is operation was satisfactory, otherwise returns an error&lt;br /&gt;
	 * @see JTable:bind&lt;br /&gt;
	 * @since 1.5&lt;br /&gt;
	 */&lt;br /&gt;
	public function bind($array, $ignore = &#039;&#039;)&lt;br /&gt;
	{&lt;br /&gt;
		if (isset($array[&#039;params&#039;]) &amp;amp;&amp;amp; is_array($array[&#039;params&#039;]))&lt;br /&gt;
		{&lt;br /&gt;
			// Convert the params field to a string.&lt;br /&gt;
			$parameter = new JRegistry;&lt;br /&gt;
			$parameter-&amp;gt;loadArray($array[&#039;params&#039;]);&lt;br /&gt;
			$array[&#039;params&#039;] = (string)$parameter;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		// Bind the rules.&lt;br /&gt;
		if (isset($array[&#039;rules&#039;]) &amp;amp;&amp;amp; is_array($array[&#039;rules&#039;]))&lt;br /&gt;
		{&lt;br /&gt;
			$rules = new JAccessRules($array[&#039;rules&#039;]);&lt;br /&gt;
			$this-&amp;gt;setRules($rules);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return parent::bind($array, $ignore);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Overloaded load function&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param       int $pk primary key&lt;br /&gt;
	 * @param       boolean $reset reset data&lt;br /&gt;
	 * @return      boolean&lt;br /&gt;
	 * @see JTable:load&lt;br /&gt;
	 */&lt;br /&gt;
	public function load($pk = null, $reset = true)&lt;br /&gt;
	{&lt;br /&gt;
		if (parent::load($pk, $reset))&lt;br /&gt;
		{&lt;br /&gt;
			// Convert the params field to a registry.&lt;br /&gt;
			$params = new JRegistry;&lt;br /&gt;
			$params-&amp;gt;loadString($this-&amp;gt;params, &#039;JSON&#039;);&lt;br /&gt;
&lt;br /&gt;
			$this-&amp;gt;params = $params;&lt;br /&gt;
			return true;&lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to compute the default name of the asset.&lt;br /&gt;
	 * The default name is in the form `table_name.id`&lt;br /&gt;
	 * where id is the value of the primary key of the table.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return	string&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	protected function _getAssetName()&lt;br /&gt;
	{&lt;br /&gt;
		$k = $this-&amp;gt;_tbl_key;&lt;br /&gt;
		return &#039;com_helloworld.message.&#039;.(int) $this-&amp;gt;$k;&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to return the title to use for the asset table.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return	string&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	protected function _getAssetTitle()&lt;br /&gt;
	{&lt;br /&gt;
		return $this-&amp;gt;greeting;&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get the asset-parent-id of the item&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return	int&lt;br /&gt;
	 */&lt;br /&gt;
	protected function _getAssetParentId(JTable $table = NULL, $id = NULL)&lt;br /&gt;
	{&lt;br /&gt;
		// We will retrieve the parent-asset from the Asset-table&lt;br /&gt;
		$assetParent = JTable::getInstance(&#039;Asset&#039;);&lt;br /&gt;
		// Default: if no asset-parent can be found we take the global asset&lt;br /&gt;
		$assetParentId = $assetParent-&amp;gt;getRootId();&lt;br /&gt;
&lt;br /&gt;
		// Find the parent-asset&lt;br /&gt;
		if (($this-&amp;gt;catid)&amp;amp;&amp;amp; !empty($this-&amp;gt;catid))&lt;br /&gt;
		{&lt;br /&gt;
			// The item has a category as asset-parent&lt;br /&gt;
			$assetParent-&amp;gt;loadByName(&#039;com_helloworld.category.&#039; . (int) $this-&amp;gt;catid);&lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			// The item has the component as asset-parent&lt;br /&gt;
			$assetParent-&amp;gt;loadByName(&#039;com_helloworld&#039;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		// Return the found asset-parent-id&lt;br /&gt;
		if ($assetParent-&amp;gt;id)&lt;br /&gt;
		{&lt;br /&gt;
			$assetParentId=$assetParent-&amp;gt;id;&lt;br /&gt;
		}&lt;br /&gt;
		return $assetParentId;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
This code for _getAssetParentId() above uses JTableAsset to retrieve the asset_id of the asset-parent. This is different from the code in the current version of com_content, where the asset_id of the category is retrieved from the #__categories database table. That is another possibility; many ways leading to Rome. In com_content however, if an item would not be under a category, then the asset_id of the global asset is returned. That would of course not be right, but is fixed there by providing a default category &amp;quot;uncategorised&amp;quot;, so that an article is &#039;&#039;always&#039;&#039; under a category. That is why you cannot just copy the code of _getAssetParentId() in com_content to your own component. The code above is more general.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Showing the setting of permissions on the item level === &amp;lt;!--T:69--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
Adding the rules field to the form-definition of the edit-form.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/forms/helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/models/forms/helloworld.xml&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;55-74&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;form&lt;br /&gt;
				addrulepath=&amp;quot;/administrator/components/com_helloworld/models/rules&amp;quot;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset&lt;br /&gt;
				name=&amp;quot;details&amp;quot;&lt;br /&gt;
				label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_DETAILS&amp;quot;&lt;br /&gt;
	&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 validate-greeting&amp;quot;&lt;br /&gt;
				validate=&amp;quot;greeting&amp;quot;&lt;br /&gt;
				required=&amp;quot;true&amp;quot;&lt;br /&gt;
				default=&amp;quot;&amp;quot;&lt;br /&gt;
				/&amp;gt;&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
				name=&amp;quot;catid&amp;quot;&lt;br /&gt;
				type=&amp;quot;category&amp;quot;&lt;br /&gt;
				extension=&amp;quot;com_helloworld&amp;quot;&lt;br /&gt;
				class=&amp;quot;inputbox&amp;quot;&lt;br /&gt;
				default=&amp;quot;&amp;quot;&lt;br /&gt;
				label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_CATID_LABEL&amp;quot;&lt;br /&gt;
				description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_CATID_DESC&amp;quot;&lt;br /&gt;
				required=&amp;quot;true&amp;quot;&lt;br /&gt;
		&amp;gt;&lt;br /&gt;
			&amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JOPTION_SELECT_CATEGORY&amp;lt;/option&amp;gt;&lt;br /&gt;
		&amp;lt;/field&amp;gt;&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset&lt;br /&gt;
				name=&amp;quot;params&amp;quot;&lt;br /&gt;
				label=&amp;quot;JGLOBAL_FIELDSET_DISPLAY_OPTIONS&amp;quot;&lt;br /&gt;
		&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;show_category&amp;quot;&lt;br /&gt;
					type=&amp;quot;list&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_SHOW_CATEGORY_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_SHOW_CATEGORY_DESC&amp;quot;&lt;br /&gt;
					default=&amp;quot;&amp;quot;&lt;br /&gt;
			&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&amp;quot;&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JHIDE&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JSHOW&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;fieldset&lt;br /&gt;
			name=&amp;quot;accesscontrol&amp;quot;&lt;br /&gt;
			label=&amp;quot;COM_HELLOWORLD_FIELDSET_RULES&amp;quot;&lt;br /&gt;
	&amp;gt;&lt;br /&gt;
    	&amp;lt;field&lt;br /&gt;
				name=&amp;quot;asset_id&amp;quot;&lt;br /&gt;
				type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
				filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
				/&amp;gt;&lt;br /&gt;
    	&amp;lt;field&lt;br /&gt;
				name=&amp;quot;rules&amp;quot;&lt;br /&gt;
				type=&amp;quot;rules&amp;quot;&lt;br /&gt;
				label=&amp;quot;COM_HELLOWORLD_FIELD_RULES_LABEL&amp;quot;&lt;br /&gt;
				filter=&amp;quot;rules&amp;quot;&lt;br /&gt;
				validate=&amp;quot;rules&amp;quot;&lt;br /&gt;
				class=&amp;quot;inputbox&amp;quot;&lt;br /&gt;
				component=&amp;quot;com_helloworld&amp;quot;&lt;br /&gt;
				section=&amp;quot;message&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;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
Now the ACL interface is displayed at the bottom of the Helloworld editform too (the &#039;&#039;edit.php&#039;&#039; file automatically get the fieldsets from the above xml).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Adding language strings === &amp;lt;!--T:72--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
We used 4 language strings that have to be added to the backend language-file.&amp;lt;/translate&amp;gt;&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;
&amp;lt;tt&amp;gt;admin/language/en-GB/en-GB.com_helloworld.ini&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot; highlight=&amp;quot;41-44&amp;quot;&amp;gt;&lt;br /&gt;
; Joomla! Project&lt;br /&gt;
; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.&lt;br /&gt;
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php&lt;br /&gt;
; Note : All ini files need to be saved as UTF-8&lt;br /&gt;
&lt;br /&gt;
COM_HELLOWORLD_ADMINISTRATION=&amp;quot;HelloWorld - Administration&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_ADMINISTRATION_CATEGORIES=&amp;quot;HelloWorld - Categories&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_NUM=&amp;quot;#&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLDS_FILTER=&amp;quot;Filters&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PUBLISHED=&amp;quot;Published&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLDS_NAME=&amp;quot;Name&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_ID=&amp;quot;Id&amp;quot;&lt;br /&gt;
&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_CREATING=&amp;quot;HelloWorld - Creating&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_DETAILS=&amp;quot;Details&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_EDITING=&amp;quot;HelloWorld - Editing&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_ERROR_UNACCEPTABLE=&amp;quot;Some values are unacceptable&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_CATID_DESC=&amp;quot;The category the messages belongs to&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_CATID_LABEL=&amp;quot;Category&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC=&amp;quot;This message will be displayed&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL=&amp;quot;Message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_SHOW_CATEGORY_LABEL=&amp;quot;Show category&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_FIELD_SHOW_CATEGORY_DESC=&amp;quot;If set to Show, the title of the message&amp;amp;rsquo;s category will show.&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_HEADING_GREETING=&amp;quot;Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_HEADING_ID=&amp;quot;Id&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MANAGER_HELLOWORLD_EDIT=&amp;quot;HelloWorld manager: Edit Message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MANAGER_HELLOWORLD_NEW=&amp;quot;HelloWorld manager: New Message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MANAGER_HELLOWORLDS=&amp;quot;HelloWorld manager&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_EDIT_HELLOWORLD=&amp;quot;Edit message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_N_ITEMS_DELETED_1=&amp;quot;One message deleted&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_N_ITEMS_DELETED_MORE=&amp;quot;%d messages deleted&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_N_ITEMS_PUBLISHED=&amp;quot;%d message(s) published&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_N_ITEMS_UNPUBLISHED=&amp;quot;%d message(s) unpublished&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_GREETING_LABEL=&amp;quot;Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_GREETING_DESC=&amp;quot;Add Hello World Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_SUBMENU_MESSAGES=&amp;quot;Messages&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_SUBMENU_CATEGORIES=&amp;quot;Categories&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_CONFIGURATION=&amp;quot;HelloWorld Configuration&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_CONFIG_GREETING_SETTINGS_LABEL=&amp;quot;Messages settings&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_CONFIG_GREETING_SETTINGS_DESC=&amp;quot;Settings that will be applied to all messages by default&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_FIELDSET_RULES=&amp;quot;Message Permissions&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_FIELD_RULES_LABEL=&amp;quot;Permissions&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_ACCESS_DELETE_DESC=&amp;quot;Is this group allowed to edit this message?&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_ACCESS_DELETE_DESC=&amp;quot;Is this group allowed to delete this message?&amp;quot;&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;translate&amp;gt;== Further reading == &amp;lt;!--T:74--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
More information on actions, assets and ACL can be found on the following pages:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
* General information and use: [[S:MyLanguage/Access Control List/1.6-2.5/Tutorial|Access Control List/1.6-2.5/Tutorial]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
* Technical information, under construction: [[S:MyLanguage/ACL Technique in Joomla!|ACL Technique in Joomla!]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
* [[S:MyLanguage/How to implement actions in your code|How to implement actions in your code]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* [[S:MyLanguage/Adding ACL rules to your component|Adding ACL rules to your component]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Deprecated classes == &amp;lt;!--T:80--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
For the moment we leave the &#039;&#039;&#039;deprecated JError&#039;&#039;&#039;-references as they are. They will probably still be available in Joomla! 3.x. We cannot just change them to JLog::add() statements because in Joomla! 2.5 the messages will then not be enqueued (as there is no messagequeue-logger added as is in /libraries/cms.php in Joomla! 3.0). Other solutions, like using $app-&amp;gt;enqueueMessage() or directly throwing PHP-exceptions as showstopper are also possible, but then there would still be numerous references to JError throughout the application. For instance in the view, we now check for errors raised in the model with: &amp;lt;span style=&amp;quot;color:#900&amp;quot;&amp;gt;count($errors = $this-&amp;gt;get(&#039;Errors&#039;))&amp;lt;/span&amp;gt;, which uses JError from the JOBject that was the base for JModel. To get the same functionality without using JError at all, we would have to change the way the Model raises those errors and warnings now. If we want to make an application that would work in Joomla! 2.5 and 3.x we can continue using JError. The moment we want to use our 3.x extensions also in 4.x we will have to change this (and probably a lot more too). This tutorial is now primarily focused on Joomla! 3.x. So: we notice the upcoming change, but leave it there for the moment.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
Since Joomla! 2.5.5 the MVC-base-classes JController, JModel and JView got proxies JControllerLegacy, JModelLegacy and JViewLegacy. You are recommended to use those proxies instead of the original classes to be forward compatibility with Joomla! CMS 3.x legacy classes.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Packaging the component == &amp;lt;!--T:83--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Content of your code directory&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Using_the_database#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/J3.x:Developing a MVC Component/Adding language management#site.2Flanguage.2Fen-GB.2Fen-GB.com_helloworld.ini|site/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Basic_backend#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_configuration#admin/config.xml|admin/config.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Basic_backend#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_categories#admin/access.xml|admin/access.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_categories#admin/helpers/helloworld.php|admin/helpers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/helpers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_categories#admin/sql/updates/mysql/0.0.12.sql|admin/sql/updates/mysql/0.0.12.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_configuration#admin/sql/updates/mysql/0.0.13.sql|admin/sql/updates/mysql/0.0.13.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_ACL#admin/sql/updates/mysql/0.0.14.sql|admin/sql/updates/mysql/0.0.14.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Basic_backend#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_backend_actions#admin/models/helloworlds.php|admin/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_verifications#admin/models/forms/helloworld.js|admin/models/forms/helloworld.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_backend_actions#admin/models/forms/helloworld.xml|admin/models/forms/helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_verifications#admin/models/rules/greeting.php|admin/models/rules/greeting.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/rules/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_backend_actions#admin/controllers/helloworld.php|admin/controllers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_backend_actions#admin/controllers/helloworlds.php|admin/controllers/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_backend_actions#admin/views/helloworld/view.html.php|admin/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_backend_actions#admin/views/helloworld/tmpl/edit.php|admin/views/helloworld/tmpl/edit.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Adding_verifications#admin/views/helloworld/submitbutton.js|admin/views/helloworld/submitbutton.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Using_the_database#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.x:Developing a MVC Component/Adding language management#admin.2Flanguage.2Fen-GB.2Fen-GB.com_helloworld.ini|admin/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.x:Developing a MVC Component/Adding language management#admin.2Flanguage.2Fen-GB.2Fen-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|media/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|media/images/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.x:Developing_a_MVC_Component/Adding_decorations_to_the_backend#Adding_some_icons|media/images/tux-16x16.png]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.x:Developing_a_MVC_Component/Adding_decorations_to_the_backend#Adding_some_icons|media/images/tux-48x48.png]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-14-adding-ACL.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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&amp;gt;&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;February 2015&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.14&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 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;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;languages folder=&amp;quot;site/language&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
        &amp;lt;/languages&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;media destination=&amp;quot;com_helloworld&amp;quot; folder=&amp;quot;media&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;images&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/media&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039; img=&amp;quot;../media/com_helloworld/images/tux-16x16.png&amp;quot;&amp;gt;COM_HELLOWORLD_MENU&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;config.xml&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;filename&amp;gt;access.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- views files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- controllers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- helpers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;helpers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
		&amp;lt;languages folder=&amp;quot;admin/language&amp;quot;&amp;gt;&lt;br /&gt;
        		&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;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;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;
&amp;lt;translate&amp;gt;== Contributors == &amp;lt;!--T:86--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
*[[User:Dwarkesh0204|Dwarkesh Soni]]&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User:florian_denizot|Florian Denizot]]&lt;br /&gt;
*[[User:HermanPeeren|Herman Peeren]]&lt;br /&gt;
* TDZweb (Ståle Rolf Sæbøe), Elin Waring, Neil via https://groups.google.com/forum/#!topic/joomla-dev-general/aCH3GNA91m4&lt;br /&gt;
*[[User:Scionescire|Scionescire]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&amp;lt;translate&amp;gt;&amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
S:MyLanguage/J3.x:Developing_a_MVC_Component/Adding configuration|Prev: Adding configuration&amp;lt;/translate&amp;gt;|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&amp;lt;translate&amp;gt;&amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
S:MyLanguage/J3.x:Developing_a_MVC_Component/Adding an install-uninstall-update script file|Next: Adding an install-uninstall-update script file&amp;lt;/translate&amp;gt;|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
[[Category:Joomla! 3.x]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Basic_backend&amp;diff=202903</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=202903"/>
		<updated>2015-07-09T18:26:47Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: getCmd() is deprecated use get() instead. Also we only need the J 3.x category rather than every J3 version&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;
{{:J3.1:Developing a MVC Component/&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;translate&amp;gt;== Introduction == &amp;lt;!--T:2--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
This tutorial is part of the [[S:MyLanguage/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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Basic backend == &amp;lt;!--T:4--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&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 &amp;lt;tt&amp;gt;admin/helloworld.php&amp;lt;/tt&amp;gt; file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&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;
// 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;
$controller-&amp;gt;execute(JFactory::getApplication()-&amp;gt;input-&amp;gt;get(&#039;task&#039;));&lt;br /&gt;
&lt;br /&gt;
// Redirect if set by the controller&lt;br /&gt;
$controller-&amp;gt;redirect();&lt;br /&gt;
&lt;br /&gt;
&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;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&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;
/**&lt;br /&gt;
 * General Controller of HelloWorld component&lt;br /&gt;
 *&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 * @since       0.0.7&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldController extends JControllerLegacy&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The default view for the display method.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var string&lt;br /&gt;
	 * @since 12.2&lt;br /&gt;
	 */&lt;br /&gt;
	protected $default_view = &#039;helloworlds&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
This controller will display the &#039;HelloWorlds&#039; view by default.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Create the view == &amp;lt;!--T:7--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
With your favorite file manager and editor, create a file &amp;lt;tt&amp;gt;admin/views/helloworlds/view.html.php&amp;lt;/tt&amp;gt; containing:&amp;lt;/translate&amp;gt;&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;
&amp;lt;tt&amp;gt;admin/views/helloworlds/view.html.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&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;
/**&lt;br /&gt;
 * HelloWorlds View&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorlds extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Display the Hello World view&lt;br /&gt;
	 *&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  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;
		$this-&amp;gt;items		= $this-&amp;gt;get(&#039;Items&#039;);&lt;br /&gt;
		$this-&amp;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;
&lt;br /&gt;
			return false;&lt;br /&gt;
		}&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
In Joomla, views display data using layout. With your favorite file manager and editor, put a file &amp;lt;tt&amp;gt;admin/views/helloworlds/tmpl/default.php&amp;lt;/tt&amp;gt; containing&amp;lt;/translate&amp;gt;&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;
&amp;lt;tt&amp;gt;admin/views/helloworlds/tmpl/default.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&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;form action=&amp;quot;index.php?option=com_helloworld&amp;amp;view=helloworlds&amp;quot; method=&amp;quot;post&amp;quot; id=&amp;quot;adminForm&amp;quot; name=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;table class=&amp;quot;table table-striped table-hover&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;thead&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;th width=&amp;quot;1%&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_NUM&#039;); ?&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
			&amp;lt;th width=&amp;quot;2%&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 width=&amp;quot;90%&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_HELLOWORLDS_NAME&#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_PUBLISHED&#039;); ?&amp;gt;&lt;br /&gt;
			&amp;lt;/th&amp;gt;&lt;br /&gt;
			&amp;lt;th width=&amp;quot;2%&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_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;/thead&amp;gt;&lt;br /&gt;
		&amp;lt;tfoot&amp;gt;&lt;br /&gt;
			&amp;lt;tr&amp;gt;&lt;br /&gt;
				&amp;lt;td colspan=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;?php echo $this-&amp;gt;pagination-&amp;gt;getListFooter(); ?&amp;gt;&lt;br /&gt;
				&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;/tr&amp;gt;&lt;br /&gt;
		&amp;lt;/tfoot&amp;gt;&lt;br /&gt;
		&amp;lt;tbody&amp;gt;&lt;br /&gt;
			&amp;lt;?php if (!empty($this-&amp;gt;items)) : ?&amp;gt;&lt;br /&gt;
				&amp;lt;?php foreach ($this-&amp;gt;items as $i =&amp;gt; $row) : ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
					&amp;lt;tr&amp;gt;&lt;br /&gt;
						&amp;lt;td&amp;gt;&lt;br /&gt;
							&amp;lt;?php echo $this-&amp;gt;pagination-&amp;gt;getRowOffset($i); ?&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, $row-&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 $row-&amp;gt;greeting; ?&amp;gt;&lt;br /&gt;
						&amp;lt;/td&amp;gt;&lt;br /&gt;
						&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;?php echo JHtml::_(&#039;jgrid.published&#039;, $row-&amp;gt;published, $i, &#039;helloworlds.&#039;, true, &#039;cb&#039;); ?&amp;gt;&lt;br /&gt;
						&amp;lt;/td&amp;gt;&lt;br /&gt;
						&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;?php echo $row-&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;?php endif; ?&amp;gt;&lt;br /&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;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&#039;&#039;COM_HELLOWORLD_HELLOWORLDS_NAME&#039;&#039;, &#039;&#039;COM_HELLOWORLD_ID&#039;&#039; and the others are placeholders which will later be replaced with language-specific text. The [http://api.joomla.org/cms-3/classes/JText.html JText::_] method translates a string into the current language.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;checkAll&amp;lt;/tt&amp;gt; is a javascript function defined in the Joomla core able to check all items.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;JHtml::_&amp;lt;/tt&amp;gt; is a helper function able to display several HTML output. In this case, it will display a checkbox for the item.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;JPagination&amp;lt;/tt&amp;gt; is a Joomla class able to manage and display pagination object.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Create the model == &amp;lt;!--T:14--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt;&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:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
* &#039;&#039;getListQuery&#039;&#039; which constructs an SQL query&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
and two states:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;list.start&amp;lt;/tt&amp;gt; for determining the list offset&lt;br /&gt;
* &amp;lt;tt&amp;gt;list.limit&amp;lt;/tt&amp;gt; for determining the list length&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;getItems&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;getPagination&amp;lt;/tt&amp;gt; methods are defined in JModelList class. They don&#039;t need to be defined in the &amp;lt;tt&amp;gt;HelloWorldModelHelloWorlds&amp;lt;/tt&amp;gt; class.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/helloworlds.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/models/helloworlds.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&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;
/**&lt;br /&gt;
 * HelloWorldList Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&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;
		// Initialize variables.&lt;br /&gt;
		$db    = JFactory::getDbo();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
&lt;br /&gt;
		// Create the base select statement.&lt;br /&gt;
		$query-&amp;gt;select(&#039;*&#039;)&lt;br /&gt;
                -&amp;gt;from($db-&amp;gt;quoteName(&#039;#__helloworld&#039;));&lt;br /&gt;
&lt;br /&gt;
		return $query;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
The &amp;lt;tt&amp;gt;_populateState&amp;lt;/tt&amp;gt; method is, by default, automatically called when a state is read by the &amp;lt;tt&amp;gt;getState&amp;lt;/tt&amp;gt; method.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Packaging the component == &amp;lt;!--T:21--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
Content of your code directory&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Using_the_database#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;[[S:MyLanguage/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;[[S:MyLanguage/J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/scionescire/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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,56,63-64&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.7&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 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;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 link=&#039;index.php?option=com_helloworld&#039;&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;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;/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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{notice|&amp;lt;translate&amp;gt;&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
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.&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:Gunjanpatel|Gunjan Patel]]&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User:presto|Preston Smith]]&lt;br /&gt;
*[[User:scionescire|Scionescire]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
S:MyLanguage/J3.x:Developing_a_MVC_Component/Using the database|Prev: Using the database&amp;lt;/translate&amp;gt;|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
S:MyLanguage/J3.x:Developing_a_MVC_Component/Adding language management|Next: Adding language management&amp;lt;/translate&amp;gt;|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
[[Category:Joomla! 3.x]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Getting_Started_with_Object_Oriented_Programming&amp;diff=202150</id>
		<title>Getting Started with Object Oriented Programming</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Getting_Started_with_Object_Oriented_Programming&amp;diff=202150"/>
		<updated>2015-07-07T22:40:41Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Add scope modifiers to functions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PHP is an object oriented language, and to use the MVC structure as implemented by Joomla!, a solid understanding of object oriented programming &#039;&#039;(OOP)&#039;&#039; is required. This document explains the reasons for using objects and the way objects are used in PHP and Joomla.&lt;br /&gt;
&lt;br /&gt;
== Introduction to Objects ==&lt;br /&gt;
&lt;br /&gt;
As we venture into object oriented programming, it is important to note that it is called &#039;object&#039; oriented for a reason. &lt;br /&gt;
&lt;br /&gt;
Before object oriented programming (OOP), everything was based on &#039;&#039;functions&#039;&#039; and &#039;&#039;variables&#039;&#039;. Let&#039;s consider an application that calculates a person&#039;s BMI. You might have three variables: &amp;lt;code&amp;gt;$height&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$weight&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$name&amp;lt;/code&amp;gt;. These variables would be used to store a person&#039;s name, height and weight. You might then have a function called &amp;lt;code&amp;gt;calculateBMI()&amp;lt;/code&amp;gt;, which would accept as parameters $height and $weight.  &lt;br /&gt;
&lt;br /&gt;
This would look something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
public function calculateBMI( $height, $weight ) {&lt;br /&gt;
    return $weight / $height;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But it is very easy to lose track of all these variables in the code, not to mention the fact that only one person is supported at a time. The idea behind objects is to &#039;&#039;&#039;encapsulate&#039;&#039;&#039; this data &#039;&#039;&#039;and&#039;&#039;&#039; the functions to manipulate it into one &#039;&#039;package&#039;&#039;. The definition of this package is called a &#039;&#039;class&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
So we might have:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class person&lt;br /&gt;
{&lt;br /&gt;
    public $name;&lt;br /&gt;
    public $height;&lt;br /&gt;
    public $weight;&lt;br /&gt;
&lt;br /&gt;
    public function getBMI() {&lt;br /&gt;
        return $this-&amp;gt;weight / $this-&amp;gt;height;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, if you want to create an object which represents a person, you would do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$person = new person();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is called &#039;&#039;instantiating&#039;&#039; the class, because it creates an &#039;&#039;instance&#039;&#039; of the class (an object described by the class).&lt;br /&gt;
&lt;br /&gt;
Now, you can modify the variables (which are called &#039;&#039;properties&#039;&#039;), using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$person-&amp;gt;height = 2;&lt;br /&gt;
$person-&amp;gt;weight = 50;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can invoke its functions (which are called &#039;&#039;methods&#039;&#039;) using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$bmi = $person-&amp;gt;getBMI();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Often, many classes are similar, but too different to put into one class. For example, all animals have lungs, and because humans and cats are animals, they could both have a &amp;lt;code&amp;gt;$lung_capacity&amp;lt;/code&amp;gt;. However, cats have tails, so should an &amp;lt;code&amp;gt;Animal&amp;lt;/code&amp;gt; class have a &amp;lt;code&amp;gt;$tail_length&amp;lt;/code&amp;gt;? No, that is not necessary. You can make a class a &#039;&#039;subclass&#039;&#039; or &#039;&#039;child class&#039;&#039; of another, essentially stating that the subclass has everything its parent class has, plus some extensions.&lt;br /&gt;
&lt;br /&gt;
In Joomla, most classes are children of JObject. Now, if we were to make person a child class of JObject, then we would &#039;&#039;inherit&#039;&#039; the capabilities of the JObject class. We would then change the definition to something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class person extends JObject&lt;br /&gt;
{&lt;br /&gt;
    public $name;&lt;br /&gt;
    public $height;&lt;br /&gt;
    public $weight;&lt;br /&gt;
&lt;br /&gt;
    public function getBMI() {&lt;br /&gt;
        return $this-&amp;gt;weight / $this-&amp;gt;height;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we could &#039;&#039;manipulate&#039;&#039; our person using the &amp;lt;code&amp;gt;get()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;set()&amp;lt;/code&amp;gt; methods that JObject has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$person-&amp;gt;set( &#039;name&#039;, &#039;Bob&#039; );&lt;br /&gt;
$person-&amp;gt;set( &#039;height&#039;, 2 );&lt;br /&gt;
$person-&amp;gt;set( &#039;weight&#039;, 50 );&lt;br /&gt;
$person-&amp;gt;get( &#039;weight&#039; );&lt;br /&gt;
echo $person-&amp;gt;getBMI();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will notice the use of &amp;lt;code&amp;gt;$this&amp;lt;/code&amp;gt; inside classes a lot. &amp;lt;code&amp;gt;$this&amp;lt;/code&amp;gt; is a reference to the &#039;&#039;&#039;current&#039;&#039;&#039; object. So if I am inside a class, and I use say &amp;lt;code&amp;gt;$this-&amp;gt;height = 2;&amp;lt;/code&amp;gt;, then that means I am setting the property &#039;height&#039; of the current object to 2. When we use &amp;lt;code&amp;gt;$this-&amp;gt;height&amp;lt;/code&amp;gt;, we aren&#039;t talking about any height, but we&#039;re talking about the current object height.&lt;br /&gt;
&lt;br /&gt;
== More on Objects ==&lt;br /&gt;
&lt;br /&gt;
As I said, Objects are called Objects for a reason.  If you have a real life object, say a photocopier, there is an external interface (say, a paper tray, the copier glass, the keypad, etc.).  Objects in OOP are designed to approximate that setup.&lt;br /&gt;
&lt;br /&gt;
So, I might have a class called copier. Now, what operations do I generally need to do with a copier? Well, the basic functionality I need is copy functionality. So I need a method called &#039;copy&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class Copier&lt;br /&gt;
{&lt;br /&gt;
    public function copy() {&lt;br /&gt;
        echo &#039;One copy made&#039;;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, this is a very basic copier. What if I wanted to extend the functionality of my Copier? Well, to extend the functionality, I create a child class. &#039;&#039;A child class will inherit all the functionality of the parent class.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s suppose we wanted to create a copier that would keep track of the number of copies it had made. So, we would need to add a property which would keep track of this number, and then we need to somehow adjust this number each time we make a copy.&lt;br /&gt;
&lt;br /&gt;
So here is our child class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class CopierWithCounter extends Copier&lt;br /&gt;
{&lt;br /&gt;
    public $counter;&lt;br /&gt;
&lt;br /&gt;
    public function copy() {&lt;br /&gt;
        $this-&amp;gt;counter++;&lt;br /&gt;
        parent::copy();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So we now have a property called &amp;lt;code&amp;gt;$counter&amp;lt;/code&amp;gt; that keeps track of the number of copies made. Notice that the method we defined has the same name as the method in the Copier class. What this means is that we don&#039;t need to learn anything new to use the copier - it behaves in the same way as our old copier, but it just keep track of the number of copies.&lt;br /&gt;
&lt;br /&gt;
You will see that inside of the &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method there is a line: &#039;&#039;&amp;lt;code&amp;gt;parent::copy()&amp;lt;/code&amp;gt;&#039;&#039;. The &amp;lt;code&amp;gt;parent&amp;lt;/code&amp;gt; keyword references the parent class, which is in this case Copier.  So this line will invoke the &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method of the Copier class. In this way, we don&#039;t have to rewrite the functionality to make a copy - we have already done that in the Copier class.&lt;br /&gt;
&lt;br /&gt;
So we have the exact same functionality as the Copier class, except that anytime a copy is made it will increment the $copies property by 1. Just as in real life, the addition of the counter doesn&#039;t change the way that I use the copier - I don&#039;t need to know anything about the counter to just make a simple copy.&lt;br /&gt;
&lt;br /&gt;
Now, the question arises: what value does &amp;lt;code&amp;gt;$counter&amp;lt;/code&amp;gt; have to start with? We know that it increases by one every time a copy is made, but that is all we know.&lt;br /&gt;
&lt;br /&gt;
This value needs to be &#039;&#039;initialized&#039;&#039; to a certain value.&lt;br /&gt;
&lt;br /&gt;
Initializing values is generally done by what is called a &#039;&#039;constructor&#039;&#039;. A constructor does just that - it constructs the object. In PHP5, constructors are functions with the name &amp;lt;code&amp;gt;__construct&amp;lt;/code&amp;gt;. We will use &amp;lt;code&amp;gt;__construct&amp;lt;/code&amp;gt; here.&lt;br /&gt;
&lt;br /&gt;
So our class now becomes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class CopierWithCounter extends Copier&lt;br /&gt;
{&lt;br /&gt;
    public $counter;&lt;br /&gt;
&lt;br /&gt;
    public function __construct() {&lt;br /&gt;
        $this-&amp;gt;counter = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public function copy() {&lt;br /&gt;
        $this-&amp;gt;counter++;&lt;br /&gt;
        parent::copy();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now suppose we wanted to create an even more advanced copier. We can do that by creating another child class. Let&#039;s create a copier that is able to do multiple copies. In order to do this, we need a way to specify how many copies we want and a way to remember this number. We will add a method called &#039;setCopies()&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class CopierMultipleCopies extends CopierWithCounter&lt;br /&gt;
{&lt;br /&gt;
    public $copies;&lt;br /&gt;
&lt;br /&gt;
    public function setCopies( $copies ) {&lt;br /&gt;
        $this-&amp;gt;copies = $copies;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
We now have a way to specify how many copies we want to make.&lt;br /&gt;
&lt;br /&gt;
Now, it is appropriate here to say a word about &#039;&#039;scope&#039;&#039;. When we talk about scope, we talk about where a certain variable can be seen. You will notice that in our class, we have a property called &amp;lt;code&amp;gt;$copies&amp;lt;/code&amp;gt;. But we also have a parameter called &amp;lt;code&amp;gt;$copies&amp;lt;/code&amp;gt; in our method &amp;lt;code&amp;gt;setCopies&amp;lt;/code&amp;gt;. How do you tell them apart?&lt;br /&gt;
&lt;br /&gt;
Well, the rules of scope tell us which variable we are talking about. If a method takes a parameter, say &amp;lt;code&amp;gt;$copies&amp;lt;/code&amp;gt; (as above), then if I use &amp;lt;code&amp;gt;$copies&amp;lt;/code&amp;gt; inside that method, I am referring to that parameter. There may be other variables called &amp;lt;code&amp;gt;$copies&amp;lt;/code&amp;gt; that are defined in other places, but I don&#039;t care about those - I only care about the one inside of my function. If I want to refer to a property of the current object, I use the &amp;lt;code&amp;gt;$this&amp;lt;/code&amp;gt; keyword. So, if I use &amp;lt;code&amp;gt;$this-&amp;gt;copies&amp;lt;/code&amp;gt;, then I am talking about the &amp;lt;code&amp;gt;$copies&amp;lt;/code&amp;gt; property that belongs to my current object.&lt;br /&gt;
&lt;br /&gt;
So that aside, our &amp;lt;code&amp;gt;setCopies()&amp;lt;/code&amp;gt; method will allow us to set the number of copies that we want to make using our copier. The method takes one parameter - &amp;lt;code&amp;gt;$copies&amp;lt;/code&amp;gt;, and stores it in the object.&lt;br /&gt;
&lt;br /&gt;
You will notice that our current class definition for CopierMultipleCopies doesn&#039;t define a &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method or a constructor. But, because it extends CopierWithCounter, it inherits the &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method from CopierWithCounter, and also inherits the properties. So, without doing any extra work, we already have a Copier with a counter.&lt;br /&gt;
&lt;br /&gt;
But we still want to extend the functionality of the &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method so that it actually makes the multiple copies. So, we add a method definition to our class. We will also add a constructor that will add the functionality of initializing the number of copies to 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class CopierMultipleCopies extends CopierWithCounter&lt;br /&gt;
{&lt;br /&gt;
    public $copies;&lt;br /&gt;
&lt;br /&gt;
    public function __construct() {&lt;br /&gt;
        $this-&amp;gt;copies = 1;&lt;br /&gt;
        parent::__construct();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public function setCopies( $copies ) {&lt;br /&gt;
        $this-&amp;gt;copies = $copies;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public function copy() {&lt;br /&gt;
        for ($i = 0; $i &amp;lt; $this-&amp;gt;copies; $i++) {&lt;br /&gt;
            parent::copy();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what have we done here? Well, first, in our constructor we initialized the $copies variable to 1. Thus, if we don&#039;t tell our copier otherwise, it will make one copy when the &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method is invoked. Note that we don&#039;t have to rewrite the code to initialize the counter - we just call &amp;lt;code&amp;gt;parent::__construct()&amp;lt;/code&amp;gt; and our parent constructor will handle that.&lt;br /&gt;
&lt;br /&gt;
Then, we &#039;&#039;overrode&#039;&#039; the &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method. Inside of our &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method we have what is called a &#039;&#039;[[http://en.wikipedia.org/wiki/For_loop|for loop]]&#039;&#039;.  &lt;br /&gt;
&lt;br /&gt;
In the first line of the for loop, you will see three parts divided by semicolons.  &lt;br /&gt;
&lt;br /&gt;
The first part is the  &#039;&#039;initialization&#039;&#039;. We will use $i as a counter variable, and we will start it at 0. $i will essentially keep track of the number of copies we have made out of the total number that we have to do.  &lt;br /&gt;
&lt;br /&gt;
The second part is the &#039;&#039;condition&#039;&#039;. At the beginning of each run of the for loop, this condition is checked to determine if it is true or not. If the condition is true, we execute the stuff inside of the braces. If it is not, then we are done the loop.  &lt;br /&gt;
&lt;br /&gt;
The last part is the &#039;&#039;incrementor&#039;&#039;. This is code that gets executed after every pass through the loop.  &lt;br /&gt;
&lt;br /&gt;
So it will run something like:&lt;br /&gt;
* take our variable i and set it to 0.&lt;br /&gt;
* Check if our variable i is less than the number of copies that we have to make&lt;br /&gt;
* if it is, then we will make a copy&lt;br /&gt;
* we will increment i by 1 and go back to step 2&lt;br /&gt;
&lt;br /&gt;
You can have much more complex for loops than this, but this is the basic idea.&lt;br /&gt;
&lt;br /&gt;
So that is our copier. Now to use our copier, we can add something like this to our code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$copier = new CopierMultipleCopies();&lt;br /&gt;
$copier-&amp;gt;copy();&lt;br /&gt;
$copier-&amp;gt;copy();&lt;br /&gt;
$copier-&amp;gt;setCopies( 10 );&lt;br /&gt;
$copier-&amp;gt;copy();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So notice a couple of things:&lt;br /&gt;
&lt;br /&gt;
First, as we made our copier more and more complex, we didn&#039;t have to duplicate code. That is, in our most complex copier, we didn&#039;t have to worry about creating code to make the actual copy. We just used the method that came with our original copier. Also, in our final copier we didn&#039;t have to re-implement the counter - we again just used the method that had already been defined to do this.&lt;br /&gt;
&lt;br /&gt;
Second, our new copier can serve as a drop in replacement for our old copier. Yes, each copier was more advanced than the previous one, but it was still possible with the most advanced one to just create it and invoke the copy() method, and it would create a copy.  &lt;br /&gt;
&lt;br /&gt;
If I want to use the more advanced functionality, such as reading the counter or changing the number of copies to be made, I need to know about these features, but I can still ignorantly use the copier as if it was the original Copier. (i.e. the original Copier class had a certain interface that was standard.)  &lt;br /&gt;
&lt;br /&gt;
The advanced copiers added more features, but this was separate from the original interface. (just as a car with cruise control has the same basic interface as a car without cruise control, but to take advantage of the cruise control you need to know how to set it).  &lt;br /&gt;
&lt;br /&gt;
Object Oriented Programming is an important part of the design of Joomla!.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;**ianmac** put together this OOPs overview for the community; [http://forum.joomla.org/index.php/topic,200185.msg943596.html#msg943596 Post #1] and [http://forum.joomla.org/index.php/topic,200694.msg944114.html#msg944114 Post #2]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
[http://us3.php.net/manual/en/oop5.intro.php Introduction to PHP 5 OOP] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Development Recommended Reading]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Selecting_data_using_JDatabase&amp;diff=202149</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=202149"/>
		<updated>2015-07-07T20:46:13Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Add some more catagories&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;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Database]]&lt;br /&gt;
[[Category:JFactory]]&lt;br /&gt;
[[Category:Extension development]]&lt;br /&gt;
[[Category:Development Recommended Reading]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Getting_Started_with_Object_Oriented_Programming&amp;diff=202130</id>
		<title>Getting Started with Object Oriented Programming</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Getting_Started_with_Object_Oriented_Programming&amp;diff=202130"/>
		<updated>2015-07-07T18:42:56Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Add link to PHP5 OOP&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PHP is an object oriented language, and to use the MVC structure as implemented by Joomla!, a solid understanding of object oriented programming &#039;&#039;(OOP)&#039;&#039; is required. This document explains the reasons for using objects and the way objects are used in PHP and Joomla.&lt;br /&gt;
&lt;br /&gt;
== Introduction to Objects ==&lt;br /&gt;
&lt;br /&gt;
As we venture into object oriented programming, it is important to note that it is called &#039;object&#039; oriented for a reason. &lt;br /&gt;
&lt;br /&gt;
Before object oriented programming (OOP), everything was based on &#039;&#039;functions&#039;&#039; and &#039;&#039;variables&#039;&#039;. Let&#039;s consider an application that calculates a person&#039;s BMI. You might have three variables: &amp;lt;code&amp;gt;$height&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$weight&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$name&amp;lt;/code&amp;gt;. These variables would be used to store a person&#039;s name, height and weight. You might then have a function called &amp;lt;code&amp;gt;calculateBMI()&amp;lt;/code&amp;gt;, which would accept as parameters $height and $weight.  &lt;br /&gt;
&lt;br /&gt;
This would look something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function calculateBMI( $height, $weight ) {&lt;br /&gt;
    return $weight / $height;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But it is very easy to lose track of all these variables in the code, not to mention the fact that only one person is supported at a time. The idea behind objects is to &#039;&#039;&#039;encapsulate&#039;&#039;&#039; this data &#039;&#039;&#039;and&#039;&#039;&#039; the functions to manipulate it into one &#039;&#039;package&#039;&#039;. The definition of this package is called a &#039;&#039;class&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
So we might have:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class person&lt;br /&gt;
{&lt;br /&gt;
    public $name;&lt;br /&gt;
    public $height;&lt;br /&gt;
    public $weight;&lt;br /&gt;
&lt;br /&gt;
    function getBMI() {&lt;br /&gt;
        return $this-&amp;gt;weight / $this-&amp;gt;height;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, if you want to create an object which represents a person, you would do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$person = new person();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is called &#039;&#039;instantiating&#039;&#039; the class, because it creates an &#039;&#039;instance&#039;&#039; of the class (an object described by the class).&lt;br /&gt;
&lt;br /&gt;
Now, you can modify the variables (which are called &#039;&#039;properties&#039;&#039;), using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$person-&amp;gt;height = 2;&lt;br /&gt;
$person-&amp;gt;weight = 50;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can invoke its functions (which are called &#039;&#039;methods&#039;&#039;) using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$bmi = $person-&amp;gt;getBMI();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Often, many classes are similar, but too different to put into one class. For example, all animals have lungs, and because humans and cats are animals, they could both have a &amp;lt;code&amp;gt;$lung_capacity&amp;lt;/code&amp;gt;. However, cats have tails, so should an &amp;lt;code&amp;gt;Animal&amp;lt;/code&amp;gt; class have a &amp;lt;code&amp;gt;$tail_length&amp;lt;/code&amp;gt;? No, that is not necessary. You can make a class a &#039;&#039;subclass&#039;&#039; or &#039;&#039;child class&#039;&#039; of another, essentially stating that the subclass has everything its parent class has, plus some extensions.&lt;br /&gt;
&lt;br /&gt;
In Joomla, most classes are children of JObject. Now, if we were to make person a child class of JObject, then we would &#039;&#039;inherit&#039;&#039; the capabilities of the JObject class. We would then change the definition to something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class person extends JObject&lt;br /&gt;
{&lt;br /&gt;
    public $name;&lt;br /&gt;
    public $height;&lt;br /&gt;
    public $weight;&lt;br /&gt;
&lt;br /&gt;
    function getBMI() {&lt;br /&gt;
        return $this-&amp;gt;weight / $this-&amp;gt;height;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we could &#039;&#039;manipulate&#039;&#039; our person using the &amp;lt;code&amp;gt;get()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;set()&amp;lt;/code&amp;gt; methods that JObject has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$person-&amp;gt;set( &#039;name&#039;, &#039;Bob&#039; );&lt;br /&gt;
$person-&amp;gt;set( &#039;height&#039;, 2 );&lt;br /&gt;
$person-&amp;gt;set( &#039;weight&#039;, 50 );&lt;br /&gt;
$person-&amp;gt;get( &#039;weight&#039; );&lt;br /&gt;
echo $person-&amp;gt;getBMI();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will notice the use of &amp;lt;code&amp;gt;$this&amp;lt;/code&amp;gt; inside classes a lot. &amp;lt;code&amp;gt;$this&amp;lt;/code&amp;gt; is a reference to the &#039;&#039;&#039;current&#039;&#039;&#039; object. So if I am inside a class, and I use say &amp;lt;code&amp;gt;$this-&amp;gt;height = 2;&amp;lt;/code&amp;gt;, then that means I am setting the property &#039;height&#039; of the current object to 2. When we use &amp;lt;code&amp;gt;$this-&amp;gt;height&amp;lt;/code&amp;gt;, we aren&#039;t talking about any height, but we&#039;re talking about the current object height.&lt;br /&gt;
&lt;br /&gt;
== More on Objects ==&lt;br /&gt;
&lt;br /&gt;
As I said, Objects are called Objects for a reason.  If you have a real life object, say a photocopier, there is an external interface (say, a paper tray, the copier glass, the keypad, etc.).  Objects in OOP are designed to approximate that setup.&lt;br /&gt;
&lt;br /&gt;
So, I might have a class called copier. Now, what operations do I generally need to do with a copier? Well, the basic functionality I need is copy functionality. So I need a method called &#039;copy&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class Copier&lt;br /&gt;
{&lt;br /&gt;
    function copy() {&lt;br /&gt;
        echo &#039;One copy made&#039;;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, this is a very basic copier. What if I wanted to extend the functionality of my Copier? Well, to extend the functionality, I create a child class. &#039;&#039;A child class will inherit all the functionality of the parent class.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s suppose we wanted to create a copier that would keep track of the number of copies it had made. So, we would need to add a property which would keep track of this number, and then we need to somehow adjust this number each time we make a copy.&lt;br /&gt;
&lt;br /&gt;
So here is our child class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class CopierWithCounter extends Copier&lt;br /&gt;
{&lt;br /&gt;
    public $counter;&lt;br /&gt;
&lt;br /&gt;
    function copy() {&lt;br /&gt;
        $this-&amp;gt;counter++;&lt;br /&gt;
        parent::copy();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So we now have a property called &amp;lt;code&amp;gt;$counter&amp;lt;/code&amp;gt; that keeps track of the number of copies made. Notice that the method we defined has the same name as the method in the Copier class. What this means is that we don&#039;t need to learn anything new to use the copier - it behaves in the same way as our old copier, but it just keep track of the number of copies.&lt;br /&gt;
&lt;br /&gt;
You will see that inside of the &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method there is a line: &#039;&#039;&amp;lt;code&amp;gt;parent::copy()&amp;lt;/code&amp;gt;&#039;&#039;. The &amp;lt;code&amp;gt;parent&amp;lt;/code&amp;gt; keyword references the parent class, which is in this case Copier.  So this line will invoke the &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method of the Copier class. In this way, we don&#039;t have to rewrite the functionality to make a copy - we have already done that in the Copier class.&lt;br /&gt;
&lt;br /&gt;
So we have the exact same functionality as the Copier class, except that anytime a copy is made it will increment the $copies property by 1. Just as in real life, the addition of the counter doesn&#039;t change the way that I use the copier - I don&#039;t need to know anything about the counter to just make a simple copy.&lt;br /&gt;
&lt;br /&gt;
Now, the question arises: what value does &amp;lt;code&amp;gt;$counter&amp;lt;/code&amp;gt; have to start with? We know that it increases by one every time a copy is made, but that is all we know.&lt;br /&gt;
&lt;br /&gt;
This value needs to be &#039;&#039;initialized&#039;&#039; to a certain value.&lt;br /&gt;
&lt;br /&gt;
Initializing values is generally done by what is called a &#039;&#039;constructor&#039;&#039;. A constructor does just that - it constructs the object. In PHP5, constructors are functions with the name &amp;lt;code&amp;gt;__construct&amp;lt;/code&amp;gt;. We will use &amp;lt;code&amp;gt;__construct&amp;lt;/code&amp;gt; here.&lt;br /&gt;
&lt;br /&gt;
So our class now becomes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class CopierWithCounter extends Copier&lt;br /&gt;
{&lt;br /&gt;
    public $counter;&lt;br /&gt;
&lt;br /&gt;
    function __construct() {&lt;br /&gt;
        $this-&amp;gt;counter = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function copy() {&lt;br /&gt;
        $this-&amp;gt;counter++;&lt;br /&gt;
        parent::copy();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now suppose we wanted to create an even more advanced copier. We can do that by creating another child class. Let&#039;s create a copier that is able to do multiple copies. In order to do this, we need a way to specify how many copies we want and a way to remember this number. We will add a method called &#039;setCopies()&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class CopierMultipleCopies extends CopierWithCounter&lt;br /&gt;
{&lt;br /&gt;
    public $copies;&lt;br /&gt;
&lt;br /&gt;
    function setCopies( $copies ) {&lt;br /&gt;
        $this-&amp;gt;copies = $copies;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
We now have a way to specify how many copies we want to make.&lt;br /&gt;
&lt;br /&gt;
Now, it is appropriate here to say a word about &#039;&#039;scope&#039;&#039;. When we talk about scope, we talk about where a certain variable can be seen. You will notice that in our class, we have a property called &amp;lt;code&amp;gt;$copies&amp;lt;/code&amp;gt;. But we also have a parameter called &amp;lt;code&amp;gt;$copies&amp;lt;/code&amp;gt; in our method &amp;lt;code&amp;gt;setCopies&amp;lt;/code&amp;gt;. How do you tell them apart?&lt;br /&gt;
&lt;br /&gt;
Well, the rules of scope tell us which variable we are talking about. If a method takes a parameter, say &amp;lt;code&amp;gt;$copies&amp;lt;/code&amp;gt; (as above), then if I use &amp;lt;code&amp;gt;$copies&amp;lt;/code&amp;gt; inside that method, I am referring to that parameter. There may be other variables called &amp;lt;code&amp;gt;$copies&amp;lt;/code&amp;gt; that are defined in other places, but I don&#039;t care about those - I only care about the one inside of my function. If I want to refer to a property of the current object, I use the &amp;lt;code&amp;gt;$this&amp;lt;/code&amp;gt; keyword. So, if I use &amp;lt;code&amp;gt;$this-&amp;gt;copies&amp;lt;/code&amp;gt;, then I am talking about the &amp;lt;code&amp;gt;$copies&amp;lt;/code&amp;gt; property that belongs to my current object.&lt;br /&gt;
&lt;br /&gt;
So that aside, our &amp;lt;code&amp;gt;setCopies()&amp;lt;/code&amp;gt; method will allow us to set the number of copies that we want to make using our copier. The method takes one parameter - &amp;lt;code&amp;gt;$copies&amp;lt;/code&amp;gt;, and stores it in the object.&lt;br /&gt;
&lt;br /&gt;
You will notice that our current class definition for CopierMultipleCopies doesn&#039;t define a &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method or a constructor. But, because it extends CopierWithCounter, it inherits the &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method from CopierWithCounter, and also inherits the properties. So, without doing any extra work, we already have a Copier with a counter.&lt;br /&gt;
&lt;br /&gt;
But we still want to extend the functionality of the &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method so that it actually makes the multiple copies. So, we add a method definition to our class. We will also add a constructor that will add the functionality of initializing the number of copies to 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class CopierMultipleCopies extends CopierWithCounter&lt;br /&gt;
{&lt;br /&gt;
    public $copies;&lt;br /&gt;
&lt;br /&gt;
    function __construct() {&lt;br /&gt;
        $this-&amp;gt;copies = 1;&lt;br /&gt;
        parent::__construct();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function setCopies( $copies ) {&lt;br /&gt;
        $this-&amp;gt;copies = $copies;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function copy() {&lt;br /&gt;
        for ($i = 0; $i &amp;lt; $this-&amp;gt;copies; $i++) {&lt;br /&gt;
            parent::copy();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what have we done here? Well, first, in our constructor we initialized the $copies variable to 1. Thus, if we don&#039;t tell our copier otherwise, it will make one copy when the &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method is invoked. Note that we don&#039;t have to rewrite the code to initialize the counter - we just call &amp;lt;code&amp;gt;parent::__construct()&amp;lt;/code&amp;gt; and our parent constructor will handle that.&lt;br /&gt;
&lt;br /&gt;
Then, we &#039;&#039;overrode&#039;&#039; the &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method. Inside of our &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method we have what is called a &#039;&#039;[[http://en.wikipedia.org/wiki/For_loop|for loop]]&#039;&#039;.  &lt;br /&gt;
&lt;br /&gt;
In the first line of the for loop, you will see three parts divided by semicolons.  &lt;br /&gt;
&lt;br /&gt;
The first part is the  &#039;&#039;initialization&#039;&#039;. We will use $i as a counter variable, and we will start it at 0. $i will essentially keep track of the number of copies we have made out of the total number that we have to do.  &lt;br /&gt;
&lt;br /&gt;
The second part is the &#039;&#039;condition&#039;&#039;. At the beginning of each run of the for loop, this condition is checked to determine if it is true or not. If the condition is true, we execute the stuff inside of the braces. If it is not, then we are done the loop.  &lt;br /&gt;
&lt;br /&gt;
The last part is the &#039;&#039;incrementor&#039;&#039;. This is code that gets executed after every pass through the loop.  &lt;br /&gt;
&lt;br /&gt;
So it will run something like:&lt;br /&gt;
* take our variable i and set it to 0.&lt;br /&gt;
* Check if our variable i is less than the number of copies that we have to make&lt;br /&gt;
* if it is, then we will make a copy&lt;br /&gt;
* we will increment i by 1 and go back to step 2&lt;br /&gt;
&lt;br /&gt;
You can have much more complex for loops than this, but this is the basic idea.&lt;br /&gt;
&lt;br /&gt;
So that is our copier. Now to use our copier, we can add something like this to our code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$copier = new CopierMultipleCopies();&lt;br /&gt;
$copier-&amp;gt;copy();&lt;br /&gt;
$copier-&amp;gt;copy();&lt;br /&gt;
$copier-&amp;gt;setCopies( 10 );&lt;br /&gt;
$copier-&amp;gt;copy();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So notice a couple of things:&lt;br /&gt;
&lt;br /&gt;
First, as we made our copier more and more complex, we didn&#039;t have to duplicate code. That is, in our most complex copier, we didn&#039;t have to worry about creating code to make the actual copy. We just used the method that came with our original copier. Also, in our final copier we didn&#039;t have to re-implement the counter - we again just used the method that had already been defined to do this.&lt;br /&gt;
&lt;br /&gt;
Second, our new copier can serve as a drop in replacement for our old copier. Yes, each copier was more advanced than the previous one, but it was still possible with the most advanced one to just create it and invoke the copy() method, and it would create a copy.  &lt;br /&gt;
&lt;br /&gt;
If I want to use the more advanced functionality, such as reading the counter or changing the number of copies to be made, I need to know about these features, but I can still ignorantly use the copier as if it was the original Copier. (i.e. the original Copier class had a certain interface that was standard.)  &lt;br /&gt;
&lt;br /&gt;
The advanced copiers added more features, but this was separate from the original interface. (just as a car with cruise control has the same basic interface as a car without cruise control, but to take advantage of the cruise control you need to know how to set it).  &lt;br /&gt;
&lt;br /&gt;
Object Oriented Programming is an important part of the design of Joomla!.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;**ianmac** put together this OOPs overview for the community; [http://forum.joomla.org/index.php/topic,200185.msg943596.html#msg943596 Post #1] and [http://forum.joomla.org/index.php/topic,200694.msg944114.html#msg944114 Post #2]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
[http://us3.php.net/manual/en/oop5.intro.php Introduction to PHP 5 OOP] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Development Recommended Reading]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=How_to_use_the_JTable_class&amp;diff=201640</id>
		<title>How to use the JTable class</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=How_to_use_the_JTable_class&amp;diff=201640"/>
		<updated>2015-07-06T21:58:44Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: redirect to the current JTable page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Using the JTable class]]&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Using_multiple_models_in_an_MVC_component&amp;diff=201639</id>
		<title>Using multiple models in an MVC component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Using_multiple_models_in_an_MVC_component&amp;diff=201639"/>
		<updated>2015-07-06T21:46:27Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Add some more catagories&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|2.5,3.x}}&lt;br /&gt;
Sometimes a view needs to assemble information garnered from more than one model.&lt;br /&gt;
&lt;br /&gt;
With just a single model per view it is usually possible to ensure that models and views follow standard naming conventions and the minimum of code is then needed to give the view the data it needs.  In a component called MyComponent if there is a view, called My1 (class MyComponentViewMy1) that requires a model, also called My1 (class MyComponentModelMy1), then no additional coding is required as the controller will automatically associate the same-named model with the view.&lt;br /&gt;
&lt;br /&gt;
If a view requires a different model from its same-named counterpart then the controller must explicitly state the model to be used and pass it to the view.  For example, suppose view My2 requires data from model My3 instead of My2.  Then in the controller task-method you need to state the required model, like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$view = $this-&amp;gt;getView( &#039;My2&#039;, &#039;html&#039; );&lt;br /&gt;
$view-&amp;gt;setModel( $this-&amp;gt;getModel( &#039;My3&#039; ), true );&lt;br /&gt;
$view-&amp;gt;display();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Here the [[JController/getView|JController-&amp;gt;getView]] method instantiates the required view object and the [[JController/getModel|JController-&amp;gt;getModel]] method instantiates a model object.  The [[JView/setModel|JView-&amp;gt;setModel]] method adds the model to the view&#039;s internal pool of model objects.  Setting the second argument in the [[JView/setModel|JView-&amp;gt;setModel]] call to &#039;&#039;&#039;true&#039;&#039;&#039; establishes My3 as the default model for the view.&lt;br /&gt;
&lt;br /&gt;
Notice that you should not call the &#039;&#039;parent::display()&#039;&#039; method because that will try to instantiate the view and attach the default model to it.  You will need to adjust the code in this example if you need to use a format other than &#039;html&#039;, or a non-default layout.  See the code for [[JController/display|JController::display]] to see what you need to do.&lt;br /&gt;
&lt;br /&gt;
No changes to the view code are needed.  For example, in the My2 view&#039;s display method, these statements&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$item1 = $this-&amp;gt;get( &#039;data1&#039; );&lt;br /&gt;
$item2 = $this-&amp;gt;get( &#039;data2&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will call the &#039;&#039;getData1&#039;&#039; and &#039;&#039;getData2&#039;&#039; methods in the default My3 model (class MyComponentModelMy3).&lt;br /&gt;
&lt;br /&gt;
If the view requires data from more than one model, then the above code can be extended easily.  For example, if view My3 requires data from models My1 as well as My3 then the controller task-method would look something like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$view = $this-&amp;gt;getView( &#039;My3&#039;, &#039;html&#039; );&lt;br /&gt;
$view-&amp;gt;setModel( $this-&amp;gt;getModel( &#039;My3&#039; ), true );&lt;br /&gt;
$view-&amp;gt;setModel( $this-&amp;gt;getModel( &#039;My1&#039; ) );&lt;br /&gt;
$view-&amp;gt;display();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Notice that My3 has been set as the default model for the view in this example, but that My1 has also been added to the pool of models available in the view.&lt;br /&gt;
&lt;br /&gt;
Having more than one model available to the view means that some small changes to the view code are now needed in order to specify from which model each data item should be obtained.  Continuing with the above example, the My3 view&#039;s display method might have need of data like this&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$item1 = $this-&amp;gt;get( &#039;data1&#039; );&lt;br /&gt;
$item2 = $this-&amp;gt;get( &#039;data2&#039;, &#039;My1&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
which will call the &#039;&#039;getData1&#039;&#039; method in model My3 (class MyComponentModelMy3) and the &#039;&#039;getData2&#039;&#039; method in model My1 (class MyComponentModelMy1).&lt;br /&gt;
&lt;br /&gt;
Notice that it is always the controller&#039;s responsibility to determine which models are required by a view and to instantiate and pass the required model objects into the view object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J2.5:File_Structure_and_Naming_Conventions&amp;diff=201638</id>
		<title>J2.5:File Structure and Naming Conventions</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J2.5:File_Structure_and_Naming_Conventions&amp;diff=201638"/>
		<updated>2015-07-06T21:44:54Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: missing &amp;lt;references/&amp;gt; tag&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|2.5,3.1}}&lt;br /&gt;
{{page|needs version review}}&lt;br /&gt;
{{RightTOC}}&lt;br /&gt;
Components in Jooomla! 2.5+ can now benefit from the flexibility and power of using Object Oriented Programming (OOP) practices. &lt;br /&gt;
Components will follow the Model-View-Controller (MVC) design pattern. This pattern separates the data gathering (Model), presentation (View) and user interaction (Controller) activities of a component. Such separation allows for expanding or revising properties and methods of one section without requiring additional changes to the other sections. Please see [[Developing_a_Model-View-Controller_Component|the MVC tutorial]], then select a Joomla! version for an explanations of the MVC structure.&lt;br /&gt;
&lt;br /&gt;
Joomla!&#039;s file loading system enables developers to work with separate files for controllers, views and models without worrying about importing the right file in the right place. However, for this to work, certain naming conventions need to be observed.&lt;br /&gt;
&lt;br /&gt;
The Joomla! framework is extremely flexible, and it is possible to diverge from these conventions in many ways. It is nonetheless recommended to apply standard naming wherever possible to increase readability and maintainability. Additionally, the framework will take care of the many tedious class management tasks when the files and classes of a component are named correctly.&lt;br /&gt;
&lt;br /&gt;
Throughout this article, {ComponentName} is used to represent the name of the component (for example, Content). Notice also that case is important. {componentname} will refer to the lowercase version of {ComponentName}, eg. &amp;lt;code&amp;gt;CamelCasedController&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;camelcasedcontroller&amp;lt;/code&amp;gt;.&lt;br /&gt;
Similarly, {ViewName} and {viewname}, {ModelName} and {modelname}, {ControllerName} and {controllername}.&lt;br /&gt;
&lt;br /&gt;
== Reserved words ==&lt;br /&gt;
&lt;br /&gt;
There are reserved words which can&#039;t be used in names of classes and components.&lt;br /&gt;
&lt;br /&gt;
An example is the word &amp;quot;view&amp;quot; (in any case) for view classes (except &amp;quot;view&amp;quot; that must be second part of that class name)&amp;lt;ref&amp;gt;Reason is in line 420 of file libraries/joomla/application/component/view.php: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;if (!preg_match(&#039;/View((view)*(.*(view)?.*))$/i&#039;, get_class($this), $r)) {&amp;lt;/source&amp;gt;&amp;lt;/ref&amp;gt;.&lt;br /&gt;
Because the first part of the name of view classes is the same as the controller class name, controller class names can&#039;t contain the word &amp;quot;view&amp;quot; either. And because of the conventions (although violating of it won&#039;t produce an error), controller class names must contain the component name, so component names can&#039;t contain the word &amp;quot;view&amp;quot; either. So components can&#039;t be named &amp;quot;com_reviews&amp;quot;, or if they are, they must violate the naming conventions and have a different base controller class name (or have some other hacks).&lt;br /&gt;
&lt;br /&gt;
== Installation package vs. actual file placement ==&lt;br /&gt;
&lt;br /&gt;
All Joomla! extensions must be packaged as a .zip installation file. According to the most common file arrangement, the package should contain at least the following two folders as a basic structure:&lt;br /&gt;
* &amp;lt;code&amp;gt;site&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt;&lt;br /&gt;
If you set up your XML manifest file according to standard practice, the contents of &amp;lt;code&amp;gt;site&amp;lt;/code&amp;gt; will be installed to &amp;lt;code&amp;gt;/components/com_{componentname}&amp;lt;/code&amp;gt;, whereas the contents of &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; will be installed to &amp;lt;code&amp;gt;/administrator/components/com_{componentname}&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== The /site folder==&lt;br /&gt;
This folder keeps the files for the frontend part of the component.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/{componentname}.php&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:This is the component&#039;s main file and entry point &#039;&#039;for the frontend part&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/controller.php&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:This file holds the default frontend controller, which is a class called &amp;lt;code&amp;gt;{ComponentName}Controller&amp;lt;/code&amp;gt;. This class must extend the base class &amp;lt;code&amp;gt;JController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/views&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:This folder holds the different views for the component.&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/views/{viewname}&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::This folder holds the files for the view {ViewName}.&lt;br /&gt;
&lt;br /&gt;
:::&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/views/{viewname}/view.html.php&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::This file is the entry point for the view {ViewName}. It should declare the class &amp;lt;code&amp;gt;{ComponentName}View{ViewName}&amp;lt;/code&amp;gt;. This class must extend the base class &amp;lt;code&amp;gt;JViewLegacy&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;.html&amp;lt;/code&amp;gt; section of the filename is related to the format the view will be loaded in. For example, if the &amp;lt;code&amp;gt;format&amp;lt;/code&amp;gt; URL parameter is set to &amp;lt;code&amp;gt;format=feed&amp;lt;/code&amp;gt;, the file &amp;lt;code&amp;gt;view.feed.php&amp;lt;/code&amp;gt; will be loaded.&lt;br /&gt;
&lt;br /&gt;
:::&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/views/{viewname}/tmpl&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::This folder holds the template files for the view {ViewName}.&lt;br /&gt;
&lt;br /&gt;
::::&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/views/{viewname}/tmpl/default.php&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::This is the default template for the view {ViewName}. In this PHP file, the &amp;lt;code&amp;gt;$this&amp;lt;/code&amp;gt; keyword refers to the view class that the template belongs to.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/models&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:This folder holds additional models, if needed by the application.&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/models/{modelname}.php&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::This file holds the model class &amp;lt;code&amp;gt;{ComponentName}Model{ModelName}&amp;lt;/code&amp;gt;. This class must extend the base class &amp;lt;code&amp;gt;JModelLegacy&amp;lt;/code&amp;gt;. Note that the view named {ViewName} will by default load a model called {ViewName} if it exists. Most models are named after the view they are intended to be used with, but this is &#039;&#039;&#039;not&#039;&#039;&#039; a requirement. See [[Using multiple models in an MVC component]] for more information.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/controllers&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:This folder holds additional controllers, if needed by the application.&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/controllers/{controllername}.php&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::This file holds the controller class &amp;lt;code&amp;gt;{ComponentName}Controller{ControllerName}&amp;lt;/code&amp;gt;. This class must extend the base class &amp;lt;code&amp;gt;JController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== The /admin folder ==&lt;br /&gt;
The file structure is exactly the same as in the /site folder. Note that the view, models, controllers etc. of the site and admin parts are by default completely separated, and have nothing to do with each other - the site part and the admin part can be thought of as two different components! A view in the /admin folder may have a counterpart with the same name in the /site folder, yet the two views have nothing in common but their name.&lt;br /&gt;
&lt;br /&gt;
However, it might sometimes make sense to share classes between the site and admin parts of the component. Especially models can be shared to avoid duplicating model code. The Joomla! framework supports this strategy. When sharing any code between site and admin applications, the classes should be designed with great care to avoid the possibility of a site user executing admin actions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J2.5:File_Structure_and_Naming_Conventions&amp;diff=201637</id>
		<title>J2.5:File Structure and Naming Conventions</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J2.5:File_Structure_and_Naming_Conventions&amp;diff=201637"/>
		<updated>2015-07-06T21:44:07Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Add some more catagories&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|2.5,3.1}}&lt;br /&gt;
{{page|needs version review}}&lt;br /&gt;
{{RightTOC}}&lt;br /&gt;
Components in Jooomla! 2.5+ can now benefit from the flexibility and power of using Object Oriented Programming (OOP) practices. &lt;br /&gt;
Components will follow the Model-View-Controller (MVC) design pattern. This pattern separates the data gathering (Model), presentation (View) and user interaction (Controller) activities of a component. Such separation allows for expanding or revising properties and methods of one section without requiring additional changes to the other sections. Please see [[Developing_a_Model-View-Controller_Component|the MVC tutorial]], then select a Joomla! version for an explanations of the MVC structure.&lt;br /&gt;
&lt;br /&gt;
Joomla!&#039;s file loading system enables developers to work with separate files for controllers, views and models without worrying about importing the right file in the right place. However, for this to work, certain naming conventions need to be observed.&lt;br /&gt;
&lt;br /&gt;
The Joomla! framework is extremely flexible, and it is possible to diverge from these conventions in many ways. It is nonetheless recommended to apply standard naming wherever possible to increase readability and maintainability. Additionally, the framework will take care of the many tedious class management tasks when the files and classes of a component are named correctly.&lt;br /&gt;
&lt;br /&gt;
Throughout this article, {ComponentName} is used to represent the name of the component (for example, Content). Notice also that case is important. {componentname} will refer to the lowercase version of {ComponentName}, eg. &amp;lt;code&amp;gt;CamelCasedController&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;camelcasedcontroller&amp;lt;/code&amp;gt;.&lt;br /&gt;
Similarly, {ViewName} and {viewname}, {ModelName} and {modelname}, {ControllerName} and {controllername}.&lt;br /&gt;
&lt;br /&gt;
== Reserved words ==&lt;br /&gt;
&lt;br /&gt;
There are reserved words which can&#039;t be used in names of classes and components.&lt;br /&gt;
&lt;br /&gt;
An example is the word &amp;quot;view&amp;quot; (in any case) for view classes (except &amp;quot;view&amp;quot; that must be second part of that class name)&amp;lt;ref&amp;gt;Reason is in line 420 of file libraries/joomla/application/component/view.php: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;if (!preg_match(&#039;/View((view)*(.*(view)?.*))$/i&#039;, get_class($this), $r)) {&amp;lt;/source&amp;gt;&amp;lt;/ref&amp;gt;.&lt;br /&gt;
Because the first part of the name of view classes is the same as the controller class name, controller class names can&#039;t contain the word &amp;quot;view&amp;quot; either. And because of the conventions (although violating of it won&#039;t produce an error), controller class names must contain the component name, so component names can&#039;t contain the word &amp;quot;view&amp;quot; either. So components can&#039;t be named &amp;quot;com_reviews&amp;quot;, or if they are, they must violate the naming conventions and have a different base controller class name (or have some other hacks).&lt;br /&gt;
&lt;br /&gt;
== Installation package vs. actual file placement ==&lt;br /&gt;
&lt;br /&gt;
All Joomla! extensions must be packaged as a .zip installation file. According to the most common file arrangement, the package should contain at least the following two folders as a basic structure:&lt;br /&gt;
* &amp;lt;code&amp;gt;site&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt;&lt;br /&gt;
If you set up your XML manifest file according to standard practice, the contents of &amp;lt;code&amp;gt;site&amp;lt;/code&amp;gt; will be installed to &amp;lt;code&amp;gt;/components/com_{componentname}&amp;lt;/code&amp;gt;, whereas the contents of &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; will be installed to &amp;lt;code&amp;gt;/administrator/components/com_{componentname}&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== The /site folder==&lt;br /&gt;
This folder keeps the files for the frontend part of the component.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/{componentname}.php&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:This is the component&#039;s main file and entry point &#039;&#039;for the frontend part&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/controller.php&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:This file holds the default frontend controller, which is a class called &amp;lt;code&amp;gt;{ComponentName}Controller&amp;lt;/code&amp;gt;. This class must extend the base class &amp;lt;code&amp;gt;JController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/views&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:This folder holds the different views for the component.&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/views/{viewname}&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::This folder holds the files for the view {ViewName}.&lt;br /&gt;
&lt;br /&gt;
:::&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/views/{viewname}/view.html.php&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::This file is the entry point for the view {ViewName}. It should declare the class &amp;lt;code&amp;gt;{ComponentName}View{ViewName}&amp;lt;/code&amp;gt;. This class must extend the base class &amp;lt;code&amp;gt;JViewLegacy&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;.html&amp;lt;/code&amp;gt; section of the filename is related to the format the view will be loaded in. For example, if the &amp;lt;code&amp;gt;format&amp;lt;/code&amp;gt; URL parameter is set to &amp;lt;code&amp;gt;format=feed&amp;lt;/code&amp;gt;, the file &amp;lt;code&amp;gt;view.feed.php&amp;lt;/code&amp;gt; will be loaded.&lt;br /&gt;
&lt;br /&gt;
:::&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/views/{viewname}/tmpl&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::This folder holds the template files for the view {ViewName}.&lt;br /&gt;
&lt;br /&gt;
::::&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/views/{viewname}/tmpl/default.php&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::This is the default template for the view {ViewName}. In this PHP file, the &amp;lt;code&amp;gt;$this&amp;lt;/code&amp;gt; keyword refers to the view class that the template belongs to.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/models&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:This folder holds additional models, if needed by the application.&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/models/{modelname}.php&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::This file holds the model class &amp;lt;code&amp;gt;{ComponentName}Model{ModelName}&amp;lt;/code&amp;gt;. This class must extend the base class &amp;lt;code&amp;gt;JModelLegacy&amp;lt;/code&amp;gt;. Note that the view named {ViewName} will by default load a model called {ViewName} if it exists. Most models are named after the view they are intended to be used with, but this is &#039;&#039;&#039;not&#039;&#039;&#039; a requirement. See [[Using multiple models in an MVC component]] for more information.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/controllers&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:This folder holds additional controllers, if needed by the application.&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;&amp;lt;code&amp;gt;/site/controllers/{controllername}.php&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::This file holds the controller class &amp;lt;code&amp;gt;{ComponentName}Controller{ControllerName}&amp;lt;/code&amp;gt;. This class must extend the base class &amp;lt;code&amp;gt;JController&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== The /admin folder ==&lt;br /&gt;
The file structure is exactly the same as in the /site folder. Note that the view, models, controllers etc. of the site and admin parts are by default completely separated, and have nothing to do with each other - the site part and the admin part can be thought of as two different components! A view in the /admin folder may have a counterpart with the same name in the /site folder, yet the two views have nothing in common but their name.&lt;br /&gt;
&lt;br /&gt;
However, it might sometimes make sense to share classes between the site and admin parts of the component. Especially models can be shared to avoid duplicating model code. The Joomla! framework supports this strategy. When sharing any code between site and admin applications, the classes should be designed with great care to avoid the possibility of a site user executing admin actions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Getting_Started_with_Object_Oriented_Programming&amp;diff=201636</id>
		<title>Getting Started with Object Oriented Programming</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Getting_Started_with_Object_Oriented_Programming&amp;diff=201636"/>
		<updated>2015-07-06T21:37:30Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Remove the PHP 4 method of declaring a variable with the var keyword, we shouldn&amp;#039;t suggest a B/C synonym for the public keyword when we could just use public&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PHP is an object oriented language, and to use the MVC structure as implemented by Joomla!, a solid understanding of object oriented programming &#039;&#039;(OOP)&#039;&#039; is required. This document explains the reasons for using objects and the way objects are used in PHP.&lt;br /&gt;
&lt;br /&gt;
== Introduction to Objects ==&lt;br /&gt;
&lt;br /&gt;
As we venture into object oriented programming, it is important to note that it is called &#039;object&#039; oriented for a reason. &lt;br /&gt;
&lt;br /&gt;
Before object oriented programming (OOP), everything was based on &#039;&#039;functions&#039;&#039; and &#039;&#039;variables&#039;&#039;. Let&#039;s consider an application that calculates a person&#039;s BMI. You might have three variables: &amp;lt;code&amp;gt;$height&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$weight&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$name&amp;lt;/code&amp;gt;. These variables would be used to store a person&#039;s name, height and weight. You might then have a function called &amp;lt;code&amp;gt;calculateBMI()&amp;lt;/code&amp;gt;, which would accept as parameters $height and $weight.  &lt;br /&gt;
&lt;br /&gt;
This would look something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function calculateBMI( $height, $weight ) {&lt;br /&gt;
    return $weight / $height;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But it is very easy to lose track of all these variables in the code, not to mention the fact that only one person is supported at a time. The idea behind objects is to &#039;&#039;&#039;encapsulate&#039;&#039;&#039; this data &#039;&#039;&#039;and&#039;&#039;&#039; the functions to manipulate it into one &#039;&#039;package&#039;&#039;. The definition of this package is called a &#039;&#039;class&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
So we might have:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class person&lt;br /&gt;
{&lt;br /&gt;
    public $name;&lt;br /&gt;
    public $height;&lt;br /&gt;
    public $weight;&lt;br /&gt;
&lt;br /&gt;
    function getBMI() {&lt;br /&gt;
        return $this-&amp;gt;weight / $this-&amp;gt;height;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, if you want to create an object which represents a person, you would do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$person = new person();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is called &#039;&#039;instantiating&#039;&#039; the class, because it creates an &#039;&#039;instance&#039;&#039; of the class (an object described by the class).&lt;br /&gt;
&lt;br /&gt;
Now, you can modify the variables (which are called &#039;&#039;properties&#039;&#039;), using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$person-&amp;gt;height = 2;&lt;br /&gt;
$person-&amp;gt;weight = 50;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can invoke its functions (which are called &#039;&#039;methods&#039;&#039;) using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$bmi = $person-&amp;gt;getBMI();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Often, many classes are similar, but too different to put into one class. For example, all animals have lungs, and because humans and cats are animals, they could both have a &amp;lt;code&amp;gt;$lung_capacity&amp;lt;/code&amp;gt;. However, cats have tails, so should an &amp;lt;code&amp;gt;Animal&amp;lt;/code&amp;gt; class have a &amp;lt;code&amp;gt;$tail_length&amp;lt;/code&amp;gt;? No, that is not necessary. You can make a class a &#039;&#039;subclass&#039;&#039; or &#039;&#039;child class&#039;&#039; of another, essentially stating that the subclass has everything its parent class has, plus some extensions.&lt;br /&gt;
&lt;br /&gt;
In Joomla, most classes are children of JObject. Now, if we were to make person a child class of JObject, then we would &#039;&#039;inherit&#039;&#039; the capabilities of the JObject class. We would then change the definition to something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class person extends JObject&lt;br /&gt;
{&lt;br /&gt;
    public $name;&lt;br /&gt;
    public $height;&lt;br /&gt;
    public $weight;&lt;br /&gt;
&lt;br /&gt;
    function getBMI() {&lt;br /&gt;
        return $this-&amp;gt;weight / $this-&amp;gt;height;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we could &#039;&#039;manipulate&#039;&#039; our person using the &amp;lt;code&amp;gt;get()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;set()&amp;lt;/code&amp;gt; methods that JObject has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$person-&amp;gt;set( &#039;name&#039;, &#039;Bob&#039; );&lt;br /&gt;
$person-&amp;gt;set( &#039;height&#039;, 2 );&lt;br /&gt;
$person-&amp;gt;set( &#039;weight&#039;, 50 );&lt;br /&gt;
$person-&amp;gt;get( &#039;weight&#039; );&lt;br /&gt;
echo $person-&amp;gt;getBMI();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will notice the use of &amp;lt;code&amp;gt;$this&amp;lt;/code&amp;gt; inside classes a lot. &amp;lt;code&amp;gt;$this&amp;lt;/code&amp;gt; is a reference to the &#039;&#039;&#039;current&#039;&#039;&#039; object. So if I am inside a class, and I use say &amp;lt;code&amp;gt;$this-&amp;gt;height = 2;&amp;lt;/code&amp;gt;, then that means I am setting the property &#039;height&#039; of the current object to 2. When we use &amp;lt;code&amp;gt;$this-&amp;gt;height&amp;lt;/code&amp;gt;, we aren&#039;t talking about any height, but we&#039;re talking about the current object height.&lt;br /&gt;
&lt;br /&gt;
== More on Objects ==&lt;br /&gt;
&lt;br /&gt;
As I said, Objects are called Objects for a reason.  If you have a real life object, say a photocopier, there is an external interface (say, a paper tray, the copier glass, the keypad, etc.).  Objects in OOP are designed to approximate that setup.&lt;br /&gt;
&lt;br /&gt;
So, I might have a class called copier. Now, what operations do I generally need to do with a copier? Well, the basic functionality I need is copy functionality. So I need a method called &#039;copy&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class Copier&lt;br /&gt;
{&lt;br /&gt;
    function copy() {&lt;br /&gt;
        echo &#039;One copy made&#039;;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, this is a very basic copier. What if I wanted to extend the functionality of my Copier? Well, to extend the functionality, I create a child class. &#039;&#039;A child class will inherit all the functionality of the parent class.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s suppose we wanted to create a copier that would keep track of the number of copies it had made. So, we would need to add a property which would keep track of this number, and then we need to somehow adjust this number each time we make a copy.&lt;br /&gt;
&lt;br /&gt;
So here is our child class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class CopierWithCounter extends Copier&lt;br /&gt;
{&lt;br /&gt;
    public $counter;&lt;br /&gt;
&lt;br /&gt;
    function copy() {&lt;br /&gt;
        $this-&amp;gt;counter++;&lt;br /&gt;
        parent::copy();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So we now have a property called &amp;lt;code&amp;gt;$counter&amp;lt;/code&amp;gt; that keeps track of the number of copies made. Notice that the method we defined has the same name as the method in the Copier class. What this means is that we don&#039;t need to learn anything new to use the copier - it behaves in the same way as our old copier, but it just keep track of the number of copies.&lt;br /&gt;
&lt;br /&gt;
You will see that inside of the &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method there is a line: &#039;&#039;&amp;lt;code&amp;gt;parent::copy()&amp;lt;/code&amp;gt;&#039;&#039;. The &amp;lt;code&amp;gt;parent&amp;lt;/code&amp;gt; keyword references the parent class, which is in this case Copier.  So this line will invoke the &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method of the Copier class. In this way, we don&#039;t have to rewrite the functionality to make a copy - we have already done that in the Copier class.&lt;br /&gt;
&lt;br /&gt;
So we have the exact same functionality as the Copier class, except that anytime a copy is made it will increment the $copies property by 1. Just as in real life, the addition of the counter doesn&#039;t change the way that I use the copier - I don&#039;t need to know anything about the counter to just make a simple copy.&lt;br /&gt;
&lt;br /&gt;
Now, the question arises: what value does &amp;lt;code&amp;gt;$counter&amp;lt;/code&amp;gt; have to start with? We know that it increases by one every time a copy is made, but that is all we know.&lt;br /&gt;
&lt;br /&gt;
This value needs to be &#039;&#039;initialized&#039;&#039; to a certain value.&lt;br /&gt;
&lt;br /&gt;
Initializing values is generally done by what is called a &#039;&#039;constructor&#039;&#039;. A constructor does just that - it constructs the object. In PHP4, constructors were functions that always had the same name as the class. In PHP5, constructors are functions with the name &amp;lt;code&amp;gt;__construct&amp;lt;/code&amp;gt;. We will use &amp;lt;code&amp;gt;__construct&amp;lt;/code&amp;gt; here.&lt;br /&gt;
&lt;br /&gt;
So our class now becomes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class CopierWithCounter extends Copier&lt;br /&gt;
{&lt;br /&gt;
    public $counter;&lt;br /&gt;
&lt;br /&gt;
    function __construct() {&lt;br /&gt;
        $this-&amp;gt;counter = 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function copy() {&lt;br /&gt;
        $this-&amp;gt;counter++;&lt;br /&gt;
        parent::copy();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now suppose we wanted to create an even more advanced copier. We can do that by creating another child class. Let&#039;s create a copier that is able to do multiple copies. In order to do this, we need a way to specify how many copies we want and a way to remember this number. We will add a method called &#039;setCopies()&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class CopierMultipleCopies extends CopierWithCounter&lt;br /&gt;
{&lt;br /&gt;
    public $copies;&lt;br /&gt;
&lt;br /&gt;
    function setCopies( $copies ) {&lt;br /&gt;
        $this-&amp;gt;copies = $copies;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
We now have a way to specify how many copies we want to make.&lt;br /&gt;
&lt;br /&gt;
Now, it is appropriate here to say a word about &#039;&#039;scope&#039;&#039;. When we talk about scope, we talk about where a certain variable can be seen. You will notice that in our class, we have a property called &amp;lt;code&amp;gt;$copies&amp;lt;/code&amp;gt;. But we also have a parameter called &amp;lt;code&amp;gt;$copies&amp;lt;/code&amp;gt; in our method &amp;lt;code&amp;gt;setCopies&amp;lt;/code&amp;gt;. How do you tell them apart?&lt;br /&gt;
&lt;br /&gt;
Well, the rules of scope tell us which variable we are talking about. If a method takes a parameter, say &amp;lt;code&amp;gt;$copies&amp;lt;/code&amp;gt; (as above), then if I use &amp;lt;code&amp;gt;$copies&amp;lt;/code&amp;gt; inside that method, I am referring to that parameter. There may be other variables called &amp;lt;code&amp;gt;$copies&amp;lt;/code&amp;gt; that are defined in other places, but I don&#039;t care about those - I only care about the one inside of my function. If I want to refer to a property of the current object, I use the &amp;lt;code&amp;gt;$this&amp;lt;/code&amp;gt; keyword. So, if I use &amp;lt;code&amp;gt;$this-&amp;gt;copies&amp;lt;/code&amp;gt;, then I am talking about the &amp;lt;code&amp;gt;$copies&amp;lt;/code&amp;gt; property that belongs to my current object.&lt;br /&gt;
&lt;br /&gt;
So that aside, our &amp;lt;code&amp;gt;setCopies()&amp;lt;/code&amp;gt; method will allow us to set the number of copies that we want to make using our copier. The method takes one parameter - &amp;lt;code&amp;gt;$copies&amp;lt;/code&amp;gt;, and stores it in the object.&lt;br /&gt;
&lt;br /&gt;
You will notice that our current class definition for CopierMultipleCopies doesn&#039;t define a &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method or a constructor. But, because it extends CopierWithCounter, it inherits the &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method from CopierWithCounter, and also inherits the properties. So, without doing any extra work, we already have a Copier with a counter.&lt;br /&gt;
&lt;br /&gt;
But we still want to extend the functionality of the &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method so that it actually makes the multiple copies. So, we add a method definition to our class. We will also add a constructor that will add the functionality of initializing the number of copies to 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class CopierMultipleCopies extends CopierWithCounter&lt;br /&gt;
{&lt;br /&gt;
    public $copies;&lt;br /&gt;
&lt;br /&gt;
    function __construct() {&lt;br /&gt;
        $this-&amp;gt;copies = 1;&lt;br /&gt;
        parent::__construct();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function setCopies( $copies ) {&lt;br /&gt;
        $this-&amp;gt;copies = $copies;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function copy() {&lt;br /&gt;
        for ($i = 0; $i &amp;lt; $this-&amp;gt;copies; $i++) {&lt;br /&gt;
            parent::copy();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what have we done here? Well, first, in our constructor we initialized the $copies variable to 1. Thus, if we don&#039;t tell our copier otherwise, it will make one copy when the &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method is invoked. Note that we don&#039;t have to rewrite the code to initialize the counter - we just call &amp;lt;code&amp;gt;parent::__construct()&amp;lt;/code&amp;gt; and our parent constructor will handle that.&lt;br /&gt;
&lt;br /&gt;
Then, we &#039;&#039;overrode&#039;&#039; the &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method. Inside of our &amp;lt;code&amp;gt;copy()&amp;lt;/code&amp;gt; method we have what is called a &#039;&#039;[[http://en.wikipedia.org/wiki/For_loop|for loop]]&#039;&#039;.  &lt;br /&gt;
&lt;br /&gt;
In the first line of the for loop, you will see three parts divided by semicolons.  &lt;br /&gt;
&lt;br /&gt;
The first part is the  &#039;&#039;initialization&#039;&#039;. We will use $i as a counter variable, and we will start it at 0. $i will essentially keep track of the number of copies we have made out of the total number that we have to do.  &lt;br /&gt;
&lt;br /&gt;
The second part is the &#039;&#039;condition&#039;&#039;. At the beginning of each run of the for loop, this condition is checked to determine if it is true or not. If the condition is true, we execute the stuff inside of the braces. If it is not, then we are done the loop.  &lt;br /&gt;
&lt;br /&gt;
The last part is the &#039;&#039;incrementor&#039;&#039;. This is code that gets executed after every pass through the loop.  &lt;br /&gt;
&lt;br /&gt;
So it will run something like:&lt;br /&gt;
* take our variable i and set it to 0.&lt;br /&gt;
* Check if our variable i is less than the number of copies that we have to make&lt;br /&gt;
* if it is, then we will make a copy&lt;br /&gt;
* we will increment i by 1 and go back to step 2&lt;br /&gt;
&lt;br /&gt;
You can have much more complex for loops than this, but this is the basic idea.&lt;br /&gt;
&lt;br /&gt;
So that is our copier. Now to use our copier, we can add something like this to our code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$copier = new CopierMultipleCopies();&lt;br /&gt;
$copier-&amp;gt;copy();&lt;br /&gt;
$copier-&amp;gt;copy();&lt;br /&gt;
$copier-&amp;gt;setCopies( 10 );&lt;br /&gt;
$copier-&amp;gt;copy();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So notice a couple of things:&lt;br /&gt;
&lt;br /&gt;
First, as we made our copier more and more complex, we didn&#039;t have to duplicate code. That is, in our most complex copier, we didn&#039;t have to worry about creating code to make the actual copy. We just used the method that came with our original copier. Also, in our final copier we didn&#039;t have to re-implement the counter - we again just used the method that had already been defined to do this.&lt;br /&gt;
&lt;br /&gt;
Second, our new copier can serve as a drop in replacement for our old copier. Yes, each copier was more advanced than the previous one, but it was still possible with the most advanced one to just create it and invoke the copy() method, and it would create a copy.  &lt;br /&gt;
&lt;br /&gt;
If I want to use the more advanced functionality, such as reading the counter or changing the number of copies to be made, I need to know about these features, but I can still ignorantly use the copier as if it was the original Copier. (i.e. the original Copier class had a certain interface that was standard.)  &lt;br /&gt;
&lt;br /&gt;
The advanced copiers added more features, but this was separate from the original interface. (just as a car with cruise control has the same basic interface as a car without cruise control, but to take advantage of the cruise control you need to know how to set it).  &lt;br /&gt;
&lt;br /&gt;
This idea is an important part of the design of Joomla!.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;**ianmac** put together this OOPs overview for the community; [http://forum.joomla.org/index.php/topic,200185.msg943596.html#msg943596 Post #1] and [http://forum.joomla.org/index.php/topic,200694.msg944114.html#msg944114 Post #2]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Development Recommended Reading]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Retrieving_request_data_using_JInput&amp;diff=201635</id>
		<title>Retrieving request data using JInput</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Retrieving_request_data_using_JInput&amp;diff=201635"/>
		<updated>2015-07-06T21:19:08Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Include in Category:Tutorials&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version|2.5,3.1|platform=11.1,12.1}}&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
To be able to use JInput as described here, you must be using Joomla 2.5.0 or above.&lt;br /&gt;
&lt;br /&gt;
Please note there are known issues with JInput and Magic Quotes (Deprecated in PHP 5.3.0 and removed in PHP 5.4.0). Most servers have these turned off - however it is important to bear this in mind whilst developing a component. For this reason all core components in Joomla 2.5.x still use JRequest. As of Joomla 3.0+ magic quotes is required to be disabled and thus this is no longer an issue.&lt;br /&gt;
&lt;br /&gt;
==Using JInput==&lt;br /&gt;
To use JInput you must first create the object by using this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$jinput = JFactory::getApplication()-&amp;gt;input;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Getting Values===&lt;br /&gt;
To get a value from JInput, you can use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$foo = $jinput-&amp;gt;get(&#039;varname&#039;, &#039;default_value&#039;, &#039;filter&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The filter defaults to &amp;lt;code&amp;gt;cmd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Available filters are:&lt;br /&gt;
&lt;br /&gt;
*INT&lt;br /&gt;
*INTEGER&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Only use the first integer value&lt;br /&gt;
preg_match(&#039;/-?[0-9]+/&#039;, (string) $source, $matches);&lt;br /&gt;
$result = @ (int) $matches[0];&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*UINT&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Only use the first integer value&lt;br /&gt;
preg_match(&#039;/-?[0-9]+/&#039;, (string) $source, $matches);&lt;br /&gt;
$result = @ abs((int) $matches[0]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*FLOAT&lt;br /&gt;
*DOUBLE&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Only use the first floating point value&lt;br /&gt;
preg_match(&#039;/-?[0-9]+(\.[0-9]+)?/&#039;, (string) $source, $matches);&lt;br /&gt;
$result = @ (float) $matches[0];&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*BOOL&lt;br /&gt;
*BOOLEAN&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$result = (bool) $source;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*WORD&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Only allow characters a-z, and underscores&lt;br /&gt;
$result = (string) preg_replace(&#039;/[^A-Z_]/i&#039;, &#039;&#039;, $source);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*ALNUM&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Allow a-z and 0-9 only&lt;br /&gt;
$result = (string) preg_replace(&#039;/[^A-Z0-9]/i&#039;, &#039;&#039;, $source);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*CMD&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Allow a-z, 0-9, underscore, dot, dash. Also remove leading dots from result. &lt;br /&gt;
$result = (string) preg_replace(&#039;/[^A-Z0-9_\.-]/i&#039;, &#039;&#039;, $source);&lt;br /&gt;
$result = ltrim($result, &#039;.&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*BASE64&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Allow a-z, 0-9, slash, plus, equals.&lt;br /&gt;
$result = (string) preg_replace(&#039;/[^A-Z0-9\/+=]/i&#039;, &#039;&#039;, $source);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*STRING&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Converts the input to a plain text string; strips all tags / attributes.&lt;br /&gt;
$result = (string) $this-&amp;gt;_remove($this-&amp;gt;_decode((string) $source));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*HTML&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Converts the input to a string; strips all HTML tags / attributes.&lt;br /&gt;
$result = (string) $this-&amp;gt;_remove($this-&amp;gt;_decode((string) $source));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*ARRAY&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Attempts to convert the input to an array.&lt;br /&gt;
$result = (array) $source;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*PATH&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Converts the input into a string and validates it as a path. (e.g. path/to/file.png or path/to/dir)&lt;br /&gt;
// Note: Does NOT accept absolute paths, or paths ending in a trailing slash.&lt;br /&gt;
// For a visual representation of the pattern matching used, see http://www.regexper.com/#^[A-Za-z0-9_-]%2B[A-Za-z0-9_\.-]*%28[\\\\\%2F][A-Za-z0-9_-]%2B[A-Za-z0-9_\.-]*%29*%24&lt;br /&gt;
// Will return null if the input was invalid.&lt;br /&gt;
$pattern = &#039;/^[A-Za-z0-9_-]+[A-Za-z0-9_\.-]*([\\\\\/][A-Za-z0-9_-]+[A-Za-z0-9_\.-]*)*$/&#039;;&lt;br /&gt;
preg_match($pattern, (string) $source, $matches);&lt;br /&gt;
$result = @ (string) $matches[0];&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*RAW&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// The raw input. No sanitation provided.&lt;br /&gt;
$result = $source;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*USERNAME&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Strips all invalid username characters.&lt;br /&gt;
$result = (string) preg_replace(&#039;/[\x00-\x1F\x7F&amp;lt;&amp;gt;&amp;quot;\&#039;%&amp;amp;]/&#039;, &#039;&#039;, $source)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively instead of adding the filter you can use the JInput type specific methods:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Instead of:&lt;br /&gt;
$input-&amp;gt;get(&#039;name&#039;, &#039;&#039;, &#039;STR&#039;);&lt;br /&gt;
// you can use:&lt;br /&gt;
$input-&amp;gt;getString(&#039;name&#039;, &#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
// Instead of:&lt;br /&gt;
$input-&amp;gt;get(&#039;memberId&#039;, 0, &#039;INT&#039;);&lt;br /&gt;
// you can use:&lt;br /&gt;
$input-&amp;gt;getInt(&#039;memberId&#039;, 0);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Getting Multiple Values===&lt;br /&gt;
&lt;br /&gt;
To retrieve a number of values you can use the &amp;lt;code&amp;gt;getArray()&amp;lt;/code&amp;gt; method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$fooValues = $jinput-&amp;gt;getArray(array(&#039;var1&#039; =&amp;gt; &#039;&#039;, &#039;var2&#039; =&amp;gt; &#039;&#039;, &#039;var3&#039; =&amp;gt; &#039;&#039;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or, if you want to determine the data to get step by step:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$fooArray = array();&lt;br /&gt;
$fooArray[&#039;var1&#039;] = &#039;&#039;;&lt;br /&gt;
$fooArray[&#039;var2&#039;] = &#039;&#039;;&lt;br /&gt;
$fooArray[&#039;var3&#039;] = &#039;&#039;;&lt;br /&gt;
$fooValues = $jinput-&amp;gt;getArray($fooArray);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;$fooValues&amp;lt;/code&amp;gt; will be an array that consists of the same keys as used in &amp;lt;code&amp;gt;$fooArray&amp;lt;/code&amp;gt;, but with values attached.&lt;br /&gt;
&lt;br /&gt;
You can also specify different filters for each of the inputs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;gt;&lt;br /&gt;
$fooValues = $jinput-&amp;gt;getArray(array(&lt;br /&gt;
    &#039;var1&#039; =&amp;gt; &#039;int&#039;,&lt;br /&gt;
    &#039;var2&#039; =&amp;gt; &#039;float&#039;,&lt;br /&gt;
    &#039;var3&#039; =&amp;gt; &#039;word&#039;&lt;br /&gt;
));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also nest arrays to get more complicated hierarchies of values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$fooValues = $jinput-&amp;gt;getArray(array(&lt;br /&gt;
    &#039;jform&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;title&#039; =&amp;gt; &#039;string&#039;,&lt;br /&gt;
        &#039;quantity&#039; =&amp;gt; &#039;int&#039;,&lt;br /&gt;
        &#039;state&#039; =&amp;gt; &#039;int&#039;&lt;br /&gt;
    )&lt;br /&gt;
));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Getting Values from a Specific Super Global===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$foo = $jinput-&amp;gt;get-&amp;gt;get(&#039;varname&#039;, &#039;default_value&#039;, &#039;filter&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$foo = $jinput-&amp;gt;post-&amp;gt;get(&#039;varname&#039;, &#039;default_value&#039;, &#039;filter&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$foo = $jinput-&amp;gt;server-&amp;gt;get(&#039;varname&#039;, &#039;default_value&#039;, &#039;filter&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To retrieve an entire object, you can use:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$foo = $jinput-&amp;gt;get(&#039;varname&#039;, null, null);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting Values===&lt;br /&gt;
&lt;br /&gt;
To set a value via JInput, you can use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$jinput-&amp;gt;set(&#039;varname&#039;, $foo);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Retrieving File Data===&lt;br /&gt;
&lt;br /&gt;
The format that PHP returns file data in for arrays can at times be awkward, especially when dealing with arrays of files. JInputFiles provides a convenient interface for making life a little easier, grouping the data by file.&lt;br /&gt;
&lt;br /&gt;
Suppose you have a form like:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;form action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php?option=com_example&amp;amp;task=file.submit&#039;); ?&amp;gt;&amp;quot; enctype=&amp;quot;multipart/form-data&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;input type=&amp;quot;file&amp;quot; name=&amp;quot;jform1[test][]&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;input type=&amp;quot;file&amp;quot; name=&amp;quot;jform1[test][]&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Normally, PHP would put these in an array called &amp;lt;code&amp;gt;$_FILES&amp;lt;/code&amp;gt; that looked like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Array&lt;br /&gt;
(&lt;br /&gt;
    [jform1] =&amp;gt; Array&lt;br /&gt;
        (&lt;br /&gt;
            [name] =&amp;gt; Array&lt;br /&gt;
                (&lt;br /&gt;
                    [test] =&amp;gt; Array&lt;br /&gt;
                        (&lt;br /&gt;
                            [0] =&amp;gt; youtube_icon.png&lt;br /&gt;
                            [1] =&amp;gt; Younger_Son_2.jpg&lt;br /&gt;
                        )&lt;br /&gt;
&lt;br /&gt;
                )&lt;br /&gt;
&lt;br /&gt;
            [type] =&amp;gt; Array&lt;br /&gt;
                (&lt;br /&gt;
                    [test] =&amp;gt; Array&lt;br /&gt;
                        (&lt;br /&gt;
                            [0] =&amp;gt; image/png&lt;br /&gt;
                            [1] =&amp;gt; image/jpeg&lt;br /&gt;
                        )&lt;br /&gt;
&lt;br /&gt;
                )&lt;br /&gt;
&lt;br /&gt;
            [tmp_name] =&amp;gt; Array&lt;br /&gt;
                (&lt;br /&gt;
                    [test] =&amp;gt; Array&lt;br /&gt;
                        (&lt;br /&gt;
                            [0] =&amp;gt; /tmp/phpXoIpSD&lt;br /&gt;
                            [1] =&amp;gt; /tmp/phpWDE7ye&lt;br /&gt;
                        )&lt;br /&gt;
&lt;br /&gt;
                )&lt;br /&gt;
&lt;br /&gt;
            [error] =&amp;gt; Array&lt;br /&gt;
                (&lt;br /&gt;
                    [test] =&amp;gt; Array&lt;br /&gt;
                        (&lt;br /&gt;
                            [0] =&amp;gt; 0&lt;br /&gt;
                            [1] =&amp;gt; 0&lt;br /&gt;
                        )&lt;br /&gt;
&lt;br /&gt;
                )&lt;br /&gt;
&lt;br /&gt;
            [size] =&amp;gt; Array&lt;br /&gt;
                (&lt;br /&gt;
                    [test] =&amp;gt; Array&lt;br /&gt;
                        (&lt;br /&gt;
                            [0] =&amp;gt; 34409&lt;br /&gt;
                            [1] =&amp;gt; 99529&lt;br /&gt;
                        )&lt;br /&gt;
&lt;br /&gt;
                )&lt;br /&gt;
&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JInputFiles produces a result that is cleaner and easier to work with:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$files = $input-&amp;gt;files-&amp;gt;get(&#039;jform1&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$files&amp;lt;/code&amp;gt; then becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Array&lt;br /&gt;
(&lt;br /&gt;
    [test] =&amp;gt; Array&lt;br /&gt;
        (&lt;br /&gt;
            [0] =&amp;gt; Array&lt;br /&gt;
                (&lt;br /&gt;
                    [name] =&amp;gt; youtube_icon.png&lt;br /&gt;
                    [type] =&amp;gt; image/png&lt;br /&gt;
                    [tmp_name] =&amp;gt; /tmp/phpXoIpSD&lt;br /&gt;
                    [error] =&amp;gt; 0&lt;br /&gt;
                    [size] =&amp;gt; 34409&lt;br /&gt;
                )&lt;br /&gt;
&lt;br /&gt;
            [1] =&amp;gt; Array&lt;br /&gt;
                (&lt;br /&gt;
                    [name] =&amp;gt; Younger_Son_2.jpg&lt;br /&gt;
                    [type] =&amp;gt; image/jpeg&lt;br /&gt;
                    [tmp_name] =&amp;gt; /tmp/phpWDE7ye&lt;br /&gt;
                    [error] =&amp;gt; 0&lt;br /&gt;
                    [size] =&amp;gt; 99529&lt;br /&gt;
                )&lt;br /&gt;
&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this way, the data from each file element is consolidated into a single array and can be indexed in a more straightforward manner.&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
This is based on an email discussion: [https://groups.google.com/d/msg/joomla-dev-framework/LbALkK1ifMo/5waSiIlb21gJ Framework List 23 July 2011]&lt;br /&gt;
&lt;br /&gt;
The idea behind JInput is to abstract out the input source to allow code to be reused in different applications and in different contexts.  What I mean by this is that you could have a controller that grabs data from an input source.  Instead of always getting it from the request (i.e. get and post variables), you get it from JInput.  So say for instance you have a MVC triad in your component that is meant to get data from the browser as a client (a typical web application).  Now suppose you want to reuse that same code but interface with it using JSON.  Instead of rewriting your triad, you just extend JInput and have it grab it data from a parsed json object and perform any translation that you need to perform.&lt;br /&gt;
&lt;br /&gt;
The plan is to have JApplication instantiate JInput in its constructor.  Then in your code you get the input object from the application and get your input from there.  It will be a public property in Japplication so that it can be swapped out of that is appropriate.&lt;br /&gt;
&lt;br /&gt;
We get the added benefit that we get rid of the static JRequest which makes a whole bunch the code a whole lot easier to test because you can inject mock inputs directly instead of trying to fudge with hackish dependencies.&lt;br /&gt;
&lt;br /&gt;
The end result will be that your code will get the input object from the application (we will probably add something to JController at some point to make it more convenient to use there as well).&lt;br /&gt;
&lt;br /&gt;
Once you have your JInput object, you use it fairly in a fairly similar manner to how JRequest is used:&lt;br /&gt;
$input-&amp;gt;get(&#039;varname&#039;, &#039;default_value&#039;, &#039;filter&#039;);&lt;br /&gt;
&lt;br /&gt;
Where filter is a filter that is supported by JFilterInput.  JInput::clean proxies to JFilter.  We&#039;ll have to tweak JFilter a little bit so that it is more extensible.  It defaults to cmd so that developers have to be intentional about things if they want to have more lenient filtering.&lt;br /&gt;
&lt;br /&gt;
There is also a getArray method that allows you to specify an array of key and filter pairs so that you can get a whole array of filtered input.&lt;br /&gt;
&lt;br /&gt;
If you want to get data from a specific super global array, you can do $input-&amp;gt;get-&amp;gt;get(...) or $input-&amp;gt;post-&amp;gt;get(...).&lt;br /&gt;
&lt;br /&gt;
So that&#039;s the basic idea.  Feel free to post more questions if you have any.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll be adding input as a public property to JApplication in the near future.  It might be an idea if the CMS folks so chose to release a 1.7.1 that included this so developers can use it now.  Otherwise, at this point in time, it is best to still use JRequest.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Using_the_JTable_class&amp;diff=200284</id>
		<title>Using the JTable class</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Using_the_JTable_class&amp;diff=200284"/>
		<updated>2015-07-02T19:42:48Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Add some more catagories&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial is for {{JVer|3.x}}&lt;br /&gt;
&lt;br /&gt;
== Introduction to JTable ==&lt;br /&gt;
The [https://api.joomla.org/cms-3/classes/JTable.html JTable] class is an implementation of the [http://en.wikipedia.org/wiki/Active_record_pattern Active Record] design pattern. It is used throughout Joomla! for [http://en.wikipedia.org/wiki/Create,_read,_update_and_delete creating, reading, updating, and deleting] records in the database table. &lt;br /&gt;
&lt;br /&gt;
Since JTable is an abstract class that forms the basis for all database table classes. Some of the methods listed will be overridden by the child class so you should check the child class documentation for further information. Also take note that as of Joomla 2.5, JTable properties are automatically generated based on the schema of the specified table, which means you don&#039;t need to declare Member variables in your class.&lt;br /&gt;
&lt;br /&gt;
Each physical database table created should have a corresponding class derived from JTable to represent it. JTable provides many methods to make common manipulations to the table much simpler. For example, one of the most common operations you will need to perform is to read a table row into memory given a value for the primary key. This can be done easily using the load method. The table row can then be just as easily updated using the save method, which also performs any predefined sanity checks on the table fields.&lt;br /&gt;
&lt;br /&gt;
== Writing an extension of JTable ==&lt;br /&gt;
To use JTable, you will create an extension of the JTable class. In this example, we have a database table &amp;quot;#__recipes&amp;quot; with an autoincrementing primary key &amp;quot;id&amp;quot; containing all of our recipes. We&#039;ll store this &lt;br /&gt;
&lt;br /&gt;
The only thing we need to do to start using JTables is create a constructor in our extended JTable class. The class constructor will call the parent constructor to get the table, all it needs is the name of the table, the name of the primary key column, and the database instance.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die();&lt;br /&gt;
&lt;br /&gt;
class TableRecipes extends JTable&lt;br /&gt;
{&lt;br /&gt;
	public function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct( &#039;#__recipes&#039;, &#039;id&#039;, $db );&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you were using this class as a part of a backend component called &#039;Recipes&#039;, you would place this code in the file /administrator/components/com_recipes/tables/recipes.php.&lt;br /&gt;
&lt;br /&gt;
You can use this functionality in plugins just as components, i.e.. As a general rule you should avoid writing to the database from a module, and use plugins/components for this. Remember to use the built-in [[constants]] when linking to a custom path (outside the &#039;adminstrator/{com_nameofyourcomponent}/tables&#039; folder).&lt;br /&gt;
&lt;br /&gt;
== Using a JTable class extension ==&lt;br /&gt;
&lt;br /&gt;
Once the table class is in place we can use it in our model getTable() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
public function getTable($type = &#039;Recipes&#039;, $prefix = &#039;Table&#039;, $config = array())&lt;br /&gt;
{&lt;br /&gt;
	return JTable::getInstance($type, $prefix, $config);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use your JTable class in any Joomla! extension by using JTable::addIncludePath() in your extension&#039;s source code (use com_nameofyourcomponent in place of com_recipes):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JTable::addIncludePath(JPATH_ADMINISTRATOR . &#039;/components/com_recipes/tables&#039;);&lt;br /&gt;
$row = JTable::getInstance(&#039;recipes&#039;, &#039;Table&#039;, array());&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the lowercase version of the suffix of your class name is used as the first parameter, with the prefix &#039;Table&#039; as the second. Also, the getInstance() member function of JTable returns a JTableObject by reference instead of a value;.&lt;br /&gt;
 &lt;br /&gt;
=== Reserved Database Field Names ===&lt;br /&gt;
Some of the optional features of JTable require the existence of specially-named fields in the database table.  If you require this additional functionality you should ensure that these named fields are present in the table.  These field names should be considered reserved as any attempts to use them for purposes other than those supported by JTable may result in conflict.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field name&lt;br /&gt;
!Methods using the field name&lt;br /&gt;
|-&lt;br /&gt;
|checked_out&lt;br /&gt;
|[[JTable/checkOut|checkOut]], [[JTable/checkIn|checkIn]], [[JTable/isCheckedOut|isCheckedOut]]&lt;br /&gt;
|-&lt;br /&gt;
|checked_out_time&lt;br /&gt;
|[[JTable/checkOut|checkOut]], [[JTable/checkIn|checkIn]], [[JTable/isCheckedOut|isCheckedOut]]&lt;br /&gt;
|-&lt;br /&gt;
|hits&lt;br /&gt;
|[[JTable/hit|hit]]&lt;br /&gt;
|-&lt;br /&gt;
|ordering&lt;br /&gt;
|[[JTable/getNextOrder|getNextOrder]], [[JTable/reorder|reorder]], [[JTable/move|move]]&lt;br /&gt;
|-&lt;br /&gt;
|published&lt;br /&gt;
|[[JTable/publish|publish]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Check-in/check-out ====&lt;br /&gt;
Joomla tables implement a simple mechanism for preventing a [[wikipedia:race condition|race condition]] while editing rows in a database.  This depends on the existence of database fields called &amp;quot;checked_out&amp;quot; and &amp;quot;checked_out_time&amp;quot; and if these fields are present  in the view (JForm) &#039;&#039;&#039;JTable&#039;&#039;&#039; will automatically support this mechanism so that it can be easily used in your tables too.&lt;br /&gt;
&lt;br /&gt;
==== Hit counter ====&lt;br /&gt;
Some Joomla tables contain a field called &amp;quot;hits&amp;quot; which records the number of times that a table row has been accessed. JTable provides a simple method to increment this field: [https://api.joomla.org/cms-3/classes/JTable.html#method_hit hit].&lt;br /&gt;
&lt;br /&gt;
==== Example JForm fields for Reserved database names in JTable ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;state&amp;quot;&lt;br /&gt;
	type=&amp;quot;list&amp;quot;&lt;br /&gt;
	label=&amp;quot;JSTATUS&amp;quot;&lt;br /&gt;
	description=&amp;quot;JFIELD_PUBLISHED_DESC&amp;quot;&lt;br /&gt;
	size=&amp;quot;1&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;JPUBLISHED&amp;lt;/option&amp;gt;&lt;br /&gt;
	&amp;lt;option	value=&amp;quot;0&amp;quot;&amp;gt;JUNPUBLISHED&amp;lt;/option&amp;gt;&lt;br /&gt;
	&amp;lt;option	value=&amp;quot;2&amp;quot;&amp;gt;JARCHIVED&amp;lt;/option&amp;gt;&lt;br /&gt;
	&amp;lt;option	value=&amp;quot;-2&amp;quot;&amp;gt;JTRASHED&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;checked_out&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;checked_out_time&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;created_user_id&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_CREATED_BY_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;created_time&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_CREATED_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;modified_user_id&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_MODIFIED_BY_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;modified_time&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_MODIFIED_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;hits&amp;quot;&lt;br /&gt;
	type=&amp;quot;text&amp;quot;&lt;br /&gt;
	id=&amp;quot;hits&amp;quot;&lt;br /&gt;
	class=&amp;quot;readonly&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_HITS&amp;quot;&lt;br /&gt;
	size=&amp;quot;20&amp;quot;&lt;br /&gt;
	readonly=&amp;quot;true&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Useful Member Functions===&lt;br /&gt;
* [[JTable/load]]&lt;br /&gt;
* [[JTable/bind]]&lt;br /&gt;
* [[JTable/check]]&lt;br /&gt;
* [[JTable/store]]&lt;br /&gt;
* [[JTable/save]] Method to provide a shortcut to binding, checking and storing a JTable instance to the database table.&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
* [[J3.2:Developing a MVC Component/Using the database#admin.2Ftables.2Fhelloworld.php | Part 7 of J3.2:Developing a MVC Component/Using the database]]&lt;br /&gt;
*[[J2.5:Developing a MVC Component/Adding configuration#admin.2Ftables.2Fhelloworld.php | Part 14 of J2.5:Developing a MVC Component/Adding configuration]]&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
When properly extended, JTable gives you all of the basic functions you need for managing and retrieving records in a database table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Extension development]]&lt;br /&gt;
[[Category:JTable]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Using_the_JTable_class&amp;diff=200182</id>
		<title>Using the JTable class</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Using_the_JTable_class&amp;diff=200182"/>
		<updated>2015-07-02T17:23:41Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Add Example JForm fields for Reserved database names in JTable&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial is for {{JVer|3.x}}&lt;br /&gt;
&lt;br /&gt;
== Introduction to JTable ==&lt;br /&gt;
The [https://api.joomla.org/cms-3/classes/JTable.html JTable] class is an implementation of the [http://en.wikipedia.org/wiki/Active_record_pattern Active Record] design pattern. It is used throughout Joomla! for [http://en.wikipedia.org/wiki/Create,_read,_update_and_delete creating, reading, updating, and deleting] records in the database table. &lt;br /&gt;
&lt;br /&gt;
Since JTable is an abstract class that forms the basis for all database table classes. Some of the methods listed will be overridden by the child class so you should check the child class documentation for further information. Also take note that as of Joomla 2.5, JTable properties are automatically generated based on the schema of the specified table, which means you don&#039;t need to declare Member variables in your class.&lt;br /&gt;
&lt;br /&gt;
Each physical database table created should have a corresponding class derived from JTable to represent it. JTable provides many methods to make common manipulations to the table much simpler. For example, one of the most common operations you will need to perform is to read a table row into memory given a value for the primary key. This can be done easily using the load method. The table row can then be just as easily updated using the save method, which also performs any predefined sanity checks on the table fields.&lt;br /&gt;
&lt;br /&gt;
== Writing an extension of JTable ==&lt;br /&gt;
To use JTable, you will create an extension of the JTable class. In this example, we have a database table &amp;quot;#__recipes&amp;quot; with an autoincrementing primary key &amp;quot;id&amp;quot; containing all of our recipes. We&#039;ll store this &lt;br /&gt;
&lt;br /&gt;
The only thing we need to do to start using JTables is create a constructor in our extended JTable class. The class constructor will call the parent constructor to get the table, all it needs is the name of the table, the name of the primary key column, and the database instance.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die();&lt;br /&gt;
&lt;br /&gt;
class TableRecipes extends JTable&lt;br /&gt;
{&lt;br /&gt;
	public function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct( &#039;#__recipes&#039;, &#039;id&#039;, $db );&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you were using this class as a part of a backend component called &#039;Recipes&#039;, you would place this code in the file /administrator/components/com_recipes/tables/recipes.php.&lt;br /&gt;
&lt;br /&gt;
You can use this functionality in plugins just as components, i.e.. As a general rule you should avoid writing to the database from a module, and use plugins/components for this. Remember to use the built-in [[constants]] when linking to a custom path (outside the &#039;adminstrator/{com_nameofyourcomponent}/tables&#039; folder).&lt;br /&gt;
&lt;br /&gt;
== Using a JTable class extension ==&lt;br /&gt;
&lt;br /&gt;
Once the table class is in place we can use it in our model getTable() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
public function getTable($type = &#039;Recipes&#039;, $prefix = &#039;Table&#039;, $config = array())&lt;br /&gt;
{&lt;br /&gt;
	return JTable::getInstance($type, $prefix, $config);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use your JTable class in any Joomla! extension by using JTable::addIncludePath() in your extension&#039;s source code (use com_nameofyourcomponent in place of com_recipes):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JTable::addIncludePath(JPATH_ADMINISTRATOR . &#039;/components/com_recipes/tables&#039;);&lt;br /&gt;
$row = JTable::getInstance(&#039;recipes&#039;, &#039;Table&#039;, array());&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the lowercase version of the suffix of your class name is used as the first parameter, with the prefix &#039;Table&#039; as the second. Also, the getInstance() member function of JTable returns a JTableObject by reference instead of a value;.&lt;br /&gt;
 &lt;br /&gt;
=== Reserved Database Field Names ===&lt;br /&gt;
Some of the optional features of JTable require the existence of specially-named fields in the database table.  If you require this additional functionality you should ensure that these named fields are present in the table.  These field names should be considered reserved as any attempts to use them for purposes other than those supported by JTable may result in conflict.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field name&lt;br /&gt;
!Methods using the field name&lt;br /&gt;
|-&lt;br /&gt;
|checked_out&lt;br /&gt;
|[[JTable/checkOut|checkOut]], [[JTable/checkIn|checkIn]], [[JTable/isCheckedOut|isCheckedOut]]&lt;br /&gt;
|-&lt;br /&gt;
|checked_out_time&lt;br /&gt;
|[[JTable/checkOut|checkOut]], [[JTable/checkIn|checkIn]], [[JTable/isCheckedOut|isCheckedOut]]&lt;br /&gt;
|-&lt;br /&gt;
|hits&lt;br /&gt;
|[[JTable/hit|hit]]&lt;br /&gt;
|-&lt;br /&gt;
|ordering&lt;br /&gt;
|[[JTable/getNextOrder|getNextOrder]], [[JTable/reorder|reorder]], [[JTable/move|move]]&lt;br /&gt;
|-&lt;br /&gt;
|published&lt;br /&gt;
|[[JTable/publish|publish]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Check-in/check-out ====&lt;br /&gt;
Joomla tables implement a simple mechanism for preventing a [[wikipedia:race condition|race condition]] while editing rows in a database.  This depends on the existence of database fields called &amp;quot;checked_out&amp;quot; and &amp;quot;checked_out_time&amp;quot; and if these fields are present  in the view (JForm) &#039;&#039;&#039;JTable&#039;&#039;&#039; will automatically support this mechanism so that it can be easily used in your tables too.&lt;br /&gt;
&lt;br /&gt;
==== Hit counter ====&lt;br /&gt;
Some Joomla tables contain a field called &amp;quot;hits&amp;quot; which records the number of times that a table row has been accessed. JTable provides a simple method to increment this field: [https://api.joomla.org/cms-3/classes/JTable.html#method_hit hit].&lt;br /&gt;
&lt;br /&gt;
==== Example JForm fields for Reserved database names in JTable ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;state&amp;quot;&lt;br /&gt;
	type=&amp;quot;list&amp;quot;&lt;br /&gt;
	label=&amp;quot;JSTATUS&amp;quot;&lt;br /&gt;
	description=&amp;quot;JFIELD_PUBLISHED_DESC&amp;quot;&lt;br /&gt;
	size=&amp;quot;1&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;JPUBLISHED&amp;lt;/option&amp;gt;&lt;br /&gt;
	&amp;lt;option	value=&amp;quot;0&amp;quot;&amp;gt;JUNPUBLISHED&amp;lt;/option&amp;gt;&lt;br /&gt;
	&amp;lt;option	value=&amp;quot;2&amp;quot;&amp;gt;JARCHIVED&amp;lt;/option&amp;gt;&lt;br /&gt;
	&amp;lt;option	value=&amp;quot;-2&amp;quot;&amp;gt;JTRASHED&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;checked_out&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;checked_out_time&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;created_user_id&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_CREATED_BY_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;created_time&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_CREATED_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;modified_user_id&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_MODIFIED_BY_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;modified_time&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_FIELD_MODIFIED_LABEL&amp;quot;&lt;br /&gt;
	type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;field	name=&amp;quot;hits&amp;quot;&lt;br /&gt;
	type=&amp;quot;text&amp;quot;&lt;br /&gt;
	id=&amp;quot;hits&amp;quot;&lt;br /&gt;
	class=&amp;quot;readonly&amp;quot;&lt;br /&gt;
	label=&amp;quot;JGLOBAL_HITS&amp;quot;&lt;br /&gt;
	size=&amp;quot;20&amp;quot;&lt;br /&gt;
	readonly=&amp;quot;true&amp;quot;&lt;br /&gt;
	filter=&amp;quot;unset&amp;quot;&lt;br /&gt;
	/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Useful Member Functions===&lt;br /&gt;
* [[JTable/load]]&lt;br /&gt;
* [[JTable/bind]]&lt;br /&gt;
* [[JTable/check]]&lt;br /&gt;
* [[JTable/store]]&lt;br /&gt;
* [[JTable/save]] Method to provide a shortcut to binding, checking and storing a JTable instance to the database table.&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
* [[J3.2:Developing a MVC Component/Using the database#admin.2Ftables.2Fhelloworld.php | Part 7 of J3.2:Developing a MVC Component/Using the database]]&lt;br /&gt;
*[[J2.5:Developing a MVC Component/Adding configuration#admin.2Ftables.2Fhelloworld.php | Part 14 of J2.5:Developing a MVC Component/Adding configuration]]&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
When properly extended, JTable gives you all of the basic functions you need for managing and retrieving records in a database table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Development]][[Category:JTable]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=File_form_field_type&amp;diff=199590</id>
		<title>File form field type</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=File_form_field_type&amp;diff=199590"/>
		<updated>2015-07-01T18:23:48Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Add Labelclass and showon. Include some more catagories&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Ambox|type=notice|text=In Joomla! 1.5, [[Form field|form fields]] were [[Parameter|parameters]]. For that version, you may want to use the corresponding [[Text parameter type]].}}&lt;br /&gt;
&lt;br /&gt;
Intro: todo&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;type&#039;&#039;&#039; (mandatory) must be &#039;&#039;file&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; (mandatory) is the unique name of the field.&lt;br /&gt;
* &#039;&#039;&#039;label&#039;&#039;&#039; (mandatory) (translatable) is the descriptive title of the field.&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039; (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.&lt;br /&gt;
* &#039;&#039;&#039;default&#039;&#039;&#039; (optional) (not translatable) is the default value, but doesn&#039;t mean much for a file.&lt;br /&gt;
* &#039;&#039;&#039;size&#039;&#039;&#039; (optional) is the width of the file box in characters. &lt;br /&gt;
* [http://www.w3schools.com/tags/att_input_accept.asp &#039;&#039;&#039;accept&#039;&#039;&#039;] (optional) Tells the browser what MIME types your form will allow to be uploaded.&lt;br /&gt;
* &#039;&#039;&#039;class&#039;&#039;&#039; (optional) is a CSS class name for the HTML form field.&lt;br /&gt;
* &#039;&#039;&#039;labelclass&#039;&#039;&#039; (optional) adds a CSS class for form field&#039;s label; for Joomla 2.5.4+&lt;br /&gt;
* &#039;&#039;&#039;disabled&#039;&#039;&#039; (optional)  HTML equivalent attribute&lt;br /&gt;
* &#039;&#039;&#039;onchange&#039;&#039;&#039; (optional)  HTML equivalent attribute (javascript use)&lt;br /&gt;
* &#039;&#039;&#039;required&#039;&#039;&#039; (optional)  For Joomla form validating it to be filled in&lt;br /&gt;
* &#039;&#039;&#039;validate&#039;&#039;&#039; (optional)  Whether to Joomla validate the field according to rules&lt;br /&gt;
* &#039;&#039;&#039;showon&#039;&#039;&#039; (optional)  Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;&lt;br /&gt;
When using the file input type you should always add the attribute enctype=&amp;quot;multipart/form-data&amp;quot; to your form tag. Otherwise, the uploaded files will not be attached correctly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note 2:&#039;&#039;&#039;&lt;br /&gt;
You can put a soft limit file size by adding a hidden field with name=&amp;quot;MAX_FILE_SIZE&amp;quot; and value the maximum allowed bytes which is handled by php, but you must also handle it in your code with or without it.&lt;br /&gt;
Example XML field definition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field name=&amp;quot;myfilevalue&amp;quot; type=&amp;quot;file&amp;quot; label=&amp;quot;Enter some text&amp;quot; description=&amp;quot;Choose an image from your computer with maximum 100KB&amp;quot; size=&amp;quot;10&amp;quot; accept=&amp;quot;image/*&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
&lt;br /&gt;
* [[Standard form field types|List of standard form field types]]&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Standard form field types]]&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>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Using_the_JToolbar_class_in_the_frontend&amp;diff=197059</id>
		<title>J3.x:Using the JToolbar class in the frontend</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Using_the_JToolbar_class_in_the_frontend&amp;diff=197059"/>
		<updated>2015-06-26T11:39:31Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Update based on Joomla 3 backend views&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{page|needs review}}{{RightTOC}}&lt;br /&gt;
&lt;br /&gt;
NOTE: This documentation was not previously updated for Joomla! 3.2. I have made some updates to bring it closer to what is needed for Joomla! 3 but admittedly, I still don&#039;t have this functionality working. Additional corrections and contributions would be greatly appreciated! Erik Jorgensen 12/10/2013.&lt;br /&gt;
&lt;br /&gt;
== Using JToolBar ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s now simpler to use JToolBar in the front end than it was in Joomla! 1.5 as it only requires two steps.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
===Step 1===&lt;br /&gt;
Add the toolbar to your view display function&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;gt;&lt;br /&gt;
function display($tpl = null)&lt;br /&gt;
{&lt;br /&gt;
	...&lt;br /&gt;
	// Set the toolbar&lt;br /&gt;
	$input-&amp;gt;set(&#039;hidemainmenu&#039;, true);&lt;br /&gt;
	$this-&amp;gt;addToolbar();&lt;br /&gt;
	parent::display($tpl);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 2===&lt;br /&gt;
Add an addToolbar() function to view.html.php file in the view you wish to add the toolbar to (this function could possibly be placed in a helper function).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;gt;&lt;br /&gt;
	protected function addToolbar()&lt;br /&gt;
	{&lt;br /&gt;
		$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
                &lt;br /&gt;
		// Add whatever buttons you require&lt;br /&gt;
		JToolBarHelper::save(&#039;yourcom.save&#039;);&lt;br /&gt;
		JToolbarHelper::divider();&lt;br /&gt;
		JToolBarHelper::cancel(&#039;yourcom.cancel&#039;);&lt;br /&gt;
		JToolbarHelper::divider();&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Needs to be marked for translation]]&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Using_the_JTable_class&amp;diff=197057</id>
		<title>Using the JTable class</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Using_the_JTable_class&amp;diff=197057"/>
		<updated>2015-06-26T11:04:51Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: recreate JTable use example for joomla 3 (also pull in text from other examples by Chris Davenport)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial is for {{JVer|3.x}}&lt;br /&gt;
&lt;br /&gt;
== Introduction to JTable ==&lt;br /&gt;
The [https://api.joomla.org/cms-3/classes/JTable.html JTable] class is an implementation of the [http://en.wikipedia.org/wiki/Active_record_pattern Active Record] design pattern. It is used throughout Joomla! for [http://en.wikipedia.org/wiki/Create,_read,_update_and_delete creating, reading, updating, and deleting] records in the database table. &lt;br /&gt;
&lt;br /&gt;
Since JTable is an abstract class that forms the basis for all database table classes. Some of the methods listed will be overridden by the child class so you should check the child class documentation for further information. Also take note that as of Joomla 2.5, JTable properties are automatically generated based on the schema of the specified table, which means you don&#039;t need to declare Member variables in your class.&lt;br /&gt;
&lt;br /&gt;
Each physical database table created should have a corresponding class derived from JTable to represent it. JTable provides many methods to make common manipulations to the table much simpler. For example, one of the most common operations you will need to perform is to read a table row into memory given a value for the primary key. This can be done easily using the load method. The table row can then be just as easily updated using the save method, which also performs any predefined sanity checks on the table fields.&lt;br /&gt;
&lt;br /&gt;
== Writing an extension of JTable ==&lt;br /&gt;
To use JTable, you will create an extension of the JTable class. In this example, we have a database table &amp;quot;#__recipes&amp;quot; with an autoincrementing primary key &amp;quot;id&amp;quot; containing all of our recipes. We&#039;ll store this &lt;br /&gt;
&lt;br /&gt;
The only thing we need to do to start using JTables is create a constructor in our extended JTable class. The class constructor will call the parent constructor to get the table, all it needs is the name of the table, the name of the primary key column, and the database instance.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die();&lt;br /&gt;
&lt;br /&gt;
class TableRecipes extends JTable&lt;br /&gt;
{&lt;br /&gt;
	public function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct( &#039;#__recipes&#039;, &#039;id&#039;, $db );&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you were using this class as a part of a backend component called &#039;Recipes&#039;, you would place this code in the file /administrator/components/com_recipes/tables/recipes.php.&lt;br /&gt;
&lt;br /&gt;
You can use this functionality in plugins just as components, i.e.. As a general rule you should avoid writing to the database from a module, and use plugins/components for this. Remember to use the built-in [[constants]] when linking to a custom path (outside the &#039;adminstrator/{com_nameofyourcomponent}/tables&#039; folder).&lt;br /&gt;
&lt;br /&gt;
== Using a JTable class extension ==&lt;br /&gt;
&lt;br /&gt;
Once the table class is in place we can use it in our model getTable() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
public function getTable($type = &#039;Recipes&#039;, $prefix = &#039;Table&#039;, $config = array())&lt;br /&gt;
{&lt;br /&gt;
	return JTable::getInstance($type, $prefix, $config);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use your JTable class in any Joomla! extension by using JTable::addIncludePath() in your extension&#039;s source code (use com_nameofyourcomponent in place of com_recipes):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JTable::addIncludePath(JPATH_ADMINISTRATOR . &#039;/components/com_recipes/tables&#039;);&lt;br /&gt;
$row = JTable::getInstance(&#039;recipes&#039;, &#039;Table&#039;, array());&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the lowercase version of the suffix of your class name is used as the first parameter, with the prefix &#039;Table&#039; as the second. Also, the getInstance() member function of JTable returns a JTableObject by reference instead of a value;.&lt;br /&gt;
 &lt;br /&gt;
=== Reserved Database Field Names ===&lt;br /&gt;
Some of the optional features of JTable require the existence of specially-named fields in the database table.  If you require this additional functionality you should ensure that these named fields are present in the table.  These field names should be considered reserved as any attempts to use them for purposes other than those supported by JTable may result in conflict.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field name&lt;br /&gt;
!Methods using the field name&lt;br /&gt;
|-&lt;br /&gt;
|checked_out&lt;br /&gt;
|[[JTable/checkOut|checkOut]], [[JTable/checkIn|checkIn]], [[JTable/isCheckedOut|isCheckedOut]]&lt;br /&gt;
|-&lt;br /&gt;
|checked_out_time&lt;br /&gt;
|[[JTable/checkOut|checkOut]], [[JTable/checkIn|checkIn]], [[JTable/isCheckedOut|isCheckedOut]]&lt;br /&gt;
|-&lt;br /&gt;
|hits&lt;br /&gt;
|[[JTable/hit|hit]]&lt;br /&gt;
|-&lt;br /&gt;
|ordering&lt;br /&gt;
|[[JTable/getNextOrder|getNextOrder]], [[JTable/reorder|reorder]], [[JTable/move|move]]&lt;br /&gt;
|-&lt;br /&gt;
|published&lt;br /&gt;
|[[JTable/publish|publish]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Check-in/check-out ====&lt;br /&gt;
Joomla tables implement a simple mechanism for preventing a [[wikipedia:race condition|race condition]] while editing rows in a database.  This depends on the existence of database fields called &amp;quot;checked_out&amp;quot; and &amp;quot;checked_out_time&amp;quot; and if these fields are present &#039;&#039;&#039;JTable&#039;&#039;&#039; will automatically support this mechanism so that it can be easily used in your tables too.&lt;br /&gt;
&lt;br /&gt;
==== Hit counter ====&lt;br /&gt;
Some Joomla tables contain a field called &amp;quot;hits&amp;quot; which records the number of times that a table row has been accessed. JTable provides a simple method to increment this field: [https://api.joomla.org/cms-3/classes/JTable.html#method_hit hit].&lt;br /&gt;
&lt;br /&gt;
===Useful Member Functions===&lt;br /&gt;
* [[JTable/load]]&lt;br /&gt;
* [[JTable/bind]]&lt;br /&gt;
* [[JTable/check]]&lt;br /&gt;
* [[JTable/store]]&lt;br /&gt;
* [[JTable/save]] Method to provide a shortcut to binding, checking and storing a JTable instance to the database table.&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
* [[J3.2:Developing a MVC Component/Using the database#admin.2Ftables.2Fhelloworld.php | Part 7 of J3.2:Developing a MVC Component/Using the database]]&lt;br /&gt;
*[[J2.5:Developing a MVC Component/Adding configuration#admin.2Ftables.2Fhelloworld.php | Part 14 of J2.5:Developing a MVC Component/Adding configuration]]&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
When properly extended, JTable gives you all of the basic functions you need for managing and retrieving records in a database table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Development]][[Category:JTable]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=API16:JTable&amp;diff=197056</id>
		<title>API16:JTable</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=API16:JTable&amp;diff=197056"/>
		<updated>2015-06-26T11:04:08Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: fix content duplication&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Description:JTable}}&lt;br /&gt;
&lt;br /&gt;
===Defined in===&lt;br /&gt;
libraries/joomla/database/table.php&lt;br /&gt;
===Methods===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Method name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/__construct|__construct]]&lt;br /&gt;
|Object constructor to set table and key fields. In most cases this will be overridden by child classes to explicitly set the table and key fields for a particular database table.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/getFields|getFields]]&lt;br /&gt;
|Get the columns from database table.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/getTableName|getTableName]]&lt;br /&gt;
|Method to get the database table name for the class.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/getKeyName|getKeyName]]&lt;br /&gt;
|Method to get the primary key field name for the table.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/getDbo|getDbo]]&lt;br /&gt;
|Method to get the JDatabase connector object.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/setDBO|setDBO]]&lt;br /&gt;
|Method to set the JDatabase connector object.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/setRules|setRules]]&lt;br /&gt;
|Method to set rules for the record.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/getRules|getRules]]&lt;br /&gt;
|Method to get the rules for the record.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/reset|reset]]&lt;br /&gt;
|Method to reset class properties to the defaults set in the class definition. It will ignore the primary key as well as any private class properties.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/bind|bind]]&lt;br /&gt;
|Method to bind an associative array or object to the JTable instance.This method only binds properties that are publicly accessible and optionally takes an array of properties to ignore when binding.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/load|load]]&lt;br /&gt;
|Method to load a row from the database by primary key and bind the fields to the JTable instance properties.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/check|check]]&lt;br /&gt;
|Method to perform sanity checks on the JTable instance properties to ensure they are safe to store in the database. Child classes should override this method to make sure the data they are storing in the database is safe and as expected before storage.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/store|store]]&lt;br /&gt;
|Method to store a row in the database from the JTable instance properties. If a primary key value is set the row with that primary key value will be updated with the instance property values. If no primary key value is set a new row will be inserted into the database with the properties from the JTable instance.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/save|save]]&lt;br /&gt;
|Method to provide a shortcut to binding, checking and storing a JTable instance to the database table. The method will check a row in once the data has been stored and if an ordering filter is present will attempt to reorder the table rows based on the filter. The ordering filter is an instance property name. The rows that will be reordered are those whose value matches the JTable instance for the property specified.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/delete|delete]]&lt;br /&gt;
|Method to delete a row from the database table by primary key value.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/checkOut|checkOut]]&lt;br /&gt;
|Method to check a row out if the necessary properties/fields exist. To prevent race conditions while editing rows in a database, a row can be checked out if the fields &#039;checked_out&#039; and &#039;checked_out_time&#039; are available. While a row is checked out, any attempt to store the row by a user other than the one who checked the row out should be held until the row is checked in again.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/checkIn|checkIn]]&lt;br /&gt;
|Method to check a row in if the necessary properties/fields exist. Checking a row in will allow other users the ability to edit the row.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/hit|hit]]&lt;br /&gt;
|Method to increment the hits for a row if the necessary property/field exists.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/isCheckedOut|isCheckedOut]]&lt;br /&gt;
|TODO: This either needs to be static or not.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/getNextOrder|getNextOrder]]&lt;br /&gt;
|Method to get the next ordering value for a group of rows defined by an SQL WHERE clause. This is useful for placing a new item last in a group of items in the table.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/reorder|reorder]]&lt;br /&gt;
|Method to compact the ordering values of rows in a group of rows defined by an SQL WHERE clause.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/move|move]]&lt;br /&gt;
|Method to move a row in the ordering sequence of a group of rows defined by an SQL WHERE clause. Negative numbers move the row up in the sequence and positive numbers move it down.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/publish|publish]]&lt;br /&gt;
|Method to set the publishing state for a row or list of rows in the database table. The method respects checked out rows by other users and will attempt to checkin rows that it can after adjustments are made.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/canDelete|canDelete]]&lt;br /&gt;
|Generic check for whether dependancies exist for this object in the database schema&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/toXML|toXML]]&lt;br /&gt;
|Method to export the JTable instance properties to an XML string.&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/getInstance|getInstance]]&lt;br /&gt;
|Static method to get an instance of a JTable class if it can be found in the table include paths. To add include paths for searching for JTable classes JTable::addIncludePath().&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JTable/addIncludePath|addIncludePath]]&lt;br /&gt;
|Add a filesystem path where JTable should search for table class files. You may either pass a string or an array of paths.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Importing===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;jimport( &#039;joomla.database.table&#039; );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Development]][[Category:JTable]][[Category:CodeExample]][[Category:ClassExample]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=API16:JForm/setValue&amp;diff=196726</id>
		<title>API16:JForm/setValue</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=API16:JForm/setValue&amp;diff=196726"/>
		<updated>2015-06-24T19:23:42Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Remove edit junk&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Description===&lt;br /&gt;
Method to set the value of a field.&lt;br /&gt;
&lt;br /&gt;
===Syntax===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;setValue($field, $value, $group= &#039;_default&#039;)&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameter Name&lt;br /&gt;
!Default Value&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
| $field&lt;br /&gt;
| &lt;br /&gt;
|  $field The field to set. &lt;br /&gt;
|-&lt;br /&gt;
| $value&lt;br /&gt;
| &lt;br /&gt;
|  $value The value to set the field to. &lt;br /&gt;
|-&lt;br /&gt;
| $group&lt;br /&gt;
| &#039;_default&#039;&lt;br /&gt;
|  $group The group the field is in. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
boolean True if field exists, false otherwise. &lt;br /&gt;
&lt;br /&gt;
===Defined in===&lt;br /&gt;
libraries/joomla/form/form.php&lt;br /&gt;
===Importing===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;jimport( &#039;joomla.form.form&#039; );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Source Body===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
public function setValue($field, $value, $group = &#039;_default&#039;)&lt;br /&gt;
{&lt;br /&gt;
        // Set the field if it exists.&lt;br /&gt;
        if (isset($this-&amp;gt;_groups[$group][$field]) &amp;amp;&amp;amp; is_object($this-&amp;gt;_groups[$group][$field])) {&lt;br /&gt;
                $this-&amp;gt;_data[$group][$field] = $value;&lt;br /&gt;
                return true;&lt;br /&gt;
        } else {&lt;br /&gt;
                return false;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&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;! removed edit link to red link &amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;! removed transcluded page call, red link never existed &amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examples===&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=setValue&lt;br /&gt;
 category=JForm&lt;br /&gt;
 category=CodeExample&lt;br /&gt;
 category=MethodExample&lt;br /&gt;
 include=*&lt;br /&gt;
 format= ,,,&lt;br /&gt;
&amp;lt;/dpl&amp;gt;&lt;br /&gt;
[[Category:Archived pages API16]]&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Model-View-Controller&amp;diff=196575</id>
		<title>Model-View-Controller</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Model-View-Controller&amp;diff=196575"/>
		<updated>2015-06-24T17:07:30Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Format fix due to translate tags&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;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
{{Chunk:Model-View-Controller/en}}&lt;br /&gt;
==See Also== &amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
* [[Understanding Output Overrides]]&lt;br /&gt;
* [[Developers]]&lt;br /&gt;
* [http://api.joomla.org/11.4/Joomla-Platform/Application/JModel.html JModel]&lt;br /&gt;
* [https://api.joomla.org/cms-3/classes/JModelLegacy.html JModelLegacy {{JVer|2.5}} and newer]&lt;br /&gt;
* [https://api.joomla.org/cms-3/classes/JModelAdmin.html JModelAdmin {{JVer|2.5}} and newer]&lt;br /&gt;
* [https://api.joomla.org/cms-3/classes/JModelBase.html JModelBase {{JVer|3.x}}]&lt;br /&gt;
* [http://api.joomla.org/11.4/Joomla-Platform/Application/JView.html JView]&lt;br /&gt;
* [https://api.joomla.org/cms-3/classes/JViewLegacy.html JViewLegacy {{JVer|2.5}} and newer]&lt;br /&gt;
* [https://api.joomla.org/cms-3/classes/JViewBase.html JViewBase {{JVer|3.x}}]&lt;br /&gt;
* [http://api.joomla.org/11.4/Joomla-Platform/Application/JController.html JController]&lt;br /&gt;
* [https://api.joomla.org/cms-3/classes/JControllerForm.html JControllerForm {{JVer|2.5}} and newer]&lt;br /&gt;
* [https://api.joomla.org/cms-3/classes/JControllerAdmin.html JControllerAdmin {{JVer|2.5}} and newer]&lt;br /&gt;
* [https://api.joomla.org/cms-3/classes/JControllerBase.html JControllerBase {{JVer|3.x}}]&lt;br /&gt;
&lt;br /&gt;
===Component development series=== &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 column&amp;quot;&amp;gt;&lt;br /&gt;
====Developing a MVC Component for J3.x ==== &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
[[J3.2:Developing a MVC Component/Introduction|Introduction to Developing a 3.x MVC]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 column&amp;quot;&amp;gt;&lt;br /&gt;
====Developing a MVC Component for J2.5 ==== &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
[[J2.5:Developing a MVC Component/Introduction|Introduction to Developing a 2.5 MVC]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
[[Category:Landing Pages]][[Category:Glossary]]&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Model-View-Controller&amp;diff=196574</id>
		<title>Model-View-Controller</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Model-View-Controller&amp;diff=196574"/>
		<updated>2015-06-24T17:05:44Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Add some of the newer MVC items&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages/&amp;gt;&amp;lt;/noinclude&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
{{Chunk:Model-View-Controller/en}}&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;==See Also== &amp;lt;!--T:2--&amp;gt;&amp;lt;/translate&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
* [[Understanding Output Overrides]]&lt;br /&gt;
* [[Developers]]&lt;br /&gt;
* [http://api.joomla.org/11.4/Joomla-Platform/Application/JModel.html JModel]&lt;br /&gt;
* [https://api.joomla.org/cms-3/classes/JModelLegacy.html JModelLegacy {{JVer|2.5}} and newer]&lt;br /&gt;
* [https://api.joomla.org/cms-3/classes/JModelAdmin.html JModelAdmin {{JVer|2.5}} and newer]&lt;br /&gt;
* [https://api.joomla.org/cms-3/classes/JModelBase.html JModelBase {{JVer|3.x}}]&lt;br /&gt;
* [http://api.joomla.org/11.4/Joomla-Platform/Application/JView.html JView]&lt;br /&gt;
* [https://api.joomla.org/cms-3/classes/JViewLegacy.html JViewLegacy {{JVer|2.5}} and newer]&lt;br /&gt;
* [https://api.joomla.org/cms-3/classes/JViewBase.html JViewBase {{JVer|3.x}}]&lt;br /&gt;
* [http://api.joomla.org/11.4/Joomla-Platform/Application/JController.html JController]&lt;br /&gt;
* [https://api.joomla.org/cms-3/classes/JControllerForm.html JControllerForm {{JVer|2.5}} and newer]&lt;br /&gt;
* [https://api.joomla.org/cms-3/classes/JControllerAdmin.html JControllerAdmin {{JVer|2.5}} and newer]&lt;br /&gt;
* [https://api.joomla.org/cms-3/classes/JControllerBase.html JControllerBase {{JVer|3.x}}]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;===Component development series=== &amp;lt;!--T:3--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 column&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;====Developing a MVC Component for J3.x ==== &amp;lt;!--T:4--&amp;gt;&amp;lt;/translate&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
[[J3.2:Developing a MVC Component/Introduction|Introduction to Developing a 3.x MVC]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 column&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;====Developing a MVC Component for J2.5 ==== &amp;lt;!--T:5--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;[[J2.5:Developing a MVC Component/Introduction|Introduction to Developing a 2.5 MVC]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
[[Category:Landing Pages]][[Category:Glossary]]&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
__NOTOC__&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=JController_and_its_subclass_usage_overview&amp;diff=196573</id>
		<title>JController and its subclass usage overview</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=JController_and_its_subclass_usage_overview&amp;diff=196573"/>
		<updated>2015-06-24T17:00:59Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Update some controller info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Version|1.5,2.5,3.x}}&lt;br /&gt;
=== Preface ===&lt;br /&gt;
You should be familiar with the [[MVC|Joomla! MVC pattern]] before reading this topic.&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
In Joomla! 2.5 and 3.x, lots of MVC improvements were added. These improvements make a developer&#039;s task easier. In Joomla! 1.5, there is only one Controller class named JController. In Joomla! 2.5, &#039;&#039;&#039;JControllerAdmin&#039;&#039;&#039; and &#039;&#039;&#039;JControllerForm&#039;&#039;&#039; have been added as subclasses of &#039;&#039;&#039;JControllerLegacy&#039;&#039;&#039;. So there is a different usage for these three classes in Joomla! component development. This is a pattern used by most of the Joomla! core components such as [https://github.com/joomla/joomla-cms/tree/2.5.x/administrator/components/com_content com_content] and [https://github.com/joomla/joomla-cms/tree/2.5.x/administrator/components/com_banners com_banners].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  {{JVer|1.5}}&lt;br /&gt;
!  {{JVer|2.5}}&lt;br /&gt;
!  {{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
| JController&lt;br /&gt;
| JController&lt;br /&gt;
(since 2.5.5 use JControllerLegacy for forward compatibility)&lt;br /&gt;
| JControllerLegacy&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| JControllerAdmin&lt;br /&gt;
| JControllerAdmin&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| JControllerForm&lt;br /&gt;
| JControllerForm&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| JControllerBase (new MVC)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If you look at the admin code for [https://github.com/joomla/joomla-cms/tree/2.5.x/administrator/components/com_content &#039;&#039;&#039;com_content&#039;&#039;&#039;], you will find controller classes located in two places:  the root folder and the controllers folder. In the root folder there is a file named &#039;controller.php&#039;, this is the master controller of the component. It is a direct subclass of &#039;&#039;&#039;JControllerLegacy&#039;&#039;&#039;. In the controllers folder, there are many files named according to entities in the component e.g. article and articles. These controllers subclass either &#039;&#039;&#039;JControllerAdmin&#039;&#039;&#039; or &#039;&#039;&#039;JControllerForm&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Master Controller ===&lt;br /&gt;
&lt;br /&gt;
The master controller found in the root folder is only responsible for the display task. This is the default task for JControllerLegacy. If you look at JControllerLegacy::getInstance in com_content/content.php, only the component name was passed as a parameter. In JControllerLegacy, it uses the task variable (from the request) to determine what Controller class to load. If the task variable contains a dot (.), it assumes that this variable is in the form of controller.task or controller.method. You should know that task variable specifies method of controller to run. Then in this case, it will load controller class in controllers folder and rewrite task variable to real task. If the task does not contain a dot (.), JControllerLegacy will load the master controller located in the root folder. To simplify, we will refer to controllers in &#039;controllers&#039; folder as subcontroller. You may notice that in the master controller, a default view is also specified. If there is no view variable in the URL request, this one will be used. So in general, we can conclude:&lt;br /&gt;
* To use the master controller, specify a view variable as view name to use or the default one will be used.&lt;br /&gt;
* To use a subcontroller, specify the task variable in the form of controller.task, clearly specified CONTROLLER_NAME.CONTROLLER_METHOD.&lt;br /&gt;
&lt;br /&gt;
We can categorize display into two types: presenting a list of records (&#039;&#039;&#039;list view&#039;&#039;&#039;) and showing a detailed record item to the user (e.g. &#039;&#039;&#039;edit form&#039;&#039;&#039;). If we look at the articles view in com_content which displays a list of records to the user, we may notice that toolbar buttons are added according to user rights. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;editToolbar&amp;quot;&amp;gt;&lt;br /&gt;
[https://github.com/joomla/joomla-cms/blob/2.5.x/administrator/components/com_content/views/articles/view.html.php &#039;&#039;$JOOMLA_INSTALL/administrator/components/com_content/views/articles/view.html.php&#039;&#039;]&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 protected function addToolbar()&lt;br /&gt;
 {&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
   if (($canDo-&amp;gt;get(&#039;core.edit&#039;)) || ($canDo-&amp;gt;get(&#039;core.edit.own&#039;))) {&lt;br /&gt;
     JToolBarHelper::editList(&#039;article.edit&#039;);&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, to edit an article the task variable would be article.edit. This will cause the article subcontroller to be loaded and the edit method to be executed. You may have a question, this mean we will display edit form to user. That is right! In general we do that, but in Joomla! 2.5 core component, it just sets the article id to be edit in the user session and redirects it to an URL like &amp;amp;view=article&amp;amp;layout=edit. And this will be handled by master controller and edit form will be presented to user. So in this case, all display will be handled by master controller and needed views.&lt;br /&gt;
&lt;br /&gt;
* If a view name is not defined in URL, default view is used and a default task (display) will be executed. We use this to display a list of records. For example, index.php?option=com_content.&lt;br /&gt;
* If a view is defined but the task is not, master controller loads specified view and executes display method. This is also used to display a list of records. For example, index.php?option=com_content&amp;amp;view=articles.&lt;br /&gt;
* If a view is specified with a task (but not in the dot format), master controller loads the specified view and executes method specified by task. This case is used to display edit form, or to present one item of record to user. An example is index.php?option=com_content&amp;amp;view=article&amp;amp;layout=edit.&lt;br /&gt;
&lt;br /&gt;
When the master controller a creates view, it normally loads a model having the same name as the view and pushes model into the view. Then the view&#039;s display method is called. Doing this, in view we can get data from model using function like $this-&amp;gt;get(&amp;quot;Items&amp;quot;). In this case, view will look for method getItems in model and execute it. Doing this, we can use one controller for display all information type in component. But many views still required. This reduces the controller class and, of course, reduces code produced by developer.&lt;br /&gt;
&lt;br /&gt;
=== Subcontrollers ===&lt;br /&gt;
Subcontrollers will handle all CRUD tasks. For tasks such as save, delete &amp;amp; publish that clearly do not need a view, the subcontroller just deletes or updates records and redirects the user back to list view. In this case the user must select at least one item of record, and we usually give the name of the controller in plural form such as &amp;quot;articles.delete&amp;quot;, &amp;quot;articles.publish_up&amp;quot; or &amp;quot;articles.publish_down&amp;quot;. This subcontroller is generally inherited from JControllerAdmin which suppress display method by default.&lt;br /&gt;
&lt;br /&gt;
The other type of CRUD, such as add or edit, at a first glance should prepare data and present the form to user. But in the core component for Joomla! 2.5, they did not do that. Looking at this kind of subcontrollers (for example ContentControllerArticle) one can see that they always are inherited from JControllerForm. But no form was presented to user in this request, it just stores item (the ID of the article) in user&#039;s session variable and redirects to master controller. As a task variable was not specified, the display method is executed as a default task. &lt;br /&gt;
&lt;br /&gt;
For example: first request being processed by subcontroller may contain task=article.edit and cid[]=3. Subcontroller will create URL like &amp;quot;index.php?option=com_content&amp;amp;view=article&amp;amp;layout=edit&amp;quot; and redirect the user to master controller.&lt;br /&gt;
&lt;br /&gt;
=== Contributors ===&lt;br /&gt;
*[[User:Mrs.siam|Prasit Gebsaap]]&lt;br /&gt;
*[[User:mcormier|Matthieu Cormier]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[category:Joomla! 2.5]]&lt;br /&gt;
[[Category:Joomla! 3.x]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Needs to be marked for translation]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Talk:Standard_form_field_types&amp;diff=182864</id>
		<title>Talk:Standard form field types</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Talk:Standard_form_field_types&amp;diff=182864"/>
		<updated>2015-05-22T20:43:53Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== type captcha ==&lt;br /&gt;
&lt;br /&gt;
The type captcha doesn&#039;t provide a list of captcha options available, that is type plugin, folder captcha. The type captcha provides an input for validating. And that applies to the default captcha, others could provide different ways. Should both be described? How to type the plugin folder captcha? [[User:Sovainfo|Sovainfo]] ([[User talk:Sovainfo|talk]]) 14:49, 10 September 2013 (CDT)&lt;br /&gt;
&lt;br /&gt;
== desired content? ==&lt;br /&gt;
&lt;br /&gt;
Would like to change the format of these documents. Wonder what kind of information people are looking for. Instead of providing all the options on all documents would like to point to one document with all options in alpha order. Maybe in table format with checks which styles support which option. [[User:Sovainfo|Sovainfo]] ([[User talk:Sovainfo|talk]]) 07:17, 16 September 2013 (CDT)&lt;br /&gt;
&lt;br /&gt;
:I think such a page is coming. One of the GSOC students (Achal) has been working on the form fields generally for Joomla 3 (see [[Text_form_field_type/3.2]]) - and that&#039;s how his page seems to be shaping up. So I&#039;d hold on this for now until that is complete. However in my opinion we still need a list of all the form fields we have available in the core like we have now (even if we don&#039;t keep the subpages). --[[User:Wilsonge|Wilsonge]] ([[User talk:Wilsonge|talk]]) 18:17, 16 September 2013 (CDT)&lt;br /&gt;
:: Hope he&#039;ll reconsider the layout. I prefer a concise one page above the tabbed window. Considering it is information for developers you might start with the example code! Maybe mention what script implements it. Or even show the script itself. [[User:Sovainfo|Sovainfo]] ([[User talk:Sovainfo|talk]]) 15:16, 17 September 2013 (CDT) &lt;br /&gt;
&lt;br /&gt;
== combo ==&lt;br /&gt;
&lt;br /&gt;
Haven&#039;t found the combo field type. Can it be removed? [[User:Sovainfo|Sovainfo]] ([[User talk:Sovainfo|talk]]) 07:19, 16 September 2013 (CDT)&lt;br /&gt;
&lt;br /&gt;
:I don&#039;t think the core doesn&#039;t use it - you&#039;re right - but it still seems to exist in the core code for people to use so we should be documenting it. https://github.com/joomla/joomla-cms/blob/master/libraries/joomla/form/fields/combo.php . --[[User:Wilsonge|Wilsonge]] ([[User talk:Wilsonge|talk]]) 18:12, 16 September 2013 (CDT)&lt;br /&gt;
:: ok, will work on it. [[User:Sovainfo|Sovainfo]] ([[User talk:Sovainfo|talk]]) 15:16, 17 September 2013 (CDT)&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Standard_form_field_types&amp;diff=182863</id>
		<title>Standard form field types</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Standard_form_field_types&amp;diff=182863"/>
		<updated>2015-05-22T20:40:33Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Numerous types of [[form field]] are built into Joomla!. The following table lists these standard types and their availability. Use the [[/Single-page reference|single-page reference]] if you want to print all existing form field documentation.&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}} Please note that many of these fields are available as [[Parameter|parameter types]] in Joomla! 1.5. For a list of parameter types, see [[J1.5:Standard parameter types]]. For a comparison between form field and parameter types, see [[Standard form field and parameter types]].&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;vertical-align:top; border:1px solid Sienna; background-color:Cornsilk;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:Wheat; font-weight:bold; text-align: left;&amp;quot;&lt;br /&gt;
!width=15%|Type&lt;br /&gt;
!width=65%|Description&lt;br /&gt;
!width=20%|Availability&lt;br /&gt;
|-&lt;br /&gt;
|[[Accesslevel form field type|accesslevel]]&lt;br /&gt;
|provides a drop down list of viewing access levels.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Cachehandler form field type|cachehandler]]&lt;br /&gt;
|provides a list of available cache handling options.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Calendar form field type|calendar]]&lt;br /&gt;
|provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Captcha form field type|captcha]]&lt;br /&gt;
|provides a drop down list of the captcha plugins.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Category form field type|category]]&lt;br /&gt;
|provides a drop down list of categories for an extension.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Checkbox form field type|checkbox]]&lt;br /&gt;
|provides a single checkbox to be checked or unchecked&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Checkboxes form field type|checkboxes]]&lt;br /&gt;
|provides unlimited checkboxes that can be used for multi-select.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ChromeStyle form field type|Chrome Style]]&lt;br /&gt;
|provides a list of template chrome style options grouped by template.&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Color form field type|color]]&lt;br /&gt;
|provides a color picker when clicking the input box.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ContentLanguage form field type|Content Language]]&lt;br /&gt;
|Provides a list of content languages.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Contenttype form field type|Content Type]]&lt;br /&gt;
|Provides a list of content types.&lt;br /&gt;
|{{JVer|3.1}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Combo form field type|combo]]&lt;br /&gt;
|provides a combo box field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Componentlayout form field type|componentlayout]]&lt;br /&gt;
|provides a grouped list of core and template alternate layouts for a component item.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Contentlanguage form field type|contentlanguage]]&lt;br /&gt;
|provides a list of installed content languages for use in conjunction with the language switcher plugin.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[DatabaseConnection form field type|Database Connection]]&lt;br /&gt;
|Provides a list of available database connections, optionally limiting to a given list.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Editor form field type|editor]]&lt;br /&gt;
|provides an editor area field.&lt;br /&gt;
|{{JVer|1.6}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Editors form field type|editors]]&lt;br /&gt;
|Provides a drop down list of the available WYSIWYG editors. Since {{JVer|2.5}} use [[Plugins form field type|plugins form field]] instead.&lt;br /&gt;
|{{JVer|1.6}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Email form field type|email]]&lt;br /&gt;
|provides an email field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[File form field type|file]]&lt;br /&gt;
|Provides an input field for files&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Filelist form field type|filelist]]&lt;br /&gt;
|provides a drop down list of files from a specified directory.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Folderlist form field type|folderlist]]&lt;br /&gt;
|provides a drop down list of folders from a specified directory.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Groupedlist form field type|groupedlist]]&lt;br /&gt;
|provides a drop down list of items organized into groups.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[HeaderTag form field type|header tag]]&lt;br /&gt;
|provides a drop down list of the header tags (h1-h6).&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Helpsite form field type|helpsite]]&lt;br /&gt;
|provides a drop down list of the help sites for your Joomla installation.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Hidden form field type|hidden]]&lt;br /&gt;
|provides a hidden field for saving a form field whose value cannot be altered directly by a user in the Administrator (it can be altered in code or by editing the &#039;&#039;params.ini&#039;&#039; file).&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Imagelist form field type|imagelist]]&lt;br /&gt;
|provides a drop down list of image files in a specified directory.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|[[Integer form field type|integer]]&lt;br /&gt;
|provides a drop down list of integers between a minimum and maximum.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Language form field type|language]]&lt;br /&gt;
|provides a drop down list of the installed languages for the Front-end or Back-end.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[List form field type|list]]&lt;br /&gt;
|provides a drop down list of custom-defined entries.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Media form field type|media]]&lt;br /&gt;
|provides modal access to the media manager for insertion of images with upload for users with appropriate permissions.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Menu form field type|menu]]&lt;br /&gt;
|provides a drop down list of the available menus from your Joomla site.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Menuitem form field type|Menu Item]]&lt;br /&gt;
|provides a drop down list of the available menu items from your Joomla site.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Meter form field type|meter]]&lt;br /&gt;
|Provides a meter to show value in a range.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Modulelayout form field type|Module Layout]]&lt;br /&gt;
|provides a list of alternative layout for a module grouped by core and template.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ModuleOrder form field type|Module Order]]&lt;br /&gt;
|Provides a drop down to set the ordering of module in a given position&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ModulePosition form field type|Module Position]]&lt;br /&gt;
|provides a text input to set the position of a module.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ModuleTag form field type|Module Tag]]&lt;br /&gt;
|provides a list of html5 elements (used to wrap a module in).&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Note form field type|note]]&lt;br /&gt;
|supports a one line text field.&lt;br /&gt;
|{{JVer|3.1}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Number form field type|number]]&lt;br /&gt;
|Provides a one line text box with up-down handles to set a number in the field.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Password form field type|password]]&lt;br /&gt;
|provides a text box for entry of a password.  The password characters will be obscured as they are entered.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Plugins form field type|plugins]]&lt;br /&gt;
|provides a list of plugins from a given folder.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Predefined List form field type|predefinedlist]]&lt;br /&gt;
|Form Field to load a list of predefined values.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Radio form field type|radio]]&lt;br /&gt;
|provides radio buttons to select different options.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Range form field type|range]]&lt;br /&gt;
|Provides a horizontal scroll bar to specify a value in a range.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Repeatable form field type|repeatable]]&lt;br /&gt;
|Allows form fields which can have as many options as the user desires.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Rules form field type|rules]]&lt;br /&gt;
|provides a matrix of group by action options for managing access control. Display depends on context.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Sessionhandler form field type|sessionhandler]]&lt;br /&gt;
|provides a drop down list of session handler options.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Spacer form field type|spacer]]&lt;br /&gt;
|provides a visual separator between form fields.  It is purely a visual aid and no value is stored.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[SQL form field type|sql]]&lt;br /&gt;
|provides a drop down list of entries obtained by running a query on the Joomla Database.  The first results column returned by the query provides the values for the drop down box.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Tag form field type|tag]]&lt;br /&gt;
|provides an entry point for tags (either AJAX or Nested).&lt;br /&gt;
|{{JVer|3.1}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Tel form field type|tel]]&lt;br /&gt;
|provides an input field for a telephone number.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Templatestyle form field type|templatestyle]]&lt;br /&gt;
|provides a drop down list of template styles.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Text form field type|text]]&lt;br /&gt;
|provides a text box for data entry.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Textarea form field type|textarea]]&lt;br /&gt;
|provides a text area for entry of multi-line text.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Timezone form field type|timezone]]&lt;br /&gt;
|provides a drop down list of time zones.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[URL form field type|URL]]&lt;br /&gt;
|provides a URL text input field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[User form field type|user]]&lt;br /&gt;
|Field to select a user from a modal list. Displays User Name and stores User ID&lt;br /&gt;
|{{JVer|1.6}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[UserActive form field type|useractive]]&lt;br /&gt;
|Field to show a list of available user active statuses. &lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Usergroup form field type|usergroup]]&lt;br /&gt;
|provides a drop down list of user groups. Since {{JVer|3.2}} use [[User Group List form field type|usergrouplist]] instead.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[User Group List form field type|usergrouplist]]&lt;br /&gt;
|Field to load a drop down list of available user groups. Replaces usergroup form field type.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[User State form field type|userstate]]&lt;br /&gt;
|Field to load a list of available users statuses.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Form fields]]&lt;br /&gt;
[[Category:Development Reference]]&lt;br /&gt;
[[Category:Needs to be marked for translation]]&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Standard_form_field_types&amp;diff=182862</id>
		<title>Standard form field types</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Standard_form_field_types&amp;diff=182862"/>
		<updated>2015-05-22T20:32:00Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: add since version use___ to Usergroup form field type&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Numerous types of [[form field]] are built into Joomla!. The following table lists these standard types and their availability. Use the [[/Single-page reference|single-page reference]] if you want to print all existing form field documentation.&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}} Please note that many of these fields are available as [[Parameter|parameter types]] in Joomla! 1.5. For a list of parameter types, see [[J1.5:Standard parameter types]]. For a comparison between form field and parameter types, see [[Standard form field and parameter types]].&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;vertical-align:top; border:1px solid Sienna; background-color:Cornsilk;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:Wheat; font-weight:bold; text-align: left;&amp;quot;&lt;br /&gt;
!width=15%|Type&lt;br /&gt;
!width=65%|Description&lt;br /&gt;
!width=20%|Availability&lt;br /&gt;
|-&lt;br /&gt;
|[[Accesslevel form field type|accesslevel]]&lt;br /&gt;
|provides a drop down list of viewing access levels.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Cachehandler form field type|cachehandler]]&lt;br /&gt;
|provides a list of available cache handling options.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Calendar form field type|calendar]]&lt;br /&gt;
|provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Captcha form field type|captcha]]&lt;br /&gt;
|provides a drop down list of the captcha plugins.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Category form field type|category]]&lt;br /&gt;
|provides a drop down list of categories for an extension.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Checkbox form field type|checkbox]]&lt;br /&gt;
|provides a single checkbox to be checked or unchecked&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Checkboxes form field type|checkboxes]]&lt;br /&gt;
|provides unlimited checkboxes that can be used for multi-select.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ChromeStyle form field type|Chrome Style]]&lt;br /&gt;
|provides a list of template chrome style options grouped by template.&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Color form field type|color]]&lt;br /&gt;
|provides a color picker when clicking the input box.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ContentLanguage form field type|Content Language]]&lt;br /&gt;
|Provides a list of content languages.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Contenttype form field type|Content Type]]&lt;br /&gt;
|Provides a list of content types.&lt;br /&gt;
|{{JVer|3.1}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Combo form field type|combo]]&lt;br /&gt;
|provides a combo box field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Componentlayout form field type|componentlayout]]&lt;br /&gt;
|provides a grouped list of core and template alternate layouts for a component item.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Contentlanguage form field type|contentlanguage]]&lt;br /&gt;
|provides a list of installed content languages for use in conjunction with the language switcher plugin.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[DatabaseConnection form field type|Database Connection]]&lt;br /&gt;
|Provides a list of available database connections, optionally limiting to a given list.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Editor form field type|editor]]&lt;br /&gt;
|provides an editor area field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Editors form field type|editors]]&lt;br /&gt;
|Provides a drop down list of the available WYSIWYG editors. Since {{JVer|2.5}} use [[Plugins form field type|plugins form field]] instead.&lt;br /&gt;
|{{JVer|2.5}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Email form field type|email]]&lt;br /&gt;
|provides an email field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[File form field type|file]]&lt;br /&gt;
|Provides an input field for files&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Filelist form field type|filelist]]&lt;br /&gt;
|provides a drop down list of files from a specified directory.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Folderlist form field type|folderlist]]&lt;br /&gt;
|provides a drop down list of folders from a specified directory.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Groupedlist form field type|groupedlist]]&lt;br /&gt;
|provides a drop down list of items organized into groups.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[HeaderTag form field type|header tag]]&lt;br /&gt;
|provides a drop down list of the header tags (h1-h6).&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Helpsite form field type|helpsite]]&lt;br /&gt;
|provides a drop down list of the help sites for your Joomla installation.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Hidden form field type|hidden]]&lt;br /&gt;
|provides a hidden field for saving a form field whose value cannot be altered directly by a user in the Administrator (it can be altered in code or by editing the &#039;&#039;params.ini&#039;&#039; file).&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Imagelist form field type|imagelist]]&lt;br /&gt;
|provides a drop down list of image files in a specified directory.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|[[Integer form field type|integer]]&lt;br /&gt;
|provides a drop down list of integers between a minimum and maximum.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Language form field type|language]]&lt;br /&gt;
|provides a drop down list of the installed languages for the Front-end or Back-end.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[List form field type|list]]&lt;br /&gt;
|provides a drop down list of custom-defined entries.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Media form field type|media]]&lt;br /&gt;
|provides modal access to the media manager for insertion of images with upload for users with appropriate permissions.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Menu form field type|menu]]&lt;br /&gt;
|provides a drop down list of the available menus from your Joomla site.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Menuitem form field type|Menu Item]]&lt;br /&gt;
|provides a drop down list of the available menu items from your Joomla site.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Meter form field type|meter]]&lt;br /&gt;
|Provides a meter to show value in a range.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Modulelayout form field type|Module Layout]]&lt;br /&gt;
|provides a list of alternative layout for a module grouped by core and template.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ModuleOrder form field type|Module Order]]&lt;br /&gt;
|Provides a drop down to set the ordering of module in a given position&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ModulePosition form field type|Module Position]]&lt;br /&gt;
|provides a text input to set the position of a module.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ModuleTag form field type|Module Tag]]&lt;br /&gt;
|provides a list of html5 elements (used to wrap a module in).&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Note form field type|note]]&lt;br /&gt;
|supports a one line text field.&lt;br /&gt;
|{{JVer|3.1}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Number form field type|number]]&lt;br /&gt;
|Provides a one line text box with up-down handles to set a number in the field.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Password form field type|password]]&lt;br /&gt;
|provides a text box for entry of a password.  The password characters will be obscured as they are entered.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Plugins form field type|plugins]]&lt;br /&gt;
|provides a list of plugins from a given folder.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Predefined List form field type|predefinedlist]]&lt;br /&gt;
|Form Field to load a list of predefined values.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Radio form field type|radio]]&lt;br /&gt;
|provides radio buttons to select different options.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Range form field type|range]]&lt;br /&gt;
|Provides a horizontal scroll bar to specify a value in a range.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Repeatable form field type|repeatable]]&lt;br /&gt;
|Allows form fields which can have as many options as the user desires.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Rules form field type|rules]]&lt;br /&gt;
|provides a matrix of group by action options for managing access control. Display depends on context.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Sessionhandler form field type|sessionhandler]]&lt;br /&gt;
|provides a drop down list of session handler options.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Spacer form field type|spacer]]&lt;br /&gt;
|provides a visual separator between form fields.  It is purely a visual aid and no value is stored.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[SQL form field type|sql]]&lt;br /&gt;
|provides a drop down list of entries obtained by running a query on the Joomla Database.  The first results column returned by the query provides the values for the drop down box.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Tag form field type|tag]]&lt;br /&gt;
|provides an entry point for tags (either AJAX or Nested).&lt;br /&gt;
|{{JVer|3.1}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Tel form field type|tel]]&lt;br /&gt;
|provides an input field for a telephone number.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Templatestyle form field type|templatestyle]]&lt;br /&gt;
|provides a drop down list of template styles.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Text form field type|text]]&lt;br /&gt;
|provides a text box for data entry.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Textarea form field type|textarea]]&lt;br /&gt;
|provides a text area for entry of multi-line text.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Timezone form field type|timezone]]&lt;br /&gt;
|provides a drop down list of time zones.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[URL form field type|URL]]&lt;br /&gt;
|provides a URL text input field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[User form field type|user]]&lt;br /&gt;
|Field to select a user from a modal list. Displays User Name and stores User ID&lt;br /&gt;
|{{JVer|1.6}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[UserActive form field type|useractive]]&lt;br /&gt;
|Field to show a list of available user active statuses. &lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Usergroup form field type|usergroup]]&lt;br /&gt;
|provides a drop down list of user groups. Since {{JVer|3.2}} use [[User Group List form field type|usergrouplist]] instead.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[User Group List form field type|usergrouplist]]&lt;br /&gt;
|Field to load a drop down list of available user groups. Replaces usergroup form field type.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[User State form field type|userstate]]&lt;br /&gt;
|Field to load a list of available users statuses.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Form fields]]&lt;br /&gt;
[[Category:Development Reference]]&lt;br /&gt;
[[Category:Needs to be marked for translation]]&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Standard_form_field_types&amp;diff=182861</id>
		<title>Standard form field types</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Standard_form_field_types&amp;diff=182861"/>
		<updated>2015-05-22T20:22:48Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: extra } removed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Numerous types of [[form field]] are built into Joomla!. The following table lists these standard types and their availability. Use the [[/Single-page reference|single-page reference]] if you want to print all existing form field documentation.&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}} Please note that many of these fields are available as [[Parameter|parameter types]] in Joomla! 1.5. For a list of parameter types, see [[J1.5:Standard parameter types]]. For a comparison between form field and parameter types, see [[Standard form field and parameter types]].&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;vertical-align:top; border:1px solid Sienna; background-color:Cornsilk;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:Wheat; font-weight:bold; text-align: left;&amp;quot;&lt;br /&gt;
!width=15%|Type&lt;br /&gt;
!width=65%|Description&lt;br /&gt;
!width=20%|Availability&lt;br /&gt;
|-&lt;br /&gt;
|[[Accesslevel form field type|accesslevel]]&lt;br /&gt;
|provides a drop down list of viewing access levels.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Cachehandler form field type|cachehandler]]&lt;br /&gt;
|provides a list of available cache handling options.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Calendar form field type|calendar]]&lt;br /&gt;
|provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Captcha form field type|captcha]]&lt;br /&gt;
|provides a drop down list of the captcha plugins.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Category form field type|category]]&lt;br /&gt;
|provides a drop down list of categories for an extension.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Checkbox form field type|checkbox]]&lt;br /&gt;
|provides a single checkbox to be checked or unchecked&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Checkboxes form field type|checkboxes]]&lt;br /&gt;
|provides unlimited checkboxes that can be used for multi-select.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ChromeStyle form field type|Chrome Style]]&lt;br /&gt;
|provides a list of template chrome style options grouped by template.&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Color form field type|color]]&lt;br /&gt;
|provides a color picker when clicking the input box.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ContentLanguage form field type|Content Language]]&lt;br /&gt;
|Provides a list of content languages.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Contenttype form field type|Content Type]]&lt;br /&gt;
|Provides a list of content types.&lt;br /&gt;
|{{JVer|3.1}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Combo form field type|combo]]&lt;br /&gt;
|provides a combo box field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Componentlayout form field type|componentlayout]]&lt;br /&gt;
|provides a grouped list of core and template alternate layouts for a component item.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Contentlanguage form field type|contentlanguage]]&lt;br /&gt;
|provides a list of installed content languages for use in conjunction with the language switcher plugin.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[DatabaseConnection form field type|Database Connection]]&lt;br /&gt;
|Provides a list of available database connections, optionally limiting to a given list.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Editor form field type|editor]]&lt;br /&gt;
|provides an editor area field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Editors form field type|editors]]&lt;br /&gt;
|Provides a drop down list of the available WYSIWYG editors. Since {{JVer|2.5}} use [[Plugins form field type|plugins form field]] instead.&lt;br /&gt;
|{{JVer|2.5}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Email form field type|email]]&lt;br /&gt;
|provides an email field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[File form field type|file]]&lt;br /&gt;
|Provides an input field for files&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Filelist form field type|filelist]]&lt;br /&gt;
|provides a drop down list of files from a specified directory.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Folderlist form field type|folderlist]]&lt;br /&gt;
|provides a drop down list of folders from a specified directory.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Groupedlist form field type|groupedlist]]&lt;br /&gt;
|provides a drop down list of items organized into groups.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[HeaderTag form field type|header tag]]&lt;br /&gt;
|provides a drop down list of the header tags (h1-h6).&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Helpsite form field type|helpsite]]&lt;br /&gt;
|provides a drop down list of the help sites for your Joomla installation.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Hidden form field type|hidden]]&lt;br /&gt;
|provides a hidden field for saving a form field whose value cannot be altered directly by a user in the Administrator (it can be altered in code or by editing the &#039;&#039;params.ini&#039;&#039; file).&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Imagelist form field type|imagelist]]&lt;br /&gt;
|provides a drop down list of image files in a specified directory.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|[[Integer form field type|integer]]&lt;br /&gt;
|provides a drop down list of integers between a minimum and maximum.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Language form field type|language]]&lt;br /&gt;
|provides a drop down list of the installed languages for the Front-end or Back-end.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[List form field type|list]]&lt;br /&gt;
|provides a drop down list of custom-defined entries.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Media form field type|media]]&lt;br /&gt;
|provides modal access to the media manager for insertion of images with upload for users with appropriate permissions.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Menu form field type|menu]]&lt;br /&gt;
|provides a drop down list of the available menus from your Joomla site.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Menuitem form field type|Menu Item]]&lt;br /&gt;
|provides a drop down list of the available menu items from your Joomla site.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Meter form field type|meter]]&lt;br /&gt;
|Provides a meter to show value in a range.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Modulelayout form field type|Module Layout]]&lt;br /&gt;
|provides a list of alternative layout for a module grouped by core and template.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ModuleOrder form field type|Module Order]]&lt;br /&gt;
|Provides a drop down to set the ordering of module in a given position&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ModulePosition form field type|Module Position]]&lt;br /&gt;
|provides a text input to set the position of a module.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ModuleTag form field type|Module Tag]]&lt;br /&gt;
|provides a list of html5 elements (used to wrap a module in).&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Note form field type|note]]&lt;br /&gt;
|supports a one line text field.&lt;br /&gt;
|{{JVer|3.1}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Number form field type|number]]&lt;br /&gt;
|Provides a one line text box with up-down handles to set a number in the field.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Password form field type|password]]&lt;br /&gt;
|provides a text box for entry of a password.  The password characters will be obscured as they are entered.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Plugins form field type|plugins]]&lt;br /&gt;
|provides a list of plugins from a given folder.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Predefined List form field type|predefinedlist]]&lt;br /&gt;
|Form Field to load a list of predefined values.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Radio form field type|radio]]&lt;br /&gt;
|provides radio buttons to select different options.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Range form field type|range]]&lt;br /&gt;
|Provides a horizontal scroll bar to specify a value in a range.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Repeatable form field type|repeatable]]&lt;br /&gt;
|Allows form fields which can have as many options as the user desires.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Rules form field type|rules]]&lt;br /&gt;
|provides a matrix of group by action options for managing access control. Display depends on context.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Sessionhandler form field type|sessionhandler]]&lt;br /&gt;
|provides a drop down list of session handler options.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Spacer form field type|spacer]]&lt;br /&gt;
|provides a visual separator between form fields.  It is purely a visual aid and no value is stored.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[SQL form field type|sql]]&lt;br /&gt;
|provides a drop down list of entries obtained by running a query on the Joomla Database.  The first results column returned by the query provides the values for the drop down box.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Tag form field type|tag]]&lt;br /&gt;
|provides an entry point for tags (either AJAX or Nested).&lt;br /&gt;
|{{JVer|3.1}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Tel form field type|tel]]&lt;br /&gt;
|provides an input field for a telephone number.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Templatestyle form field type|templatestyle]]&lt;br /&gt;
|provides a drop down list of template styles.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Text form field type|text]]&lt;br /&gt;
|provides a text box for data entry.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Textarea form field type|textarea]]&lt;br /&gt;
|provides a text area for entry of multi-line text.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Timezone form field type|timezone]]&lt;br /&gt;
|provides a drop down list of time zones.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[URL form field type|URL]]&lt;br /&gt;
|provides a URL text input field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[User form field type|user]]&lt;br /&gt;
|Field to select a user from a modal list. Displays User Name and stores User ID&lt;br /&gt;
|{{JVer|1.6}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[UserActive form field type|useractive]]&lt;br /&gt;
|Field to show a list of available user active statuses. &lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Usergroup form field type|usergroup]]&lt;br /&gt;
|provides a drop down list of user groups. &lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[User Group List form field type|usergrouplist]]&lt;br /&gt;
|Field to load a drop down list of available user groups. Replaces Usergroup form field type.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[User State form field type|userstate]]&lt;br /&gt;
|Field to load a list of available users statuses.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Form fields]]&lt;br /&gt;
[[Category:Development Reference]]&lt;br /&gt;
[[Category:Needs to be marked for translation]]&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Standard_form_field_types&amp;diff=182860</id>
		<title>Standard form field types</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Standard_form_field_types&amp;diff=182860"/>
		<updated>2015-05-22T20:21:30Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Add more missing field types - correct some since versions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Numerous types of [[form field]] are built into Joomla!. The following table lists these standard types and their availability. Use the [[/Single-page reference|single-page reference]] if you want to print all existing form field documentation.&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}} Please note that many of these fields are available as [[Parameter|parameter types]] in Joomla! 1.5. For a list of parameter types, see [[J1.5:Standard parameter types]]. For a comparison between form field and parameter types, see [[Standard form field and parameter types]].&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;vertical-align:top; border:1px solid Sienna; background-color:Cornsilk;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:Wheat; font-weight:bold; text-align: left;&amp;quot;&lt;br /&gt;
!width=15%|Type&lt;br /&gt;
!width=65%|Description&lt;br /&gt;
!width=20%|Availability&lt;br /&gt;
|-&lt;br /&gt;
|[[Accesslevel form field type|accesslevel]]&lt;br /&gt;
|provides a drop down list of viewing access levels.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Cachehandler form field type|cachehandler]]&lt;br /&gt;
|provides a list of available cache handling options.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Calendar form field type|calendar]]&lt;br /&gt;
|provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Captcha form field type|captcha]]&lt;br /&gt;
|provides a drop down list of the captcha plugins.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Category form field type|category]]&lt;br /&gt;
|provides a drop down list of categories for an extension.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Checkbox form field type|checkbox]]&lt;br /&gt;
|provides a single checkbox to be checked or unchecked&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Checkboxes form field type|checkboxes]]&lt;br /&gt;
|provides unlimited checkboxes that can be used for multi-select.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ChromeStyle form field type|Chrome Style]]&lt;br /&gt;
|provides a list of template chrome style options grouped by template.&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Color form field type|color]]&lt;br /&gt;
|provides a color picker when clicking the input box.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ContentLanguage form field type|Content Language]]&lt;br /&gt;
|Provides a list of content languages.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Contenttype form field type|Content Type]]&lt;br /&gt;
|Provides a list of content types.&lt;br /&gt;
|{{JVer|3.1}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Combo form field type|combo]]&lt;br /&gt;
|provides a combo box field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Componentlayout form field type|componentlayout]]&lt;br /&gt;
|provides a grouped list of core and template alternate layouts for a component item.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Contentlanguage form field type|contentlanguage]]&lt;br /&gt;
|provides a list of installed content languages for use in conjunction with the language switcher plugin.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[DatabaseConnection form field type|Database Connection]]&lt;br /&gt;
|Provides a list of available database connections, optionally limiting to a given list.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Editor form field type|editor]]&lt;br /&gt;
|provides an editor area field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Editors form field type|editors]]&lt;br /&gt;
|Provides a drop down list of the available WYSIWYG editors. Since {{JVer|2.5}} use [[Plugins form field type|plugins form field]] instead.&lt;br /&gt;
|{{JVer|2.5}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Email form field type|email]]&lt;br /&gt;
|provides an email field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[File form field type|file]]&lt;br /&gt;
|Provides an input field for files&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Filelist form field type|filelist]]&lt;br /&gt;
|provides a drop down list of files from a specified directory.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Folderlist form field type|folderlist]]&lt;br /&gt;
|provides a drop down list of folders from a specified directory.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Groupedlist form field type|groupedlist]]&lt;br /&gt;
|provides a drop down list of items organized into groups.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[HeaderTag form field type|header tag]]&lt;br /&gt;
|provides a drop down list of the header tags (h1-h6).&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Helpsite form field type|helpsite]]&lt;br /&gt;
|provides a drop down list of the help sites for your Joomla installation.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Hidden form field type|hidden]]&lt;br /&gt;
|provides a hidden field for saving a form field whose value cannot be altered directly by a user in the Administrator (it can be altered in code or by editing the &#039;&#039;params.ini&#039;&#039; file).&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Imagelist form field type|imagelist]]&lt;br /&gt;
|provides a drop down list of image files in a specified directory.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|[[Integer form field type|integer]]&lt;br /&gt;
|provides a drop down list of integers between a minimum and maximum.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Language form field type|language]]&lt;br /&gt;
|provides a drop down list of the installed languages for the Front-end or Back-end.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[List form field type|list]]&lt;br /&gt;
|provides a drop down list of custom-defined entries.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Media form field type|media]]&lt;br /&gt;
|provides modal access to the media manager for insertion of images with upload for users with appropriate permissions.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Menu form field type|menu]]&lt;br /&gt;
|provides a drop down list of the available menus from your Joomla site.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Menuitem form field type|Menu Item]]&lt;br /&gt;
|provides a drop down list of the available menu items from your Joomla site.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Meter form field type|meter]]&lt;br /&gt;
|Provides a meter to show value in a range.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Modulelayout form field type|Module Layout]]&lt;br /&gt;
|provides a list of alternative layout for a module grouped by core and template.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ModuleOrder form field type|Module Order]]&lt;br /&gt;
|Provides a drop down to set the ordering of module in a given position&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ModulePosition form field type|Module Position]]&lt;br /&gt;
|provides a text input to set the position of a module.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ModuleTag form field type|Module Tag]]&lt;br /&gt;
|provides a list of html5 elements (used to wrap a module in).&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Note form field type|note]]&lt;br /&gt;
|supports a one line text field.&lt;br /&gt;
|{{JVer|3.1}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Number form field type|number]]&lt;br /&gt;
|Provides a one line text box with up-down handles to set a number in the field.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Password form field type|password]]&lt;br /&gt;
|provides a text box for entry of a password.  The password characters will be obscured as they are entered.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Plugins form field type|plugins]]&lt;br /&gt;
|provides a list of plugins from a given folder.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Predefined List form field type|predefinedlist]]&lt;br /&gt;
|Form Field to load a list of predefined values.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Radio form field type|radio]]&lt;br /&gt;
|provides radio buttons to select different options.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Range form field type|range]]&lt;br /&gt;
|Provides a horizontal scroll bar to specify a value in a range.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Repeatable form field type|repeatable]]&lt;br /&gt;
|Allows form fields which can have as many options as the user desires.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Rules form field type|rules]]&lt;br /&gt;
|provides a matrix of group by action options for managing access control. Display depends on context.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Sessionhandler form field type|sessionhandler]]&lt;br /&gt;
|provides a drop down list of session handler options.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Spacer form field type|spacer]]&lt;br /&gt;
|provides a visual separator between form fields.  It is purely a visual aid and no value is stored.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[SQL form field type|sql]]&lt;br /&gt;
|provides a drop down list of entries obtained by running a query on the Joomla Database.  The first results column returned by the query provides the values for the drop down box.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Tag form field type|tag]]&lt;br /&gt;
|provides an entry point for tags (either AJAX or Nested).&lt;br /&gt;
|{{JVer|3.1}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Tel form field type|tel]]&lt;br /&gt;
|provides an input field for a telephone number.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Templatestyle form field type|templatestyle]]&lt;br /&gt;
|provides a drop down list of template styles.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Text form field type|text]]&lt;br /&gt;
|provides a text box for data entry.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Textarea form field type|textarea]]&lt;br /&gt;
|provides a text area for entry of multi-line text.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Timezone form field type|timezone]]&lt;br /&gt;
|provides a drop down list of time zones.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[URL form field type|URL]]&lt;br /&gt;
|provides a URL text input field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[User form field type|user]]&lt;br /&gt;
|Field to select a user from a modal list. Displays User Name and stores User ID&lt;br /&gt;
|{{JVer|1.6}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[UserActive form field type|useractive]]&lt;br /&gt;
|Field to show a list of available user active statuses. &lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|[[Usergroup form field type|usergroup]]&lt;br /&gt;
|provides a drop down list of user groups. &lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|[[User Group List form field type|usergrouplist]]&lt;br /&gt;
|Field to load a drop down list of available user groups. Replaces Usergroup form field type.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|[[User State form field type|userstate]]&lt;br /&gt;
|Field to load a list of available users statuses.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Form fields]]&lt;br /&gt;
[[Category:Development Reference]]&lt;br /&gt;
[[Category:Needs to be marked for translation]]&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Standard_form_field_types&amp;diff=182108</id>
		<title>Standard form field types</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Standard_form_field_types&amp;diff=182108"/>
		<updated>2015-05-20T23:50:27Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: correct since versions for a few fields (at least since 3 not since 2.5)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Numerous types of [[form field]] are built into Joomla!. The following table lists these standard types and their availability. Use the [[/Single-page reference|single-page reference]] if you want to print all existing form field documentation.&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}} Please note that many of these fields are available as [[Parameter|parameter types]] in Joomla! 1.5. For a list of parameter types, see [[J1.5:Standard parameter types]]. For a comparison between form field and parameter types, see [[Standard form field and parameter types]].&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;vertical-align:top; border:1px solid Sienna; background-color:Cornsilk;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:Wheat; font-weight:bold; text-align: left;&amp;quot;&lt;br /&gt;
!width=15%|Type&lt;br /&gt;
!width=65%|Description&lt;br /&gt;
!width=20%|Availability&lt;br /&gt;
|-&lt;br /&gt;
|[[Accesslevel form field type|accesslevel]]&lt;br /&gt;
|provides a drop down list of viewing access levels.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Cachehandler form field type|cachehandler]]&lt;br /&gt;
|provides a list of available cache handling options.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Calendar form field type|calendar]]&lt;br /&gt;
|provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Captcha form field type|captcha]]&lt;br /&gt;
|provides a drop down list of the captcha plugins.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Category form field type|category]]&lt;br /&gt;
|provides a drop down list of categories for an extension.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Checkbox form field type|checkbox]]&lt;br /&gt;
|provides a single checkbox to be checked or unchecked&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Checkboxes form field type|checkboxes]]&lt;br /&gt;
|provides unlimited checkboxes that can be used for multi-select.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ChromeStyle form field type|Chrome Style]]&lt;br /&gt;
|provides a list of template chrome style options grouped by template.&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Color form field type|color]]&lt;br /&gt;
|provides a color picker when clicking the input box.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ContentLanguage form field type|Content Language]]&lt;br /&gt;
|Provides a list of content languages.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Contenttype form field type|Content Type]]&lt;br /&gt;
|Provides a list of content types.&lt;br /&gt;
|{{JVer|3.1}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Combo form field type|combo]]&lt;br /&gt;
|provides a combo box field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Componentlayout form field type|componentlayout]]&lt;br /&gt;
|provides a grouped list of core and template alternate layouts for a component item.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Contentlanguage form field type|contentlanguage]]&lt;br /&gt;
|provides a list of installed content languages for use in conjunction with the language switcher plugin.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[DatabaseConnection form field type|Database Connection]]&lt;br /&gt;
|Provides a list of available database connections, optionally limiting to a given list.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Editor form field type|editor]]&lt;br /&gt;
|provides an editor area field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Editors form field type|editors]]&lt;br /&gt;
|Provides a drop down list of the available WYSIWYG editors. Since {{JVer|2.5}} use [[Plugins form field type|plugins form field]] instead.&lt;br /&gt;
|{{JVer|2.5}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Email form field type|email]]&lt;br /&gt;
|provides an email field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[File form field type|file]]&lt;br /&gt;
|Provides an input field for files&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Filelist form field type|filelist]]&lt;br /&gt;
|provides a drop down list of files from a specified directory.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Folderlist form field type|folderlist]]&lt;br /&gt;
|provides a drop down list of folders from a specified directory.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Groupedlist form field type|groupedlist]]&lt;br /&gt;
|provides a drop down list of items organized into groups.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[HeaderTag form field type|header tag]]&lt;br /&gt;
|provides a drop down list of the header tags (h1-h6).&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Helpsite form field type|helpsite]]&lt;br /&gt;
|provides a drop down list of the help sites for your Joomla installation.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Hidden form field type|hidden]]&lt;br /&gt;
|provides a hidden field for saving a form field whose value cannot be altered directly by a user in the Administrator (it can be altered in code or by editing the &#039;&#039;params.ini&#039;&#039; file).&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Imagelist form field type|imagelist]]&lt;br /&gt;
|provides a drop down list of image files in a specified directory.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|[[Integer form field type|integer]]&lt;br /&gt;
|provides a drop down list of integers between a minimum and maximum.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Language form field type|language]]&lt;br /&gt;
|provides a drop down list of the installed languages for the Front-end or Back-end.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[List form field type|list]]&lt;br /&gt;
|provides a drop down list of custom-defined entries.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Media form field type|media]]&lt;br /&gt;
|provides modal access to the media manager for insertion of images with upload for users with appropriate permissions.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Menu form field type|menu]]&lt;br /&gt;
|provides a drop down list of the available menus from your Joomla site.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Menuitem form field type|Menu Item]]&lt;br /&gt;
|provides a drop down list of the available menu items from your Joomla site.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Meter form field type|meter]]&lt;br /&gt;
|Provides a meter to show value in a range.&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Modulelayout form field type|Module Layout]]&lt;br /&gt;
|provides a list of alternative layout for a module grouped by core and template.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ModuleOrder form field type|Module Order]]&lt;br /&gt;
|Provides a drop down to set the ordering of module in a given position&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ModulePosition form field type|Module Position]]&lt;br /&gt;
|provides a text input to set the position of a module.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ModuleTag form field type|Module Tag]]&lt;br /&gt;
|provides a list of html5 elements (used to wrap a module in).&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Note form field type|note]]&lt;br /&gt;
|supports a one line text field.&lt;br /&gt;
|{{JVer|3.1}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Number form field type|number]]&lt;br /&gt;
|Provides a one line text box with up-down handles to set a number in the field.&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Password form field type|password]]&lt;br /&gt;
|provides a text box for entry of a password.  The password characters will be obscured as they are entered.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Plugins form field type|plugins]]&lt;br /&gt;
|provides a list of plugins from a given folder.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Predefined List form field type|predefinedlist]]&lt;br /&gt;
|Form Field to load a list of predefined values.&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Radio form field type|radio]]&lt;br /&gt;
|provides radio buttons to select different options.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Range form field type|range]]&lt;br /&gt;
|Provides a horizontal scroll bar to specify a value in a range.&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Repeatable form field type|repeatable]]&lt;br /&gt;
|Allows form fields which can have as many options as the user desires.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Rules form field type|rules]]&lt;br /&gt;
|provides a matrix of group by action options for managing access control. Display depends on context.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Sessionhandler form field type|sessionhandler]]&lt;br /&gt;
|provides a drop down list of session handler options.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Spacer form field type|spacer]]&lt;br /&gt;
|provides a visual separator between form fields.  It is purely a visual aid and no value is stored.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[SQL form field type|sql]]&lt;br /&gt;
|provides a drop down list of entries obtained by running a query on the Joomla Database.  The first results column returned by the query provides the values for the drop down box.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Tag form field type|tag]]&lt;br /&gt;
|provides an entry point for tags (either AJAX or Nested).&lt;br /&gt;
|{{JVer|3.1}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Tel form field type|tel]]&lt;br /&gt;
|provides an input field for a telephone number.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Templatestyle form field type|templatestyle]]&lt;br /&gt;
|provides a drop down list of template styles.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Text form field type|text]]&lt;br /&gt;
|provides a text box for data entry.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Textarea form field type|textarea]]&lt;br /&gt;
|provides a text area for entry of multi-line text.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Timezone form field type|timezone]]&lt;br /&gt;
|provides a drop down list of time zones.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[URL form field type|URL]]&lt;br /&gt;
|provides a URL text input field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[User form field type|user]]&lt;br /&gt;
|provides a modal list of users.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Usergroup form field type|usergroup]]&lt;br /&gt;
|provides a drop down list of user groups. &lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Form fields]]&lt;br /&gt;
[[Category:Development Reference]]&lt;br /&gt;
[[Category:Needs to be marked for translation]]&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Creating_a_custom_form_field_type&amp;diff=177841</id>
		<title>Creating a custom form field type</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Creating_a_custom_form_field_type&amp;diff=177841"/>
		<updated>2015-05-02T19:32:00Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: added Category:Extension development&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;
&amp;lt;noinclude&amp;gt;{{Joomla version|version=3.x|comment=&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
series&amp;lt;/translate&amp;gt;}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
{{page|needs review}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
[[S:MyLanguage/JForm|JForm]], a feature introduced in Joomla! 2.5, lets you easily create HTML forms (&amp;lt;code&amp;gt;&amp;lt;form&amp;gt;&amp;lt;/code&amp;gt;). Forms created using JForm consist of [[S:MyLanguage/Form field|form fields]], implemented as [[S:MyLanguage/JFormField|JFormFields]]. There is a JFormField for each different field type you can find in a form, such as a text field type and a date field type. JForm supports a large selection of standard field types. For a full list, see [[S:MyLanguage/Standard form field types|Standard form field types]].&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;
Joomla! 2.5 makes it possible to extend standard field types or define your own. For example, if your component manages phone book entries, you might want to define a form field type that outputs a select list of cities. There are several advantages to defining a custom form field type:&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:4--&amp;gt;&lt;br /&gt;
* You will be able to mix standard field types with your custom field type in a JForm-based form.&lt;br /&gt;
* You will eventually have a reusable code package that can be used easily throughout your code.&lt;br /&gt;
* Extensions that collaborate with your extension will be able to create form fields without meddling with your database tables and other internals.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Form field type class requirements == &amp;lt;!--T:5--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
A form field type is defined in a [[S:MyLanguage/wikipedia:Class (computer programming)|class]] that must be a (not necessarily direct) subclass of JFormField. To work correctly, the class must define at least two methods:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;public function getLabel()&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
*: This function will be called to create the label that belongs to your field and must return a HTML string containing it. Since JFormField defines a ready-to-use &amp;lt;code&amp;gt;getLabel()&amp;lt;/code&amp;gt; implementation, custom form field types usually do not define their own &amp;lt;code&amp;gt;getLabel()&amp;lt;/code&amp;gt;. If you leave it out, the inherited method of creating labels will be used. It is recommended to leave out the &amp;lt;code&amp;gt;getLabel()&amp;lt;/code&amp;gt; method for consistency and speed unless you actually want to modify the label&#039;s HTML.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;public function getInput()&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
*: This function will be called to create the field itself and must return a HTML string containing it. This is also where most of the processing usually happens. In our phone book City field example, this function will have to retrieve a list of available cities and return a HTML &amp;lt;code&amp;gt;&amp;lt;select&amp;gt;&amp;lt;/code&amp;gt; with the cities inserted as &amp;lt;code&amp;gt;&amp;lt;option&amp;gt;&amp;lt;/code&amp;gt;s.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
Inside your code, you will have to process the attributes set by the field&#039;s user in the XML form definition. Some of those attributes are accessible via protected member variables of JFormField. For example, the &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; attribute is available in your code as &amp;lt;code&amp;gt;$this-&amp;gt;name&amp;lt;/code&amp;gt;. Similarly, &amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;description&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;multiple&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt; are also available as properties of &amp;lt;code&amp;gt;$this&amp;lt;/code&amp;gt;. Other parameters you might have defined can be accessed through the &amp;lt;code&amp;gt;$this-&amp;gt;element&amp;lt;/code&amp;gt; array: the attribute &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; will be in &amp;lt;code&amp;gt;$this-&amp;gt;element[&#039;size&#039;]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Which class to subclass? == &amp;lt;!--T:10--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
For a form field type to be usable in JForm, it needs to be a subclass of JFormField. However, it does not have to be a direct child of that class: you can also subclass an existing (standard or custom) form field type and thereby inherit useful code.&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:12--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;If your form field type is quite similar to an existing type,&#039;&#039;&#039; you should subclass that type. Especially if your form field type is a &#039;&#039;&#039;list&#039;&#039;&#039;, please subclass [[S:MyLanguage/JFormFieldList|JFormFieldList]]. You only have to override &amp;lt;code&amp;gt;getOptions()&amp;lt;/code&amp;gt; method to return the options to be shown; the &amp;lt;code&amp;gt;getInput()&amp;lt;/code&amp;gt; method will convert those options to HTML.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To subclass an existing type, for example JFormFieldList, load it by adding the following to after &amp;lt;code&amp;gt;jimport(&#039;joomla.form.formfield&#039;);&amp;lt;/code&amp;gt;:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
jimport(&#039;joomla.form.helper&#039;);&lt;br /&gt;
JFormHelper::loadFieldClass(&#039;list&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;If your form field type is unlike any existing type,&#039;&#039;&#039; subclass JFormField directly.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Location of files == &amp;lt;!--T:15--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
* The standard form field types are located in &amp;lt;code&amp;gt;libraries/joomla/form/fields/&amp;lt;/code&amp;gt;. You should not store custom fields there, nor should you have to use this path in your own code, but the standard types are usually good examples.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
* The custom field types that belong to your component are usually located in &amp;lt;code&amp;gt;administrator/components/&amp;lt;name of your component&amp;gt;/models/fields&amp;lt;/code&amp;gt;. You can specify this or another path in your code:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;JForm::addFieldPath(JPATH_COMPONENT . &#039;/models/fields&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
* The XML files that define forms are usually located in &amp;lt;code&amp;gt;administrator/components/&amp;lt;name of your component&amp;gt;/models/forms&amp;lt;/code&amp;gt;. Use something like the following snippet to specify a path to your forms:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;JForm::addFormPath(JPATH_COMPONENT . &#039;/models/forms&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Naming conventions and skeleton == &amp;lt;!--T:19--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
In this section, &amp;lt;ComponentName&amp;gt; represents the camel-cased name of your component and &amp;lt;FieldName&amp;gt; represents the camel-cased name of your form field type. The field&#039;s class should be placed in &amp;lt;code&amp;gt;administrator/components/&amp;lt;name of your component&amp;gt;/models/fields/&amp;lt;name of your field&amp;gt;.php&amp;lt;/code&amp;gt;, and look like this:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
// Check to ensure this file is included in Joomla!&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
jimport(&#039;joomla.form.formfield&#039;);&lt;br /&gt;
&lt;br /&gt;
// The class name must always be the same as the filename (in camel case)&lt;br /&gt;
class JFormField&amp;lt;FieldName&amp;gt; extends JFormField {&lt;br /&gt;
&lt;br /&gt;
	//The field class must know its own type through the variable $type.&lt;br /&gt;
	protected $type = &#039;&amp;lt;FieldName&amp;gt;&#039;;&lt;br /&gt;
&lt;br /&gt;
	public function getLabel() {&lt;br /&gt;
		// code that returns HTML that will be shown as the label&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public function getInput() {&lt;br /&gt;
		// code that returns HTML that will be shown as the form field&lt;br /&gt;
	}&lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Grouping custom field types === &amp;lt;!--T:21--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Warning: this information is partially incorrect and needs to be improved.&#039;&#039;&#039;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
Custom field types can be grouped by using an underscore in the field name. A field class with a name for example like &amp;quot;JFormFieldMy_randomField&amp;quot; must be stored in &amp;lt;code&amp;gt;administrator/components/&amp;lt;name of your component&amp;gt;/models/fields/my/randomField.php&amp;lt;/code&amp;gt;. We can prefix our form field names with some group name, then we put an underscore and then a name of a field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== An example custom field type == &amp;lt;!--T:24--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Suppose you&#039;re working on your component named &#039;&#039;com_phonebook&#039;&#039; and you want to define a field that contains cities. Create the file &amp;lt;code&amp;gt;administrator/components/com_phonebook/models/fields/city.php&amp;lt;/code&amp;gt; and write something similar to the following:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
// Check to ensure this file is included in Joomla!&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
jimport(&#039;joomla.form.formfield&#039;);&lt;br /&gt;
&lt;br /&gt;
class JFormFieldCity extends JFormField {&lt;br /&gt;
	&lt;br /&gt;
	protected $type = &#039;City&#039;;&lt;br /&gt;
&lt;br /&gt;
	// getLabel() left out&lt;br /&gt;
&lt;br /&gt;
	public function getInput() {&lt;br /&gt;
		return &#039;&amp;lt;select id=&amp;quot;&#039;.$this-&amp;gt;id.&#039;&amp;quot; name=&amp;quot;&#039;.$this-&amp;gt;name.&#039;&amp;quot;&amp;gt;&#039;.&lt;br /&gt;
		       &#039;&amp;lt;option value=&amp;quot;1&amp;quot; &amp;gt;New York&amp;lt;/option&amp;gt;&#039;.&lt;br /&gt;
		       &#039;&amp;lt;option value=&amp;quot;2&amp;quot; &amp;gt;Chicago&amp;lt;/option&amp;gt;&#039;.&lt;br /&gt;
		       &#039;&amp;lt;option value=&amp;quot;3&amp;quot; &amp;gt;San Francisco&amp;lt;/option&amp;gt;&#039;.&lt;br /&gt;
		       &#039;&amp;lt;/select&amp;gt;&#039;;&lt;br /&gt;
	}&lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Using the custom field type === &amp;lt;!--T:26--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;==== Linked with a form ==== &amp;lt;!--T:27--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
To use the field type City, we need to update the XML file that contains the form fields. Open your XML file located in &amp;lt;code&amp;gt;administrator/components/com_phonebook/models/forms&amp;lt;/code&amp;gt; and add the field in the usual way:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;field name=&amp;quot;title&amp;quot; type=&amp;quot;City&amp;quot; label=&amp;quot;JGLOBAL_TITLE&amp;quot;&lt;br /&gt;
	description=&amp;quot;JFIELD_TITLE_DESC&amp;quot;&lt;br /&gt;
	required=&amp;quot;true&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
The type name is cAsE-sEnSiTiVe.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
In addition, you may need to add the field path to the parent &amp;lt;fieldset&amp;gt;:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;fieldset addfieldpath=&amp;quot;/administrator/components/&amp;lt;component name&amp;gt;/models/fields&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==== Not linked with a form ==== &amp;lt;!--T:31--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
E.g. when you need the field as a dropdown in a component as admin/site filter.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
//Get custom field&lt;br /&gt;
JFormHelper::addFieldPath(JPATH_COMPONENT . &#039;/models/fields&#039;);&lt;br /&gt;
$cities = JFormHelper::loadFieldType(&#039;City&#039;, false);&lt;br /&gt;
$cityOptions=$cities-&amp;gt;getOptions(); // works only if you set your field getOptions on public!!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Overriding &amp;lt;code&amp;gt;getLabel()&amp;lt;/code&amp;gt; == &amp;lt;!--T:33--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
As mentioned in the section [[#Form field type class requirements|Form field type class requirements]], custom form field types usually do not define their own &amp;lt;code&amp;gt;getLabel()&amp;lt;/code&amp;gt;. If you do want to create a custom label, you can still make use of the &amp;lt;code&amp;gt;getLabel()&amp;lt;/code&amp;gt; that every field type class inherits from JFormField, for example by defining it as follows:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;public function getLabel() {&lt;br /&gt;
     return &#039;&amp;lt;span style=&amp;quot;text-decoration: underline;&amp;quot;&amp;gt;&#039; . parent::getLabel() . &#039;&amp;lt;/span&amp;gt;&#039;;&lt;br /&gt;
} &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
This code will underline your form labels. (Please note that if your goal is to underline form labels, using [[CSS]] is the preferred way.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
If you want to do something completely different, you can of course also override it completely:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;public function getLabel() {&lt;br /&gt;
	// Initialize variables.&lt;br /&gt;
	$label = &#039;&#039;;&lt;br /&gt;
	$replace = &#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
	// Get the label text from the XML element, defaulting to the element name.&lt;br /&gt;
	$text = $this-&amp;gt;element[&#039;label&#039;] ? (string) $this-&amp;gt;element[&#039;label&#039;] : (string) $this-&amp;gt;element[&#039;name&#039;];&lt;br /&gt;
&lt;br /&gt;
	// Build the class for the label.&lt;br /&gt;
	$class = !empty($this-&amp;gt;description) ? &#039;hasTip&#039; : &#039;&#039;;&lt;br /&gt;
	$class = $this-&amp;gt;required == true ? $class.&#039; required&#039; : $class;&lt;br /&gt;
		&lt;br /&gt;
	// Add replace checkbox&lt;br /&gt;
	$replace = &#039;&amp;lt;input type=&amp;quot;checkbox&amp;quot; name=&amp;quot;update[&#039;.$this-&amp;gt;name.&#039;]&amp;quot; value=&amp;quot;1&amp;quot; /&amp;gt;&#039;;&lt;br /&gt;
		&lt;br /&gt;
	// Add the opening label tag and main attributes attributes.&lt;br /&gt;
	$label .= &#039;&amp;lt;label id=&amp;quot;&#039;.$this-&amp;gt;id.&#039;-lbl&amp;quot; for=&amp;quot;&#039;.$this-&amp;gt;id.&#039;&amp;quot; class=&amp;quot;&#039;.$class.&#039;&amp;quot;&#039;;&lt;br /&gt;
&lt;br /&gt;
	// If a description is specified, use it to build a tooltip.&lt;br /&gt;
	if (!empty($this-&amp;gt;description)) {&lt;br /&gt;
		$label .= &#039; title=&amp;quot;&#039;.htmlspecialchars(trim(JText::_($text), &#039;:&#039;).&#039;::&#039; .&lt;br /&gt;
				JText::_($this-&amp;gt;description), ENT_COMPAT, &#039;UTF-8&#039;).&#039;&amp;quot;&#039;;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Add the label text and closing tag.&lt;br /&gt;
	$label .= &#039;&amp;gt;&#039;.$replace.JText::_($text).&#039;&amp;lt;/label&amp;gt;&#039;;&lt;br /&gt;
	&lt;br /&gt;
	return $label; &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
This example will add a checkbox inside the label.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Extension development]]&lt;br /&gt;
[[Category:Form fields]]&lt;br /&gt;
[[Category:Joomla! 2.5]]&lt;br /&gt;
[[Category:Joomla! 3.x]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Manifest_files&amp;diff=177840</id>
		<title>Manifest files</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Manifest_files&amp;diff=177840"/>
		<updated>2015-05-02T19:30:21Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: added Category:Development&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version|2.5,3.x}}&lt;br /&gt;
&lt;br /&gt;
Within Joomla there are manifest files for all of the extensions. These files include the general installation information as well as parameters for the configuration of the [[extension]] itself. Since Joomla! 2.5 {{JVer|2.5}}, there are very few differences between the manifest file formats for the different [[S:MyLanguage/Extension types (technical definitions)|types of extensions]], allowing each type to access the full power of the Joomla! installer.&lt;br /&gt;
&lt;br /&gt;
==Naming conventions==&lt;br /&gt;
The file must be named &amp;lt;tt&amp;gt;manifest.xml&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;&amp;lt;extension_name&amp;gt;.xml&amp;lt;/tt&amp;gt; and located in the root directory of the installation package.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&lt;br /&gt;
=== Root element ===&lt;br /&gt;
The primary tag of the installation file is: &lt;br /&gt;
&amp;lt;source lang=xml&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/extension&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This starting and closing tags are now valid for all extensions. The new tag &amp;lt;code&amp;gt;&amp;lt;extension&amp;gt;&amp;lt;/code&amp;gt; replaces the old &amp;lt;code&amp;gt;&amp;lt;install&amp;gt;&amp;lt;/install&amp;gt;&amp;lt;/code&amp;gt; from Joomla {{JVer|1.5}}. The following attributes are allowed within the tag:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 150px&amp;quot; | Attribute || style=&amp;quot;width: 150px&amp;quot; | Values || Applicable&amp;amp;nbsp;to || Description&lt;br /&gt;
|-&lt;br /&gt;
| type || &amp;lt;code&amp;gt;component&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;file&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;language&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;library&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;module&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;package&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;template&amp;lt;/code&amp;gt; || All extensions&lt;br /&gt;
| This attribute describes the type of the extension for the installer. Based on this type further requirements to sub-tags apply.&lt;br /&gt;
|-&lt;br /&gt;
| version&lt;br /&gt;
| &amp;lt;code&amp;gt;2.5&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt; || All extensions&lt;br /&gt;
| String that identifies the version of Joomla for which this extension is developed.&lt;br /&gt;
|-&lt;br /&gt;
| method&lt;br /&gt;
| &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;upgrade&amp;lt;/code&amp;gt; || All extensions&lt;br /&gt;
| The default value &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt; will be also used if the method attribute is not used. The &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt; value means the installer will gracefully stop if it finds any existing file/folder of the new extension.&lt;br /&gt;
|-&lt;br /&gt;
| client&lt;br /&gt;
| &amp;lt;code&amp;gt;site&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;administrator&amp;lt;/code&amp;gt; || Modules&lt;br /&gt;
| The client attribute allows you to specify for which application client the new module is available.&lt;br /&gt;
|-&lt;br /&gt;
| group&lt;br /&gt;
| &#039;&#039;string&#039;&#039; || Plugins&lt;br /&gt;
| The group name specifies for which group of plugins the new plugin is available. The existing groups are the folder names within the directory &amp;lt;tt&amp;gt;/plugins&amp;lt;/tt&amp;gt;. The installer will create new folder names for group names that do not exist yet.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Metadata ===&lt;br /&gt;
&lt;br /&gt;
The following elements can be used to insert metadata. None of these elements are required; if they are present, they must be a child of the root element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;name&amp;gt; &amp;amp;ndash; raw component name (e.g. com_banners). &lt;br /&gt;
&amp;lt;author&amp;gt; &amp;amp;ndash; author&#039;s name (e.g. Joomla! Project)&lt;br /&gt;
&amp;lt;creationDate&amp;gt; &amp;amp;ndash; date of creation or release (e.g. April 2006)&lt;br /&gt;
&amp;lt;copyright&amp;gt; &amp;amp;ndash; a copyright statement (e.g. (C) 2005 - 2011 Open Source Matters. All rights reserved.)&lt;br /&gt;
&amp;lt;license&amp;gt; &amp;amp;ndash; a license statement (e.g. NU General Public License version 2 or later; see LICENSE.txt)&lt;br /&gt;
&amp;lt;authorEmail&amp;gt; &amp;amp;ndash; author&#039;s email address (e.g. admin@joomla.org)&lt;br /&gt;
&amp;lt;authorUrl&amp;gt; &amp;amp;ndash; URL to the author&#039;s website (e.g. www.joomla.org)&lt;br /&gt;
&amp;lt;version&amp;gt; &amp;amp;ndash; the version number of the extension (e.g. 1.6.0)&lt;br /&gt;
&amp;lt;description&amp;gt; &amp;amp;ndash; the description of the component. This is a translatable field. (e.g. COM_BANNERS_XML_DESCRIPTION)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: The &amp;lt;name&amp;gt; and &amp;lt;description&amp;gt; tags are also translatable fields so that the name and description of the extension can be shown to the user in their native language.&lt;br /&gt;
&lt;br /&gt;
=== Front-end files ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;from-folder&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;example.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;examples&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Files to copy to the front-end directory should be placed in the &amp;lt;code&amp;gt;&amp;lt;files&amp;gt;&amp;lt;/code&amp;gt; element. You can use the optional &amp;lt;code&amp;gt;folder&amp;lt;/code&amp;gt; attribute to specify a directory &#039;&#039;&#039;in the ZIP package&#039;&#039;&#039; to copy &#039;&#039;&#039;from&#039;&#039;&#039;. Each file to copy must be represented by a &amp;lt;code&amp;gt;&amp;lt;filename&amp;gt;&amp;lt;/code&amp;gt; element. If you want to copy an entire folder at once, you can define it as a &amp;lt;code&amp;gt;&amp;lt;folder&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Media files ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;gt;&lt;br /&gt;
	&amp;lt;media folder=&amp;quot;media&amp;quot; destination=&amp;quot;com_example&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;com_example_logo.png&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;css&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;js&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/media&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example will copy the file(s) (&amp;lt;tt&amp;gt;/media/com_example_logo.png&amp;lt;/tt&amp;gt;) and folders ( &amp;lt;tt&amp;gt;/media/css/&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/media/js/&amp;lt;/tt&amp;gt; ) listed to &amp;lt;tt&amp;gt;/media/com_example/&amp;lt;/tt&amp;gt;, creating the &amp;lt;tt&amp;gt;com_example&amp;lt;/tt&amp;gt; folder if required. You can use the optional &amp;lt;code&amp;gt;folder&amp;lt;/code&amp;gt; attribute to specify a directory &#039;&#039;&#039;in the ZIP package&#039;&#039;&#039; to copy &#039;&#039;&#039;from&#039;&#039;&#039; (in this case, &amp;lt;tt&amp;gt;media&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Extensions should be storing assets they need to be web accessible (JS, CSS, images etc) in &amp;lt;code&amp;gt;media&amp;lt;/code&amp;gt;. Amongst other things this feature was added as step in the progression to multi-site support and the eventual move of code files (PHP) out of the web accessible areas of the server.&lt;br /&gt;
&lt;br /&gt;
Ref:&lt;br /&gt;
* [https://groups.google.com/forum/#!msg/joomla-dev-cms/4CAASJqFY-k/PvPj14gP29EJ Google Groups - joomla-dev-cms thread]&lt;br /&gt;
* [https://groups.google.com/forum/#!msg/joomla-dev-cms/uNmhX98sKbE/p8p68Jke680J Google Groups - joomla-dev-cms thread]&lt;br /&gt;
&lt;br /&gt;
=== Administration section ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- various elements --&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The administration section is defined in the &amp;lt;code&amp;gt;&amp;lt;administration&amp;gt;&amp;lt;/code&amp;gt; element. Since only [[S:MyLanguage/Component|components]] apply to both the [[S:MyLanguage/Site (Application)|site]] and the [[S:MyLanguage/Administrator (Application)|administrator]], &#039;&#039;&#039;only component manifests can include this element&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Back-end files ====&lt;br /&gt;
&lt;br /&gt;
Files to copy to the back-end directory should be placed in the &amp;lt;code&amp;gt;&amp;lt;files&amp;gt;&amp;lt;/code&amp;gt; element under the &amp;lt;code&amp;gt;&amp;lt;administration&amp;gt;&amp;lt;/code&amp;gt;. You can use the optional &amp;lt;code&amp;gt;folder&amp;lt;/code&amp;gt; attribute to specify a directory &#039;&#039;&#039;in the ZIP package&#039;&#039;&#039; to copy &#039;&#039;&#039;from&#039;&#039;&#039;. See &#039;&#039;Front-end files&#039;&#039; for further rules.&lt;br /&gt;
&lt;br /&gt;
==== Menu links and submenus ====&lt;br /&gt;
{{dablink|&#039;&#039;&#039;Version Note:&#039;&#039;&#039; Prior to Joomla 3.4 not having a menu tag in your XML file still led to a menu item being created. This bug was fixed in Joomla 3.4 so if no menu item was created then no admin menu item is created for the component.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;menu&amp;gt;COM_EXAMPLE&amp;lt;/menu&amp;gt;&lt;br /&gt;
	&amp;lt;submenu&amp;gt;&lt;br /&gt;
		&amp;lt;!--&lt;br /&gt;
			Note that all &amp;amp; must be escaped to &amp;amp;amp; for the file to be valid&lt;br /&gt;
			XML and be parsed by the installer&lt;br /&gt;
		--&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&amp;quot;anoption=avalue&amp;amp;amp;anoption1=avalue1&amp;quot;&amp;gt;COM_EXAMPLE_SUBMENU_ANOPTION&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;menu view=&amp;quot;viewname&amp;quot;&amp;gt;COM_EXAMPLE_SUBMENU_VIEWNAME&amp;lt;/menu&amp;gt;&lt;br /&gt;
	&amp;lt;/submenu&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The text for the main menu item for the component is defined in the &amp;lt;code&amp;gt;&amp;lt;menu&amp;gt;&amp;lt;/code&amp;gt; item, a child of &amp;lt;code&amp;gt;&amp;lt;administration&amp;gt;&amp;lt;/code&amp;gt;. A &amp;lt;code&amp;gt;&amp;lt;submenu&amp;gt;&amp;lt;/code&amp;gt; element may also be present (also a child of &amp;lt;code&amp;gt;&amp;lt;administration&amp;gt;&amp;lt;/code&amp;gt;), which may contain more menu items defined by &amp;lt;code&amp;gt;&amp;lt;menu&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Additionally, each &amp;lt;code&amp;gt;&amp;lt;menu&amp;gt;&amp;lt;/code&amp;gt; item can define the following attributes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 150px&amp;quot; | Attribute || Description&lt;br /&gt;
|-&lt;br /&gt;
| link || A link to send the user to when the menu item is clicked&lt;br /&gt;
|-&lt;br /&gt;
| img || The (relative) path to an image (16x16 pixels) to appear beside the menu item. &lt;br /&gt;
&amp;lt;u&amp;gt;Must be an url compatible as a file too (e.g. no spaces) !&amp;lt;/u&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| alt ||&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;string&#039;&#039; || An URL parameter to add to the link.  For example, &amp;lt;code&amp;gt;&amp;lt;menu view=&amp;quot;cpanel&amp;quot;&amp;gt;COM_EXAMPLE&amp;lt;/menu&amp;gt;&amp;lt;/code&amp;gt; in com_example&#039;s XML manifest would cause the URL of the menu item to be &amp;lt;tt&amp;gt;index.php?option=com_example&amp;amp;view=cpanel&amp;lt;/tt&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The value inside the tag is the menu&#039;s label. Unlike Joomla! 1.5, you can not use a natural language string. For example, if you would enter &amp;quot;Example Component&amp;quot; instead of COM_EXAMPLE, it would result in your component name appearing as example-component in the menu and you would be unable to provide a translation. In order to provide a translation you need to create a file named en-GB.com_example.sys.ini in administrator/languages/en-GB (you can use the manifest&#039;s &amp;lt;code&amp;gt;&amp;amp;lt;languages&amp;amp;gt;&amp;lt;/code&amp;gt; tag to copy it during installation) or in administrator/components/com_example/language/en-GB. In the latter case, you must not include the translation file in the &amp;lt;code&amp;gt;&amp;amp;lt;languages&amp;amp;gt;&amp;lt;/code&amp;gt; tag. As long as you have placed the language directory in your &amp;lt;code&amp;gt;&amp;lt;files&amp;gt;&amp;lt;/code&amp;gt; tag, it will be copied along when the component is being installed.&lt;br /&gt;
&lt;br /&gt;
The contents of that file should be:&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
COM_EXAMPLE=&amp;quot;Example Component&amp;quot;&lt;br /&gt;
COM_EXAMPLE_SUBMENU_ANOPTION=&amp;quot;Another Option&amp;quot;&lt;br /&gt;
COM_EXAMPLE_SUBMENU_VIEWNAME=&amp;quot;Another View&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that the language string must be enclosed in double quotes, as per Joomla!&#039;s translation standards. Important note: Joomla! 1.6 and later sorts the Component menu items based on the actual translation of the key you supply in your XML manifest. This means that the sorting order is correct no matter what you call your translation key and no matter which language the site is being displayed in. Essentially, Joomla! 1.6 fixed the wrong sorting of the Components menu experienced under Joomla! 1.5 for the majority (non-English speaking!) of Joomla! users.&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
{{warning|Components &#039;&#039;&#039;do not support&#039;&#039;&#039; configuration definitions &#039;&#039;&#039;in the manifest&#039;&#039;&#039;. This is a way implemented in Joomla! 1.5. They can define configuration options for multiple levels using [[Component configuration metadata]].}}&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;config&amp;gt;&amp;lt;/code&amp;gt; element, a child of the root, describes the configuration options for the extension. If applicable, the options will be shown by the appropriate Manager (Plugin Manager, Module Manager or Template Manager). &#039;&#039;&#039;Configuration options can also be defined in a separate file named &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt;. Its root element should be &amp;lt;code&amp;gt;&amp;lt;config&amp;gt;&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{:XML JForm form definitions}}&lt;br /&gt;
&lt;br /&gt;
=== SQL ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;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/example.install.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;&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/example.uninstall.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;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above example, we put the SQL files in the &amp;lt;tt&amp;gt;admin/sql&amp;lt;/tt&amp;gt; folder of the installation package. You have to include the &amp;lt;tt&amp;gt;sql&amp;lt;/tt&amp;gt; folder in the administration files (as described in &#039;&#039;Back-end files&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
You can execute SQL during the installation and/or uninstallation using the &amp;lt;code&amp;gt;&amp;lt;install&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;uninstall&amp;gt;&amp;lt;/code&amp;gt; elements, respectively. A &amp;lt;code&amp;gt;&amp;lt;sql&amp;gt;&amp;lt;/code&amp;gt; element should appear as a child of these elements. &amp;lt;code&amp;gt;&amp;lt;sql&amp;gt;&amp;lt;/code&amp;gt; can contain any number of &amp;lt;code&amp;gt;&amp;lt;file&amp;gt;&amp;lt;/code&amp;gt; elements, each defining a single SQL file to execute. Their database driver types are described by the &amp;lt;code&amp;gt;driver&amp;lt;/code&amp;gt; attribute, their character sets by the &amp;lt;code&amp;gt;charset&amp;lt;/code&amp;gt; attribute.&lt;br /&gt;
&lt;br /&gt;
==== Update of the SQL schema ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;update&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;schemapath type=&amp;quot;sqlsrv&amp;quot;&amp;gt;sql/updates/sqlsrv&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since 1.6, there is also an &amp;lt;code&amp;gt;&amp;lt;update&amp;gt;&amp;lt;/code&amp;gt; tag, which allows you to provide a series of SQL files to update the current schema.&lt;br /&gt;
&lt;br /&gt;
=== Language files ===&lt;br /&gt;
In Joomla! 1.5, extension developers had to put extension language files in the Joomla! main language file, using the &amp;lt;languages&amp;gt;..&amp;lt;/languages&amp;gt; tag as shown below. &#039;&#039;&#039;This method can still be used in&#039;&#039;&#039; {{rarr|2.5,3.x}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- Joomla! 1.5 language tag --&amp;gt;&lt;br /&gt;
&amp;lt;languages folder=&amp;quot;langfiles&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.com_example.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;
Since Joomla! 1.6 it has been encouraged placing your extension&#039;s language files in your extension folder. Joomla! will then automatically load your extension&#039;s language files.&lt;br /&gt;
&lt;br /&gt;
By storing extension language files in the extension folder, you gain the benefit of isolating and protecting your extension&#039;s language files.  For example, an administrator removes a language from their Joomla! installation. Your extension&#039;s language files will not be removed. They will remain in place and will be available if the language is installed again.&lt;br /&gt;
&lt;br /&gt;
The structure of the language folder for frontend and backend is the same. You put them in the language tag (e.g. &#039;&#039;&#039;en-GB&#039;&#039;&#039; ) of each language in your language folder i.e. &#039;&#039;&#039;language/en-GB/&#039;&#039;&#039;. You have to specify those folders in the front-end and back-end files too.&lt;br /&gt;
&lt;br /&gt;
In your manifest you simply include the &#039;&#039;&#039;&#039;language&#039;&#039;&#039;&#039; folder in your files section, the sub-directories for each language automatically be copied. Inside the &amp;lt;files&amp;gt; group you simply add a &amp;lt;folder&amp;gt; element alongside the items in the &#039;&#039;&#039;&amp;lt;files&amp;gt;&#039;&#039;&#039; group as shown in this example:&lt;br /&gt;
&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;filename plugin=&amp;quot;alpha&amp;quot;&amp;gt;alpha.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;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
&amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also notable that both ways can work together. Here is an example from core:&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;filename plugin=&amp;quot;languagecode&amp;quot;&amp;gt;languagecode.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
&amp;lt;/files&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;language/en-GB/en-GB.plg_system_languagecode.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.plg_system_languagecode.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;
The advantages of this solution are the following:&lt;br /&gt;
&lt;br /&gt;
All ini files present in the core folder have precedence over the files in the extension language/ folder.&lt;br /&gt;
For example a sys.ini file will always be loaded from core folders in back-end if it exists, except when installing an extension which contains a sys.ini file in a language folder. In that case and only that case, the sys.ini file in the extension folder will display its translated content at install time. This is very handy as a developer can have 2 sys.ini files with different contents. A description of the successful install as well as a tutorial in back-end for example.&lt;br /&gt;
&lt;br /&gt;
Also, it is much easier for a user needing an ini file for an extension that does not provide it in the language desired, to add it in the main folders. No risk for it to be deleted in case of uninstalling the extension by mistake or any other reason.&lt;br /&gt;
&lt;br /&gt;
See also:&lt;br /&gt;
*[[J2.5:Making non-core language packs|Making non-core language packs]]&lt;br /&gt;
*[[Creating language packs for extensions in Joomla 2.5]]&lt;br /&gt;
&lt;br /&gt;
During development you can turn on language debugging in the Joomla! global configuration. So you can investigate if a problems arises. As of 3.2, this is necessary to help debug as en-GB is &#039;&#039;&#039;always&#039;&#039;&#039; loaded first when not in debug mode to prevent displaying Constants.&lt;br /&gt;
&lt;br /&gt;
=== Script file ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;scriptfile&amp;gt;example.script.php&amp;lt;/scriptfile&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An optional &#039;&#039;&#039;script file&#039;&#039;&#039; (PHP code that is run before, during and/or after installation, uninstallation and upgrading) can be defined using a &amp;lt;code&amp;gt;&amp;lt;scriptfile&amp;gt;&amp;lt;/code&amp;gt; element. This file should contain a class named &amp;quot;&amp;lt;element_name&amp;gt;InstallerScript&amp;quot; where &amp;lt;element_name&amp;gt; is the name of your extension (e.g. com_componentname, mod_modulename, etc.). Plugins requires to state the group (e.g. plgsystempluginname). Library packages do not support scriptfiles. The structure of the class is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class com_componentnameInstallerScript&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   JAdapterInstance  $adapter  The object responsible for running this script&lt;br /&gt;
	 */&lt;br /&gt;
	public function __construct(JAdapterInstance $adapter);&lt;br /&gt;
	&lt;br /&gt;
	/**&lt;br /&gt;
	 * Called before any type of action&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   string  $route  Which action is happening (install|uninstall|discover_install|update)&lt;br /&gt;
	 * @param   JAdapterInstance  $adapter  The object responsible for running this script&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  boolean  True on success&lt;br /&gt;
	 */&lt;br /&gt;
	public function preflight($route, JAdapterInstance $adapter);&lt;br /&gt;
	&lt;br /&gt;
	/**&lt;br /&gt;
	 * Called after any type of action&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   string  $route  Which action is happening (install|uninstall|discover_install|update)&lt;br /&gt;
	 * @param   JAdapterInstance  $adapter  The object responsible for running this script&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  boolean  True on success&lt;br /&gt;
	 */&lt;br /&gt;
	public function postflight($route, JAdapterInstance $adapter);&lt;br /&gt;
	&lt;br /&gt;
	/**&lt;br /&gt;
	 * Called on installation&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   JAdapterInstance  $adapter  The object responsible for running this script&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  boolean  True on success&lt;br /&gt;
	 */&lt;br /&gt;
	public function install(JAdapterInstance $adapter);&lt;br /&gt;
	&lt;br /&gt;
	/**&lt;br /&gt;
	 * Called on update&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   JAdapterInstance  $adapter  The object responsible for running this script&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  boolean  True on success&lt;br /&gt;
	 */&lt;br /&gt;
	public function update(JAdapterInstance $adapter);&lt;br /&gt;
	&lt;br /&gt;
	/**&lt;br /&gt;
	 * Called on uninstallation&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   JAdapterInstance  $adapter  The object responsible for running this script&lt;br /&gt;
	 */&lt;br /&gt;
	public function uninstall(JAdapterInstance $adapter);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Update servers ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;updateservers&amp;gt;&lt;br /&gt;
        &amp;lt;server type=&amp;quot;extension&amp;quot; priority=&amp;quot;1&amp;quot; name=&amp;quot;Extension Update Site&amp;quot;&amp;gt;http://example.com/extension.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
        &amp;lt;server type=&amp;quot;collection&amp;quot; priority=&amp;quot;2&amp;quot; name=&amp;quot;Collection Update Site&amp;quot;&amp;gt;http://example.com/collection.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
    &amp;lt;/updateservers&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update servers can be defined in the &amp;lt;code&amp;gt;&amp;lt;updateservers&amp;gt;&amp;lt;/code&amp;gt; element, a child of the root. This element may contain one or more &amp;lt;code&amp;gt;&amp;lt;server&amp;gt;&amp;lt;/code&amp;gt; element, each describing a location to fetch updates from. Each &amp;lt;code&amp;gt;&amp;lt;server&amp;gt;&amp;lt;/code&amp;gt; item can define the following attributes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 150px&amp;quot; | Attribute || style=&amp;quot;width: 150px&amp;quot; | Values || Description&lt;br /&gt;
|-&lt;br /&gt;
| type || &amp;lt;code&amp;gt;extension&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;collection&amp;lt;/code&amp;gt; || The update server type&lt;br /&gt;
|-&lt;br /&gt;
| priority || &#039;&#039;integer&#039;&#039; || The priority of the update server&lt;br /&gt;
|-&lt;br /&gt;
| name || &#039;&#039;string&#039;&#039; || The name of the update server&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
More info:&lt;br /&gt;
* [[J2.5:Developing a MVC Component/Adding an update server|Building a Joomla! Extension - Adding an update server]]&lt;br /&gt;
* [[J2.5:Managing Component Updates|Managing Component Updates in Joomla 2.5]]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
For a real-life example, see [https://github.com/joomla/joomla-cms/blob/2.5.x/administrator/components/com_banners/banners.xml the manifest of the Banner component in the latest version of Joomla! 2.5].&lt;br /&gt;
&lt;br /&gt;
The Joomla testing process uses several extensions to test whether the installer works correctly. The latest versions of the manifests of these extensions are:&lt;br /&gt;
&lt;br /&gt;
* [http://svn.joomla.org/project/cms/development/trunk/tests/_data/installer_packages/com_alpha/alpha.xml com_alpha manifest]&lt;br /&gt;
* [http://svn.joomla.org/project/cms/development/trunk/tests/_data/installer_packages/mod_alpha/mod_alpha.xml mod_alpha manifest]&lt;br /&gt;
* [http://svn.joomla.org/project/cms/development/trunk/tests/_data/installer_packages/plg_system_alpha/alpha.xml plg_system_alpha manifest]&lt;br /&gt;
* [http://svn.joomla.org/project/cms/development/trunk/tests/_data/installer_packages/tpl_simple/templateDetails.xml tpl_simple manifest]&lt;br /&gt;
* [http://svn.joomla.org/project/cms/development/trunk/tests/_data/installer_packages/lng_xx-XX/xx-XX.xml lng_xx-XX manifest]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:akede|Alex Kempkens]]&lt;br /&gt;
*[[User:dperaza|Daniel Peraza]]&lt;br /&gt;
*[[User:nikosdion|Nicholas K. Dionysopoulos]]&lt;br /&gt;
*[[User:mrs.siam|Prasit Gebsaap]]&lt;br /&gt;
*[[User:cppl|Craig Phillips]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Extension development]]&lt;br /&gt;
[[Category:Specifications]]&lt;br /&gt;
[[Category:Needs to be marked for translation]]&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Talk:Standard_form_field_types&amp;diff=177815</id>
		<title>Talk:Standard form field types</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Talk:Standard_form_field_types&amp;diff=177815"/>
		<updated>2015-05-01T20:48:43Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: /* Possible missing documentation for Standard form field types */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== type captcha ==&lt;br /&gt;
&lt;br /&gt;
The type captcha doesn&#039;t provide a list of captcha options available, that is type plugin, folder captcha. The type captcha provides an input for validating. And that applies to the default captcha, others could provide different ways. Should both be described? How to type the plugin folder captcha? [[User:Sovainfo|Sovainfo]] ([[User talk:Sovainfo|talk]]) 14:49, 10 September 2013 (CDT)&lt;br /&gt;
&lt;br /&gt;
== desired content? ==&lt;br /&gt;
&lt;br /&gt;
Would like to change the format of these documents. Wonder what kind of information people are looking for. Instead of providing all the options on all documents would like to point to one document with all options in alpha order. Maybe in table format with checks which styles support which option. [[User:Sovainfo|Sovainfo]] ([[User talk:Sovainfo|talk]]) 07:17, 16 September 2013 (CDT)&lt;br /&gt;
&lt;br /&gt;
:I think such a page is coming. One of the GSOC students (Achal) has been working on the form fields generally for Joomla 3 (see [[Text_form_field_type/3.2]]) - and that&#039;s how his page seems to be shaping up. So I&#039;d hold on this for now until that is complete. However in my opinion we still need a list of all the form fields we have available in the core like we have now (even if we don&#039;t keep the subpages). --[[User:Wilsonge|Wilsonge]] ([[User talk:Wilsonge|talk]]) 18:17, 16 September 2013 (CDT)&lt;br /&gt;
:: Hope he&#039;ll reconsider the layout. I prefer a concise one page above the tabbed window. Considering it is information for developers you might start with the example code! Maybe mention what script implements it. Or even show the script itself. [[User:Sovainfo|Sovainfo]] ([[User talk:Sovainfo|talk]]) 15:16, 17 September 2013 (CDT) &lt;br /&gt;
&lt;br /&gt;
== combo ==&lt;br /&gt;
&lt;br /&gt;
Haven&#039;t found the combo field type. Can it be removed? [[User:Sovainfo|Sovainfo]] ([[User talk:Sovainfo|talk]]) 07:19, 16 September 2013 (CDT)&lt;br /&gt;
&lt;br /&gt;
:I don&#039;t think the core doesn&#039;t use it - you&#039;re right - but it still seems to exist in the core code for people to use so we should be documenting it. https://github.com/joomla/joomla-cms/blob/master/libraries/joomla/form/fields/combo.php . --[[User:Wilsonge|Wilsonge]] ([[User talk:Wilsonge|talk]]) 18:12, 16 September 2013 (CDT)&lt;br /&gt;
:: ok, will work on it. [[User:Sovainfo|Sovainfo]] ([[User talk:Sovainfo|talk]]) 15:16, 17 September 2013 (CDT)&lt;br /&gt;
&lt;br /&gt;
== Possible missing documentation for Standard form field types ==&lt;br /&gt;
&lt;br /&gt;
The following files are in the core code but lack documentation if they are Standard form field types  &lt;br /&gt;
&lt;br /&gt;
* meter&lt;br /&gt;
* number&lt;br /&gt;
* predefinedlist&lt;br /&gt;
* range&lt;br /&gt;
&lt;br /&gt;
--[[User:Waltsjt|Waltsjt]] ([[User talk:Waltsjt|talk]]) 17:06, 30 April 2015 (CDT)&lt;br /&gt;
-these have been added a --[[User:Waltsjt|Waltsjt]] ([[User talk:Waltsjt|talk]]) 15:48, 1 May 2015 (CDT)&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Standard_form_field_types&amp;diff=177814</id>
		<title>Standard form field types</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Standard_form_field_types&amp;diff=177814"/>
		<updated>2015-05-01T19:45:35Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: Add description for field type file --~~~~&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Numerous types of [[form field]] are built into Joomla!. The following table lists these standard types and their availability. Use the [[/Single-page reference|single-page reference]] if you want to print all existing form field documentation.&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}} Please note that many of these fields are available as [[Parameter|parameter types]] in Joomla! 1.5. For a list of parameter types, see [[J1.5:Standard parameter types]]. For a comparison between form field and parameter types, see [[Standard form field and parameter types]].&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;vertical-align:top; border:1px solid Sienna; background-color:Cornsilk;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:Wheat; font-weight:bold; text-align: left;&amp;quot;&lt;br /&gt;
!width=15%|Type&lt;br /&gt;
!width=65%|Description&lt;br /&gt;
!width=20%|Availability&lt;br /&gt;
|-&lt;br /&gt;
|[[Accesslevel form field type|accesslevel]]&lt;br /&gt;
|provides a drop down list of viewing access levels.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Cachehandler form field type|cachehandler]]&lt;br /&gt;
|provides a list of available cache handling options.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Calendar form field type|calendar]]&lt;br /&gt;
|provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Captcha form field type|captcha]]&lt;br /&gt;
|provides a drop down list of the captcha plugins.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Category form field type|category]]&lt;br /&gt;
|provides a drop down list of categories for an extension.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Checkbox form field type|checkbox]]&lt;br /&gt;
|provides a single checkbox to be checked or unchecked&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Checkboxes form field type|checkboxes]]&lt;br /&gt;
|provides unlimited checkboxes that can be used for multi-select.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ChromeStyle form field type|Chrome Style]]&lt;br /&gt;
|provides a list of template chrome style options grouped by template.&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Color form field type|color]]&lt;br /&gt;
|provides a color picker when clicking the input box.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ContentLanguage form field type|Content Language]]&lt;br /&gt;
|Provides a list of content languages.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Contenttype form field type|Content Type]]&lt;br /&gt;
|Provides a list of content types.&lt;br /&gt;
|{{JVer|3.1}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Combo form field type|combo]]&lt;br /&gt;
|provides a combo box field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Componentlayout form field type|componentlayout]]&lt;br /&gt;
|provides a grouped list of core and template alternate layouts for a component item.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Contentlanguage form field type|contentlanguage]]&lt;br /&gt;
|provides a list of installed content languages for use in conjunction with the language switcher plugin.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[DatabaseConnection form field type|Database Connection]]&lt;br /&gt;
|Provides a list of available database connections, optionally limiting to a given list.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Editor form field type|editor]]&lt;br /&gt;
|provides an editor area field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Editors form field type|editors]]&lt;br /&gt;
|Provides a drop down list of the available WYSIWYG editors. Since {{JVer|2.5}} use [[Plugins form field type|plugins form field]] instead.&lt;br /&gt;
|{{JVer|2.5}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Email form field type|email]]&lt;br /&gt;
|provides an email field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[File form field type|file]]&lt;br /&gt;
|Provides an input field for files&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Filelist form field type|filelist]]&lt;br /&gt;
|provides a drop down list of files from a specified directory.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Folderlist form field type|folderlist]]&lt;br /&gt;
|provides a drop down list of folders from a specified directory.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Groupedlist form field type|groupedlist]]&lt;br /&gt;
|provides a drop down list of items organized into groups.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[HeaderTag form field type|header tag]]&lt;br /&gt;
|provides a drop down list of the header tags (h1-h6).&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Helpsite form field type|helpsite]]&lt;br /&gt;
|provides a drop down list of the help sites for your Joomla installation.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Hidden form field type|hidden]]&lt;br /&gt;
|provides a hidden field for saving a form field whose value cannot be altered directly by a user in the Administrator (it can be altered in code or by editing the &#039;&#039;params.ini&#039;&#039; file).&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Imagelist form field type|imagelist]]&lt;br /&gt;
|provides a drop down list of image files in a specified directory.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|[[Integer form field type|integer]]&lt;br /&gt;
|provides a drop down list of integers between a minimum and maximum.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Language form field type|language]]&lt;br /&gt;
|provides a drop down list of the installed languages for the Front-end or Back-end.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[List form field type|list]]&lt;br /&gt;
|provides a drop down list of custom-defined entries.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Media form field type|media]]&lt;br /&gt;
|provides modal access to the media manager for insertion of images with upload for users with appropriate permissions.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Menu form field type|menu]]&lt;br /&gt;
|provides a drop down list of the available menus from your Joomla site.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Menuitem form field type|Menu Item]]&lt;br /&gt;
|provides a drop down list of the available menu items from your Joomla site.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Meter form field type|meter]]&lt;br /&gt;
|Provides a meter to show value in a range.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Modulelayout form field type|Module Layout]]&lt;br /&gt;
|provides a list of alternative layout for a module grouped by core and template.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ModuleOrder form field type|Module Order]]&lt;br /&gt;
|Provides a drop down to set the ordering of module in a given position&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ModulePosition form field type|Module Position]]&lt;br /&gt;
|provides a text input to set the position of a module.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ModuleTag form field type|Module Tag]]&lt;br /&gt;
|provides a list of html5 elements (used to wrap a module in).&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Note form field type|note]]&lt;br /&gt;
|supports a one line text field.&lt;br /&gt;
|{{JVer|3.1}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Number form field type|number]]&lt;br /&gt;
|Provides a one line text box with up-down handles to set a number in the field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Password form field type|password]]&lt;br /&gt;
|provides a text box for entry of a password.  The password characters will be obscured as they are entered.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Plugins form field type|plugins]]&lt;br /&gt;
|provides a list of plugins from a given folder.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Predefined List form field type|predefinedlist]]&lt;br /&gt;
|Form Field to load a list of predefined values.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Radio form field type|radio]]&lt;br /&gt;
|provides radio buttons to select different options.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Range form field type|range]]&lt;br /&gt;
|Provides a horizontal scroll bar to specify a value in a range.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Repeatable form field type|repeatable]]&lt;br /&gt;
|Allows form fields which can have as many options as the user desires.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Rules form field type|rules]]&lt;br /&gt;
|provides a matrix of group by action options for managing access control. Display depends on context.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Sessionhandler form field type|sessionhandler]]&lt;br /&gt;
|provides a drop down list of session handler options.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Spacer form field type|spacer]]&lt;br /&gt;
|provides a visual separator between form fields.  It is purely a visual aid and no value is stored.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[SQL form field type|sql]]&lt;br /&gt;
|provides a drop down list of entries obtained by running a query on the Joomla Database.  The first results column returned by the query provides the values for the drop down box.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Tag form field type|tag]]&lt;br /&gt;
|provides an entry point for tags (either AJAX or Nested).&lt;br /&gt;
|{{JVer|3.1}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Tel form field type|tel]]&lt;br /&gt;
|provides an input field for a telephone number.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Templatestyle form field type|templatestyle]]&lt;br /&gt;
|provides a drop down list of template styles.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Text form field type|text]]&lt;br /&gt;
|provides a text box for data entry.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Textarea form field type|textarea]]&lt;br /&gt;
|provides a text area for entry of multi-line text.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Timezone form field type|timezone]]&lt;br /&gt;
|provides a drop down list of time zones.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[URL form field type|URL]]&lt;br /&gt;
|provides a URL text input field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[User form field type|user]]&lt;br /&gt;
|provides a modal list of users.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Usergroup form field type|usergroup]]&lt;br /&gt;
|provides a drop down list of user groups. &lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Form fields]]&lt;br /&gt;
[[Category:Development Reference]]&lt;br /&gt;
[[Category:Needs to be marked for translation]]&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Standard_form_field_types&amp;diff=177813</id>
		<title>Standard form field types</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Standard_form_field_types&amp;diff=177813"/>
		<updated>2015-05-01T19:40:16Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: missing documentation for Standard form field types: meter, number, predefinedlist, and range --~~~~&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Numerous types of [[form field]] are built into Joomla!. The following table lists these standard types and their availability. Use the [[/Single-page reference|single-page reference]] if you want to print all existing form field documentation.&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}} Please note that many of these fields are available as [[Parameter|parameter types]] in Joomla! 1.5. For a list of parameter types, see [[J1.5:Standard parameter types]]. For a comparison between form field and parameter types, see [[Standard form field and parameter types]].&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;vertical-align:top; border:1px solid Sienna; background-color:Cornsilk;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:Wheat; font-weight:bold; text-align: left;&amp;quot;&lt;br /&gt;
!width=15%|Type&lt;br /&gt;
!width=65%|Description&lt;br /&gt;
!width=20%|Availability&lt;br /&gt;
|-&lt;br /&gt;
|[[Accesslevel form field type|accesslevel]]&lt;br /&gt;
|provides a drop down list of viewing access levels.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Cachehandler form field type|cachehandler]]&lt;br /&gt;
|provides a list of available cache handling options.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Calendar form field type|calendar]]&lt;br /&gt;
|provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Captcha form field type|captcha]]&lt;br /&gt;
|provides a drop down list of the captcha plugins.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Category form field type|category]]&lt;br /&gt;
|provides a drop down list of categories for an extension.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Checkbox form field type|checkbox]]&lt;br /&gt;
|provides a single checkbox to be checked or unchecked&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Checkboxes form field type|checkboxes]]&lt;br /&gt;
|provides unlimited checkboxes that can be used for multi-select.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ChromeStyle form field type|Chrome Style]]&lt;br /&gt;
|provides a list of template chrome style options grouped by template.&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Color form field type|color]]&lt;br /&gt;
|provides a color picker when clicking the input box.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ContentLanguage form field type|Content Language]]&lt;br /&gt;
|Provides a list of content languages.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Contenttype form field type|Content Type]]&lt;br /&gt;
|Provides a list of content types.&lt;br /&gt;
|{{JVer|3.1}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Combo form field type|combo]]&lt;br /&gt;
|provides a combo box field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Componentlayout form field type|componentlayout]]&lt;br /&gt;
|provides a grouped list of core and template alternate layouts for a component item.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Contentlanguage form field type|contentlanguage]]&lt;br /&gt;
|provides a list of installed content languages for use in conjunction with the language switcher plugin.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[DatabaseConnection form field type|Database Connection]]&lt;br /&gt;
|Provides a list of available database connections, optionally limiting to a given list.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Editor form field type|editor]]&lt;br /&gt;
|provides an editor area field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Editors form field type|editors]]&lt;br /&gt;
|Provides a drop down list of the available WYSIWYG editors. Since {{JVer|2.5}} use [[Plugins form field type|plugins form field]] instead.&lt;br /&gt;
|{{JVer|2.5}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Email form field type|email]]&lt;br /&gt;
|provides an email field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[File form field type|file]]&lt;br /&gt;
|&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Filelist form field type|filelist]]&lt;br /&gt;
|provides a drop down list of files from a specified directory.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Folderlist form field type|folderlist]]&lt;br /&gt;
|provides a drop down list of folders from a specified directory.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Groupedlist form field type|groupedlist]]&lt;br /&gt;
|provides a drop down list of items organized into groups.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[HeaderTag form field type|header tag]]&lt;br /&gt;
|provides a drop down list of the header tags (h1-h6).&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Helpsite form field type|helpsite]]&lt;br /&gt;
|provides a drop down list of the help sites for your Joomla installation.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Hidden form field type|hidden]]&lt;br /&gt;
|provides a hidden field for saving a form field whose value cannot be altered directly by a user in the Administrator (it can be altered in code or by editing the &#039;&#039;params.ini&#039;&#039; file).&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Imagelist form field type|imagelist]]&lt;br /&gt;
|provides a drop down list of image files in a specified directory.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|[[Integer form field type|integer]]&lt;br /&gt;
|provides a drop down list of integers between a minimum and maximum.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Language form field type|language]]&lt;br /&gt;
|provides a drop down list of the installed languages for the Front-end or Back-end.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[List form field type|list]]&lt;br /&gt;
|provides a drop down list of custom-defined entries.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Media form field type|media]]&lt;br /&gt;
|provides modal access to the media manager for insertion of images with upload for users with appropriate permissions.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Menu form field type|menu]]&lt;br /&gt;
|provides a drop down list of the available menus from your Joomla site.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Menuitem form field type|Menu Item]]&lt;br /&gt;
|provides a drop down list of the available menu items from your Joomla site.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Meter form field type|meter]]&lt;br /&gt;
|Provides a meter to show value in a range.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Modulelayout form field type|Module Layout]]&lt;br /&gt;
|provides a list of alternative layout for a module grouped by core and template.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ModuleOrder form field type|Module Order]]&lt;br /&gt;
|Provides a drop down to set the ordering of module in a given position&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ModulePosition form field type|Module Position]]&lt;br /&gt;
|provides a text input to set the position of a module.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[ModuleTag form field type|Module Tag]]&lt;br /&gt;
|provides a list of html5 elements (used to wrap a module in).&lt;br /&gt;
|{{JVer|3.0}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Note form field type|note]]&lt;br /&gt;
|supports a one line text field.&lt;br /&gt;
|{{JVer|3.1}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Number form field type|number]]&lt;br /&gt;
|Provides a one line text box with up-down handles to set a number in the field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Password form field type|password]]&lt;br /&gt;
|provides a text box for entry of a password.  The password characters will be obscured as they are entered.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Plugins form field type|plugins]]&lt;br /&gt;
|provides a list of plugins from a given folder.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Predefined List form field type|predefinedlist]]&lt;br /&gt;
|Form Field to load a list of predefined values.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Radio form field type|radio]]&lt;br /&gt;
|provides radio buttons to select different options.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Range form field type|range]]&lt;br /&gt;
|Provides a horizontal scroll bar to specify a value in a range.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Repeatable form field type|repeatable]]&lt;br /&gt;
|Allows form fields which can have as many options as the user desires.&lt;br /&gt;
|{{JVer|3.2}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Rules form field type|rules]]&lt;br /&gt;
|provides a matrix of group by action options for managing access control. Display depends on context.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Sessionhandler form field type|sessionhandler]]&lt;br /&gt;
|provides a drop down list of session handler options.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Spacer form field type|spacer]]&lt;br /&gt;
|provides a visual separator between form fields.  It is purely a visual aid and no value is stored.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[SQL form field type|sql]]&lt;br /&gt;
|provides a drop down list of entries obtained by running a query on the Joomla Database.  The first results column returned by the query provides the values for the drop down box.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Tag form field type|tag]]&lt;br /&gt;
|provides an entry point for tags (either AJAX or Nested).&lt;br /&gt;
|{{JVer|3.1}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Tel form field type|tel]]&lt;br /&gt;
|provides an input field for a telephone number.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Templatestyle form field type|templatestyle]]&lt;br /&gt;
|provides a drop down list of template styles.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Text form field type|text]]&lt;br /&gt;
|provides a text box for data entry.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Textarea form field type|textarea]]&lt;br /&gt;
|provides a text area for entry of multi-line text.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Timezone form field type|timezone]]&lt;br /&gt;
|provides a drop down list of time zones.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[URL form field type|URL]]&lt;br /&gt;
|provides a URL text input field.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[User form field type|user]]&lt;br /&gt;
|provides a modal list of users.&lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|-&lt;br /&gt;
|[[Usergroup form field type|usergroup]]&lt;br /&gt;
|provides a drop down list of user groups. &lt;br /&gt;
|{{JVer|2.5}} and newer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Form fields]]&lt;br /&gt;
[[Category:Development Reference]]&lt;br /&gt;
[[Category:Needs to be marked for translation]]&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Talk:Standard_form_field_types&amp;diff=177720</id>
		<title>Talk:Standard form field types</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Talk:Standard_form_field_types&amp;diff=177720"/>
		<updated>2015-04-30T22:06:47Z</updated>

		<summary type="html">&lt;p&gt;Waltsjt: start discussion about possible missing documentation --~~~~&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== type captcha ==&lt;br /&gt;
&lt;br /&gt;
The type captcha doesn&#039;t provide a list of captcha options available, that is type plugin, folder captcha. The type captcha provides an input for validating. And that applies to the default captcha, others could provide different ways. Should both be described? How to type the plugin folder captcha? [[User:Sovainfo|Sovainfo]] ([[User talk:Sovainfo|talk]]) 14:49, 10 September 2013 (CDT)&lt;br /&gt;
&lt;br /&gt;
== desired content? ==&lt;br /&gt;
&lt;br /&gt;
Would like to change the format of these documents. Wonder what kind of information people are looking for. Instead of providing all the options on all documents would like to point to one document with all options in alpha order. Maybe in table format with checks which styles support which option. [[User:Sovainfo|Sovainfo]] ([[User talk:Sovainfo|talk]]) 07:17, 16 September 2013 (CDT)&lt;br /&gt;
&lt;br /&gt;
:I think such a page is coming. One of the GSOC students (Achal) has been working on the form fields generally for Joomla 3 (see [[Text_form_field_type/3.2]]) - and that&#039;s how his page seems to be shaping up. So I&#039;d hold on this for now until that is complete. However in my opinion we still need a list of all the form fields we have available in the core like we have now (even if we don&#039;t keep the subpages). --[[User:Wilsonge|Wilsonge]] ([[User talk:Wilsonge|talk]]) 18:17, 16 September 2013 (CDT)&lt;br /&gt;
:: Hope he&#039;ll reconsider the layout. I prefer a concise one page above the tabbed window. Considering it is information for developers you might start with the example code! Maybe mention what script implements it. Or even show the script itself. [[User:Sovainfo|Sovainfo]] ([[User talk:Sovainfo|talk]]) 15:16, 17 September 2013 (CDT) &lt;br /&gt;
&lt;br /&gt;
== combo ==&lt;br /&gt;
&lt;br /&gt;
Haven&#039;t found the combo field type. Can it be removed? [[User:Sovainfo|Sovainfo]] ([[User talk:Sovainfo|talk]]) 07:19, 16 September 2013 (CDT)&lt;br /&gt;
&lt;br /&gt;
:I don&#039;t think the core doesn&#039;t use it - you&#039;re right - but it still seems to exist in the core code for people to use so we should be documenting it. https://github.com/joomla/joomla-cms/blob/master/libraries/joomla/form/fields/combo.php . --[[User:Wilsonge|Wilsonge]] ([[User talk:Wilsonge|talk]]) 18:12, 16 September 2013 (CDT)&lt;br /&gt;
:: ok, will work on it. [[User:Sovainfo|Sovainfo]] ([[User talk:Sovainfo|talk]]) 15:16, 17 September 2013 (CDT)&lt;br /&gt;
&lt;br /&gt;
== Possible missing documentation for Standard form field types ==&lt;br /&gt;
&lt;br /&gt;
The following files are in the core code but lack documentation if they are Standard form field types  &lt;br /&gt;
&lt;br /&gt;
* meter&lt;br /&gt;
* number&lt;br /&gt;
* predefinedlist&lt;br /&gt;
* range&lt;br /&gt;
&lt;br /&gt;
--[[User:Waltsjt|Waltsjt]] ([[User talk:Waltsjt|talk]]) 17:06, 30 April 2015 (CDT)&lt;/div&gt;</summary>
		<author><name>Waltsjt</name></author>
	</entry>
</feed>