<?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=Mvangeest</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=Mvangeest"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Mvangeest"/>
	<updated>2026-07-09T16:04:57Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Manifest_files&amp;diff=234849</id>
		<title>Manifest files</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Manifest_files&amp;diff=234849"/>
		<updated>2015-09-24T20:49:34Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Added information about the plugin attribute&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;{{page|needs updating|}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Joomla version|version=3.x}} {{Joomla version|version=2.5|status=eos}} &lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;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 [[S:MyLanguage/extension|extension]] itself. Since Joomla! 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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==Naming conventions== &amp;lt;!--T:2--&amp;gt;&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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==Syntax== &amp;lt;!--T:3--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Root element === &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
The primary tag of the installation file is:&amp;lt;/translate&amp;gt; &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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;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:&amp;lt;/translate&amp;gt;&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; | &amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
Attribute&amp;lt;/translate&amp;gt; || style=&amp;quot;width: 150px&amp;quot; | &amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
Values&amp;lt;/translate&amp;gt; || &amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
Applicable&amp;amp;nbsp;to&amp;lt;/translate&amp;gt; || &amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
Description&amp;lt;/translate&amp;gt;&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; || &amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
All extensions&amp;lt;/translate&amp;gt;&lt;br /&gt;
| &amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
This attribute describes the type of the extension for the installer. Based on this type further requirements to sub-tags apply.&amp;lt;/translate&amp;gt;&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; || &amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
All extensions&amp;lt;/translate&amp;gt;&lt;br /&gt;
| &amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
String that identifies the version of Joomla for which this extension is developed.&amp;lt;/translate&amp;gt;&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; || &amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
All extensions&amp;lt;/translate&amp;gt;&lt;br /&gt;
| &amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt;&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.&amp;lt;/translate&amp;gt;&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; || &amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
Modules&amp;lt;/translate&amp;gt;&lt;br /&gt;
| &amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The client attribute allows you to specify for which application client the new module is available.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| group&lt;br /&gt;
| &#039;&#039;string&#039;&#039; || &amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
Plugins&amp;lt;/translate&amp;gt;&lt;br /&gt;
| &amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt;&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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Metadata === &amp;lt;!--T:20--&amp;gt;&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;
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.&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Front-end files === &amp;lt;!--T:23--&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;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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;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;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
For &#039;&#039;&#039;plugins&#039;&#039;&#039;, the raw name of the plugin should be placed in the &amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt; attribute on the &amp;lt;code&amp;gt;&amp;lt;filename&amp;gt;&amp;lt;/code&amp;gt; element that points to the file containing the plugin&#039;s class. For example, in the case of a system plugin called &amp;quot;example&amp;quot; (full name &amp;lt;code&amp;gt;plg_system_example&amp;lt;/code&amp;gt;), use &amp;lt;code&amp;gt;&amp;lt;filename plugin=&amp;quot;example&amp;quot;&amp;gt;example.php&amp;lt;/filename&amp;gt;&amp;lt;/code&amp;gt;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Media files === &amp;lt;!--T:25--&amp;gt;&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;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;).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;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.&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;=== Administration section === &amp;lt;!--T:28--&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;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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;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;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==== Back-end files ==== &amp;lt;!--T:30--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:31--&amp;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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==== Menu links and submenus ==== &amp;lt;!--T:32--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{dablink|&amp;lt;translate&amp;gt;&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Version Note:&#039;&#039;&#039; Prior to Joomla 3.4, not having a &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;menu&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; tag in your manifest XML file still led to a menu item being created. This bug was fixed in Joomla 3.4, so if there is no &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;menu&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; tag in your manifest file, then no admin menu item is created for the component.&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;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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:34--&amp;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;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:35--&amp;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:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 150px&amp;quot; | &amp;lt;translate&amp;gt;&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Attribute&amp;lt;/translate&amp;gt; || &amp;lt;translate&amp;gt;&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Description&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| link || &amp;lt;translate&amp;gt;&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
A link to send the user to when the menu item is clicked&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| img || &amp;lt;translate&amp;gt;&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
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;&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| alt ||&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;string&#039;&#039; || &amp;lt;translate&amp;gt;&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
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;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:41--&amp;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.&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;
The contents of that file should be:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:43--&amp;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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Configuration === &amp;lt;!--T:44--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{warning|&amp;lt;translate&amp;gt;&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
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 [[S:MyLanguage/Component configuration metadata|Component configuration metadata]].&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:46--&amp;gt;&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;&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;
Each fieldset must contain one or more &amp;lt;code&amp;gt;&amp;lt;field&amp;gt;&amp;lt;/code&amp;gt; elements, each representing a single [[S:MyLanguage/form field|form field]] with a label. See [[S:MyLanguage/Standard form field types|Standard form field types]] for a list of allowed form field types and example XML form field definitions.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== SQL === &amp;lt;!--T:48--&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;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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:49--&amp;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;).&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;
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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==== Update of the SQL schema ==== &amp;lt;!--T:51--&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;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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:52--&amp;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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Language files === &amp;lt;!--T:53--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
In Joomla! 1.5, extension developers had to put extension language files in the Joomla! main language file, using the &amp;amp;lt;languages&amp;amp;gt;...&amp;amp;lt;/languages&amp;amp;gt; tag as shown below. &#039;&#039;&#039;This method can still be used in Joomla!&#039;&#039;&#039; {{JVer|3.x}}.&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;!-- 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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:55--&amp;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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:56--&amp;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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:57--&amp;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.&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;
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:&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;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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
It is also notable that both ways can work together. Here is an example from core:&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;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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
The advantages of this solution are the following:&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;
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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:62--&amp;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.&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;
See also:&lt;br /&gt;
*[[S:MyLanguage/J2.5:Making non-core language packs|Making non-core language packs]]&lt;br /&gt;
*[[S:MyLanguage/Creating language packs for extensions in Joomla 2.5|Creating language packs for extensions in Joomla 2.5]]&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;
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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Script file === &amp;lt;!--T:65--&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;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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:66--&amp;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:&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;
&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;
&amp;lt;translate&amp;gt;=== Update servers === &amp;lt;!--T:67--&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;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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:68--&amp;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:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 150px&amp;quot; | &amp;lt;translate&amp;gt;&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Attribute&amp;lt;/translate&amp;gt; || style=&amp;quot;width: 150px&amp;quot; | &amp;lt;translate&amp;gt;&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
Values&amp;lt;/translate&amp;gt; || &amp;lt;translate&amp;gt;&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
Description&amp;lt;/translate&amp;gt;&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; || &amp;lt;translate&amp;gt;&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
The update server type&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| priority || &#039;&#039;integer&#039;&#039; || &amp;lt;translate&amp;gt;&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
The priority of the update server&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| name || &#039;&#039;string&#039;&#039; || &amp;lt;translate&amp;gt;&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
The name of the update server&amp;lt;/translate&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
More info:&lt;br /&gt;
* [[S:MyLanguage/J2.5:Developing a MVC Component/Adding an update server|Building a Joomla! Extension - Adding an update server]]&lt;br /&gt;
* [[S:MyLanguage/J2.5:Managing Component Updates|Managing Component Updates in Joomla 2.5]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Examples == &amp;lt;!--T:76--&amp;gt;&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].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:77--&amp;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:&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;== Contributors == &amp;lt;!--T:78--&amp;gt;&amp;lt;/translate&amp;gt;&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;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Extension development]]&lt;br /&gt;
[[Category:Specifications]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Manifest_files&amp;diff=232400</id>
		<title>Manifest files</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Manifest_files&amp;diff=232400"/>
		<updated>2015-09-19T14:05:19Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Adjusted wording&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;{{page|needs updating|}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Joomla version|version=3.x}} {{Joomla version|version=2.5|time=and after|status=eos}} &lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;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 [[S:MyLanguage/extension|extension]] itself. Since Joomla! 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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==Naming conventions== &amp;lt;!--T:2--&amp;gt;&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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==Syntax== &amp;lt;!--T:3--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Root element === &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
The primary tag of the installation file is:&amp;lt;/translate&amp;gt; &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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;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:&amp;lt;/translate&amp;gt;&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; | &amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
Attribute&amp;lt;/translate&amp;gt; || style=&amp;quot;width: 150px&amp;quot; | &amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
Values&amp;lt;/translate&amp;gt; || &amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
Applicable&amp;amp;nbsp;to&amp;lt;/translate&amp;gt; || &amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
Description&amp;lt;/translate&amp;gt;&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; || &amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
All extensions&amp;lt;/translate&amp;gt;&lt;br /&gt;
| &amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
This attribute describes the type of the extension for the installer. Based on this type further requirements to sub-tags apply.&amp;lt;/translate&amp;gt;&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; || &amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
All extensions&amp;lt;/translate&amp;gt;&lt;br /&gt;
| &amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
String that identifies the version of Joomla for which this extension is developed.&amp;lt;/translate&amp;gt;&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; || &amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
All extensions&amp;lt;/translate&amp;gt;&lt;br /&gt;
| &amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt;&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.&amp;lt;/translate&amp;gt;&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; || &amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
Modules&amp;lt;/translate&amp;gt;&lt;br /&gt;
| &amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The client attribute allows you to specify for which application client the new module is available.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| group&lt;br /&gt;
| &#039;&#039;string&#039;&#039; || &amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
Plugins&amp;lt;/translate&amp;gt;&lt;br /&gt;
| &amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt;&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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Metadata === &amp;lt;!--T:20--&amp;gt;&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;
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.&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Front-end files === &amp;lt;!--T:23--&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;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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;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;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Media files === &amp;lt;!--T:25--&amp;gt;&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;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;).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;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.&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;=== Administration section === &amp;lt;!--T:28--&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;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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;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;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==== Back-end files ==== &amp;lt;!--T:30--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:31--&amp;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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==== Menu links and submenus ==== &amp;lt;!--T:32--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{dablink|&amp;lt;translate&amp;gt;&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Version Note:&#039;&#039;&#039; Prior to Joomla 3.4, not having a &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;menu&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; tag in your manifest XML file still led to a menu item being created. This bug was fixed in Joomla 3.4, so if there is no &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;menu&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; tag in your manifest file, then no admin menu item is created for the component.&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;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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:34--&amp;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;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:35--&amp;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:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 150px&amp;quot; | &amp;lt;translate&amp;gt;&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Attribute&amp;lt;/translate&amp;gt; || &amp;lt;translate&amp;gt;&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Description&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| link || &amp;lt;translate&amp;gt;&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
A link to send the user to when the menu item is clicked&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| img || &amp;lt;translate&amp;gt;&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
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;&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| alt ||&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;string&#039;&#039; || &amp;lt;translate&amp;gt;&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
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;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:41--&amp;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.&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;
The contents of that file should be:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:43--&amp;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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Configuration === &amp;lt;!--T:44--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{warning|&amp;lt;translate&amp;gt;&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
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 [[S:MyLanguage/Component configuration metadata|Component configuration metadata]].&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:46--&amp;gt;&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;&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;
Each fieldset must contain one or more &amp;lt;code&amp;gt;&amp;lt;field&amp;gt;&amp;lt;/code&amp;gt; elements, each representing a single [[S:MyLanguage/form field|form field]] with a label. See [[S:MyLanguage/Standard form field types|Standard form field types]] for a list of allowed form field types and example XML form field definitions.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== SQL === &amp;lt;!--T:48--&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;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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:49--&amp;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;).&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;
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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;==== Update of the SQL schema ==== &amp;lt;!--T:51--&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;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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:52--&amp;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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Language files === &amp;lt;!--T:53--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
In Joomla! 1.5, extension developers had to put extension language files in the Joomla! main language file, using the &amp;amp;lt;languages&amp;amp;gt;...&amp;amp;lt;/languages&amp;amp;gt; tag as shown below. &#039;&#039;&#039;This method can still be used in Joomla!&#039;&#039;&#039; {{JVer|3.x}}.&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;!-- 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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:55--&amp;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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:56--&amp;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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:57--&amp;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.&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;
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:&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;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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
It is also notable that both ways can work together. Here is an example from core:&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;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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
The advantages of this solution are the following:&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;
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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:62--&amp;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.&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;
See also:&lt;br /&gt;
*[[S:MyLanguage/J2.5:Making non-core language packs|Making non-core language packs]]&lt;br /&gt;
*[[S:MyLanguage/Creating language packs for extensions in Joomla 2.5|Creating language packs for extensions in Joomla 2.5]]&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;
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.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Script file === &amp;lt;!--T:65--&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;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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:66--&amp;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:&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;
&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;
&amp;lt;translate&amp;gt;=== Update servers === &amp;lt;!--T:67--&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;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;
&amp;lt;translate&amp;gt;&amp;lt;!--T:68--&amp;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:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 150px&amp;quot; | &amp;lt;translate&amp;gt;&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Attribute&amp;lt;/translate&amp;gt; || style=&amp;quot;width: 150px&amp;quot; | &amp;lt;translate&amp;gt;&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
Values&amp;lt;/translate&amp;gt; || &amp;lt;translate&amp;gt;&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
Description&amp;lt;/translate&amp;gt;&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; || &amp;lt;translate&amp;gt;&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
The update server type&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| priority || &#039;&#039;integer&#039;&#039; || &amp;lt;translate&amp;gt;&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
The priority of the update server&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| name || &#039;&#039;string&#039;&#039; || &amp;lt;translate&amp;gt;&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
The name of the update server&amp;lt;/translate&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
More info:&lt;br /&gt;
* [[S:MyLanguage/J2.5:Developing a MVC Component/Adding an update server|Building a Joomla! Extension - Adding an update server]]&lt;br /&gt;
* [[S:MyLanguage/J2.5:Managing Component Updates|Managing Component Updates in Joomla 2.5]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Examples == &amp;lt;!--T:76--&amp;gt;&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].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:77--&amp;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:&amp;lt;/translate&amp;gt;&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;
&amp;lt;translate&amp;gt;== Contributors == &amp;lt;!--T:78--&amp;gt;&amp;lt;/translate&amp;gt;&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;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Extension development]]&lt;br /&gt;
[[Category:Specifications]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Creating_a_language_definition_file&amp;diff=231462</id>
		<title>Creating a language definition file</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Creating_a_language_definition_file&amp;diff=231462"/>
		<updated>2015-09-17T21:03:41Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Rewrote article for Joomla 3 based on the Specification page, the PHP docs, the JLanguage source code, core language files and user comments. The warning is no longer necessary.&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;
{{Joomla version|version=3.x|comment=&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
series&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{notice|&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
The page [[S:MyLanguage/Specification of language files|Specification of language files]] contains some more details that should be &#039;&#039;&#039;verified&#039;&#039;&#039; - as it is no longer completely up-to-date - and then merged into this page.&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Joomla! language definition files are written in the very basic &#039;&#039;[[wikipedia:INI file|INI file format]]&#039;&#039;. They must be saved &#039;&#039;using the UTF-8 encoding&#039;&#039;. Blank lines and lines beginning with &amp;lt;code&amp;gt;;&amp;lt;/code&amp;gt; are ignored and the latter may be used to add comments to the file. Each line consists of a key-value pair separated by an equals sign like this:&lt;br /&gt;
&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;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
KEY=&amp;quot;value&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;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;
where &amp;lt;code&amp;gt;KEY&amp;lt;/code&amp;gt; is a string to be translated and &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is the translated string. For example:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
ADDITIONAL_INFORMATION=&amp;quot;Additional Information&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
Different versions of Joomla have used slightly different ways to read language files (namely a custom parser and the native PHP INI parser, the latter of which was buggy in PHP 5.2 and older), leading to different rules for what exactly is allowed in keys and values. Language files that abide by the following rules should work under many versions of Joomla, but at least under Joomla {{jver|3.x}} and newer.&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:5--&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;KEY&amp;lt;/code&amp;gt; should only use ASCII characters. It should only contain capital letters, digits, underscores and hyphens, and it should start with a capital letter. (Dots (&amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;) are formally allowed, but do not appear to be completely supported.) It is a convention to replace any whitespace in the string to be translated with underscores. If more than one entry has the same key, the last one to be encountered is the one that will be used. When you use the key in a &amp;lt;code&amp;gt;JText::_&amp;lt;/code&amp;gt; call, the case does not matter as strings are folded to upper case before searching takes place. So &amp;lt;code&amp;gt;additional_information&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Additional_Information&amp;lt;/code&amp;gt; or even &amp;lt;code&amp;gt;AdDiTiOnAl_InFoRmAtIoN&amp;lt;/code&amp;gt; will be matched.&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:6--&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; should always be surrounded by double-quote characters (&amp;lt;code&amp;gt;&amp;quot;&amp;lt;/code&amp;gt;), as in the example. The value itself cannot include double-quote characters (&amp;lt;code&amp;gt;&amp;quot;&amp;lt;/code&amp;gt;), although single-quote characters (&amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt;) are valid. Use &amp;lt;code&amp;gt;&amp;quot;_QQ_&amp;quot;&amp;lt;/code&amp;gt;, &#039;&#039;including the double quotes&#039;&#039;, to place a double-quote character in your value. For example, to attach the value &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;span class=&amp;quot;red&amp;quot;&amp;gt;Warning!&amp;lt;/span&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; to the key &amp;lt;code&amp;gt;WARNING_TEXT&amp;lt;/code&amp;gt;, use following line:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
WARNING_TEXT=&amp;quot;&amp;lt;span class=&amp;quot;_QQ_&amp;quot;red&amp;quot;_QQ_&amp;quot;&amp;gt;Warning!&amp;lt;/span&amp;gt;&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
Note that these rules are stricter than required by [http://php.net/manual/en/function.parse-ini-file.php the PHP INI parser]. For example, the PHP INI parser allows you to omit the double quotes around the value as long as it does not contain certain characters. Using the rules above should make it much easier to avoid mistakes like forgetting double quotes when they &#039;&#039;are&#039;&#039; required.&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:7--&amp;gt;&lt;br /&gt;
Information about the changes in the language file format between the Joomla 1.5, 2.5 and 3.x series can be found on the page [[S:MyLanguage/Specification of language files|Specification of language files]].&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Language Development]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Creating_a_language_definition_file&amp;diff=231440</id>
		<title>Creating a language definition file</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Creating_a_language_definition_file&amp;diff=231440"/>
		<updated>2015-09-17T18:19:08Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Added warning: this page&amp;#039;s contents are *not* - at least not entirely - valid for the 3 series. The Specification page should be merged into this one.&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;
{{Joomla version|version=3.x|comment=&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
series&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{warning|This page was written for Joomla {{jver|1.5}}. Joomla {{jver|3.x}} has slightly different requirements, as explained in [[Specification of language files]]. See [http://php.net/manual/en/function.parse-ini-string.php the PHP documentation] for more details.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
Important note: Joomla language &amp;lt;code&amp;gt;.ini&amp;lt;/code&amp;gt; files must be saved as UTF-8&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
The format of language definition files is very basic. Blanks lines and lines beginning with “#” are ignored and the latter may be used to add comments to the file. Each line consists of a pair of strings separated by an equals sign like this :&lt;br /&gt;
&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;
KEY=Value&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;
where “&#039;&#039;KEY&#039;&#039;” is a string to be translated and “&#039;&#039;Value&#039;&#039;” is the translated string. For example :&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 ADDITIONAL_INFORMATION=&amp;quot;Additional Information&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
The “&#039;&#039;KEY&#039;&#039;” must be in all capitals or the string will not be found. The case of the source string does not matter as strings are folded to upper case before searching takes place. So “additional information”, “Additional Information” or even “AdDiTiOnAl InFoRmAtIoN” will be matched.&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:5--&amp;gt;&lt;br /&gt;
The “&#039;&#039;KEY&#039;&#039;” can include spaces and other punctuation characters but there should not be any spaces either side of the equals sign as spaces are significant.  If more than one entry has the same left-hand side, the last one to be encountered is the one that will be used.&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:6--&amp;gt;&lt;br /&gt;
The &amp;quot;&#039;&#039;VALUE&#039;&#039;&amp;quot; cannot include double-quote characters (&amp;quot;). To get a double-quote character you must use the HTML special character sequence &amp;quot;&amp;amp;amp;quot;&amp;quot; instead.  Single-quote characters (&#039;) are valid.&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:7--&amp;gt;&lt;br /&gt;
More information about the discussed changes for the Joomla 2.5 and 3.x series can be found on the page [[S:MyLanguage/Specification of language files|Specification of language files]]&lt;br /&gt;
&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Language Development]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Retrieving_request_data_using_JInput&amp;diff=226573</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=226573"/>
		<updated>2015-09-06T00:16:43Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Fixed own incorrect edit (revision 68329): a single PHP object was meant (see revision 68300)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version|2.5,3.x|platform=11.1,12.1}}&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;
{{notice|The code fragments in the following list show the &#039;&#039;implementation&#039;&#039; of the filters (assuming the value you want to retrieve is stored in &amp;lt;code&amp;gt;$source&amp;lt;/code&amp;gt;). You do not need them to &#039;&#039;use&#039;&#039; JInput; all you need for using JInput is the code shown above.}}&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;
To retrieve an 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;
===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;
===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>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Retrieving_request_data_using_JInput&amp;diff=226318</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=226318"/>
		<updated>2015-09-05T17:53:19Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Adjusted version template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version|2.5,3.x|platform=11.1,12.1}}&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;
{{notice|The code fragments in the following list show the &#039;&#039;implementation&#039;&#039; of the filters (assuming the value you want to retrieve is stored in &amp;lt;code&amp;gt;$source&amp;lt;/code&amp;gt;). You do not need them to &#039;&#039;use&#039;&#039; JInput; all you need for using JInput is the code shown above.}}&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>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Retrieving_request_data_using_JInput&amp;diff=226317</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=226317"/>
		<updated>2015-09-05T17:33:59Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Added clarification after user request&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;
{{notice|The code fragments in the following list show the &#039;&#039;implementation&#039;&#039; of the filters (assuming the value you want to retrieve is stored in &amp;lt;code&amp;gt;$source&amp;lt;/code&amp;gt;). You do not need them to &#039;&#039;use&#039;&#039; JInput; all you need for using JInput is the code shown above.}}&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>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Magic_quotes_and_security&amp;diff=162631</id>
		<title>Magic quotes and security</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Magic_quotes_and_security&amp;diff=162631"/>
		<updated>2015-03-10T14:54:36Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Adjusted layout&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version|2.5,3.x}}&lt;br /&gt;
&#039;&#039;&#039;Magic Quotes&#039;&#039;&#039; was a PHP feature, enabled using the &amp;lt;code&amp;gt;magic_quotes_gpc&amp;lt;/code&amp;gt; setting, that escaped (in a very limited way) most of the input data accessible to PHP scripts. It has been removed from PHP for [http://php.net/manual/en/security.magicquotes.whynot.php a variety of reasons]. For more on Magic Quotes, see [http://php.net/magic_quotes PHP Manual, Chapter 31. Magic Quotes].&lt;br /&gt;
&lt;br /&gt;
This PHP feature has been &#039;&#039;&#039;deprecated&#039;&#039;&#039; as of PHP 5.3.0 (30-06-2009) and has been &#039;&#039;&#039;removed&#039;&#039;&#039; from PHP as of PHP 5.4.0.&lt;br /&gt;
&lt;br /&gt;
: {{JVer|3.x}} Joomla! 3.0 and above requires &amp;lt;code&amp;gt;magic_quotes_gpc&amp;lt;/code&amp;gt; to be set to &#039;&#039;&#039;off&#039;&#039;&#039; and will not install if &amp;lt;code&amp;gt;magic_quotes_gpc&amp;lt;/code&amp;gt; is on.&lt;br /&gt;
: {{JVer|2.5}} Joomla! 2.5 advises &amp;lt;code&amp;gt;magic_quotes_gpc&amp;lt;/code&amp;gt; to be set to &#039;&#039;&#039;off&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
JRequest automatically takes into account the setting of &amp;lt;code&amp;gt;magic_quotes_gpc&amp;lt;/code&amp;gt; and adjusts accordingly.  If developers are using JRequest to request input then the actual value of the setting doesn&#039;t matter.  If developers aren&#039;t using it then they will have to take the setting of &amp;lt;code&amp;gt;magic_quotes_gpc&amp;lt;/code&amp;gt; into account (for this reason it is still common practice for developers to use JRequest in Joomla 2.5 - even though it is deprecated).&lt;br /&gt;
&lt;br /&gt;
JInput does not take this into account. However, due to Joomla 3.x and higher requiring that magic quotes are disabled, this is no longer a problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- KEEP THIS AT THE END OF THE PAGE --&amp;gt;&lt;br /&gt;
[[Category:Security Checklist]]&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Magic_quotes_and_security&amp;diff=162584</id>
		<title>Magic quotes and security</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Magic_quotes_and_security&amp;diff=162584"/>
		<updated>2015-03-10T14:52:23Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Fixed minor issues&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version|2.5,3.x}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Magic Quotes&#039;&#039;&#039; was a PHP feature, enabled using the &amp;lt;code&amp;gt;magic_quotes_gpc&amp;lt;/code&amp;gt; setting, that escaped (in a very limited way) most of the input data accessible to PHP scripts. It has been removed from PHP for [http://php.net/manual/en/security.magicquotes.whynot.php a variety of reasons]. For more on Magic Quotes, see [http://php.net/magic_quotes PHP Manual, Chapter 31. Magic Quotes].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;This PHP feature has been deprecated as of PHP 5.3.0 (30-06-2009) and has been removed from PHP as of PHP 5.4.0.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
: {{JVer|3.x}} Joomla! 3.0 and above requires &amp;lt;code&amp;gt;magic_quotes_gpc&amp;lt;/code&amp;gt; to be set to &#039;&#039;&#039;off&#039;&#039;&#039; and will not install if &amp;lt;code&amp;gt;magic_quotes_gpc&amp;lt;/code&amp;gt; is on.&lt;br /&gt;
: {{JVer|2.5}} Joomla! 2.5 advises &amp;lt;code&amp;gt;magic_quotes_gpc&amp;lt;/code&amp;gt; to be set to &#039;&#039;&#039;off&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
JRequest automatically takes into account the setting of &amp;lt;code&amp;gt;magic_quotes_gpc&amp;lt;/code&amp;gt; and adjusts accordingly.  If developers are using JRequest to request input then the actual value of the setting doesn&#039;t matter.  If developers aren&#039;t using it then they will have to take the setting of &amp;lt;code&amp;gt;magic_quotes_gpc&amp;lt;/code&amp;gt; into account (for this reason it is still common practice for developers to use JRequest in Joomla 2.5 - even though it is deprecated).&lt;br /&gt;
&lt;br /&gt;
JInput does not take this into account. However, due to Joomla 3.x and higher requiring that magic quotes are disabled, this is no longer a problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- KEEP THIS AT THE END OF THE PAGE --&amp;gt;&lt;br /&gt;
[[Category:Security Checklist]]&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J2.5:Supporting_SEF_URLs_in_your_component&amp;diff=161037</id>
		<title>J2.5:Supporting SEF URLs in your component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J2.5:Supporting_SEF_URLs_in_your_component&amp;diff=161037"/>
		<updated>2015-03-01T20:43:37Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Fixed minor issues&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|2.5,3.1}}&lt;br /&gt;
{{:Search Engine Friendly URLs/en}}&lt;br /&gt;
In Joomla!, each [[component]] is responsible for handling its own SEF URLs. Therefore, as the [[Developers|developer]] of a component, you will have to create your own &#039;&#039;&#039;router&#039;&#039;&#039; to allow your component to use SEF URLs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;{{JVer|3.3}} Note:&#039;&#039;&#039;&#039;&#039; Since Joomla 3.3, one should rather implement the interface &amp;lt;code&amp;gt;[https://api.joomla.org/cms-3/classes/JComponentRouterInterface.html JComponentRouterInterface]&amp;lt;/code&amp;gt; and handle the routing and parsing similar as below, but via the methods of this interface.  This will also evade the now fixed [https://github.com/joomla/joomla-cms/issues/5579 one way dash-to-colon issue].&lt;br /&gt;
&lt;br /&gt;
== The Concept ==&lt;br /&gt;
&lt;br /&gt;
Assuming you are following standard development practices, your component is probably using &amp;quot;system URLs&amp;quot; that look a lot like &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_yourcomponent&amp;amp;view=article&amp;amp;id=1&amp;amp;catid=20&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;, and your goal is to transform this into &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;. As the developer, you have two tasks: signalling the system that certain pieces of text are URLs and need to be transformed, and explaining the system how to transform URLs.&lt;br /&gt;
&lt;br /&gt;
=== Applying &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
It is difficult and inefficient for Joomla! to figure out which parts of your component&#039;s output are URLs. To support SEF URLs, you will need to change URL-generating code so that it applies &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; before outputting the URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
echo JRoute::_(&#039;index.php?view=article&amp;amp;id=1&amp;amp;catid=20&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that it is possible to leave out the parameters &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; defaults to the name of the component currently being executed, and &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt; defaults to the current menu item&#039;s ID.&lt;br /&gt;
&lt;br /&gt;
In general, you should only apply this to URLs that users and/or search engines are able to see. For example, there is no need to transform URLs used in redirects that immediately result in other redirects.&lt;br /&gt;
&lt;br /&gt;
If the user turns off SEF URLs in the site&#039;s settings, &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; will produce working non-SEF URLs without any changes to the code.&lt;br /&gt;
&lt;br /&gt;
=== Writing a router ===&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also need to write a router, which is a single file with two functions that convert system URLs to and from SEF URLs. This file needs to be placed at &amp;lt;tt&amp;gt;/components/com_yourcomponent/router.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The first function, &amp;lt;code&amp;gt;[componentname]BuildRoute(&amp;amp;$query)&amp;lt;/code&amp;gt;, must transform an array of URL parameters into an array of segments that will form the SEF URL. Schematically, the transformation works as follows:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_yourcomponent&amp;amp;view=article&amp;amp;id=1&amp;amp;catid=20&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt;, called by your component or any other extension&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$query = array(&#039;view&#039; =&amp;gt; &#039;article&#039;, &#039;id&#039; =&amp;gt; 1, &#039;catid&#039; =&amp;gt; 20)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Your router&#039;s &amp;lt;code&amp;gt;com_yourcomponentBuildRoute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$segments = array(20, 1);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Joomla&#039;s internal route building (for display)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second function, &amp;lt;code&amp;gt;[componentname]ParseRoute($segments)&amp;lt;/code&amp;gt;, must transform an array of segments back into an array of URL parameters. Schematically:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Joomla&#039;s internal route parsing&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$segments = array(20, 1);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Your router&#039;s &amp;lt;code&amp;gt;com_yourcomponentParseRoute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$query = array(&#039;view&#039; =&amp;gt; &#039;article&#039;, &#039;id&#039; =&amp;gt; 1, &#039;catid&#039; =&amp;gt; 20)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two functions must cooperate in such a way that the original URL can be reconstructed. You can think of &amp;lt;code&amp;gt;BuildRoute&amp;lt;/code&amp;gt; as a form of [[wikipedia:Encoding|encoding]] and &amp;lt;code&amp;gt;ParseRoute&amp;lt;/code&amp;gt; as the corresponding decoding. When the original URL isn&#039;t properly reproduced, your component will stop working.&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Data for Routing ==&lt;br /&gt;
&lt;br /&gt;
Clearly, any URL format needs to contain some kind of information that identifies the data you want to show. If your system URLs look like &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_yourcomponent&amp;amp;view=article&amp;amp;id=1&amp;amp;catid=20&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;, that information is currently the &amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt; URL parameter (&amp;lt;tt&amp;gt;id=1&amp;lt;/tt&amp;gt;). You probably want your SEF URLs to contain a textual description of the data they point to. In Joomla!, this is usually done by giving your users a way to enter an &#039;&#039;&#039;alias&#039;&#039;&#039; to be used in the URL.&lt;br /&gt;
&lt;br /&gt;
=== The Alias ===&lt;br /&gt;
&lt;br /&gt;
Even if your users can enter an alias, they might not do so, leaving the generation of a sensible alias up to your component. If your data has a title field, you can use that as a candidate for the alias (like the core [[Content]] component does).&lt;br /&gt;
&lt;br /&gt;
Considering that the alias will be used in URLs, it has to be URL safe. Joomla! provides a method making arbitrary strings URI safe, which includes replacing accented UTF­8 characters by their ASCII­7 equivalents, white spaces by hyphens, etc. Whether the user entered the alias or a candidate has been chosen automatically, you should ensure that the above requirements for a URL safe alias are met. A good place for implementing this, if you are using &amp;lt;code&amp;gt;JTable&amp;lt;/code&amp;gt;, is the &amp;lt;code&amp;gt;JTable::check()&amp;lt;/code&amp;gt; method, which is called during the save process. Have a look at this example code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function check()&lt;br /&gt;
{&lt;br /&gt;
    jimport(&#039;joomla.filter.output&#039;);&lt;br /&gt;
    if (empty($this-&amp;gt;alias))&lt;br /&gt;
    {&lt;br /&gt;
	    $this-&amp;gt;alias = $this-&amp;gt;title;&lt;br /&gt;
    }&lt;br /&gt;
    $this-&amp;gt;alias = JFilterOutput::stringURLSafe($this-&amp;gt;alias);&lt;br /&gt;
&lt;br /&gt;
    /* All your other checks */&lt;br /&gt;
    return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the alias field is empty the title is used as alias. Then the alias is made URL safe using the &amp;lt;code&amp;gt;JFilterOutput::stringURLSafe()&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
=== The Slug ===&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;&#039;slug&#039;&#039;&#039; is used to minimise the amount of code you need to support SEF URLs. It consists of the numerical identifier (&amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt;) your system URLs used, a colon (&amp;lt;tt&amp;gt;:&amp;lt;/tt&amp;gt;), and the alias you created as described above. &lt;br /&gt;
&lt;br /&gt;
Consider a SEF URL for an [[Article]] with &amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt; 1 and title &amp;quot;Welcome to Joomla!&amp;quot;. The automatically generated alias for this article is &amp;lt;tt&amp;gt;welcome-to-joomla&amp;lt;/tt&amp;gt;, and the slug becomes &amp;lt;tt&amp;gt;1­:welcome­-to­-joomla&amp;lt;/tt&amp;gt;. In the [[Content]] component, the two elements are combined during the database query in the model (&amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; represents &amp;lt;code&amp;gt;#__content&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$query = &#039;SELECT a.*, &#039;.&lt;br /&gt;
         &#039;CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(&amp;quot;:&amp;quot;, a.id, a.alias) ELSE a.id END as slug,&#039;&lt;br /&gt;
         /*...*/;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The advantage of this method of creating a slug is that you can simply use the slug as a drop-in replacement for the id in most places. For example, you don&#039;t need to check for and remove the colon and the alias from the request data manually: if you use [[Retrieving request data using JInput|JInput]]&#039;s &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; (integer) filter, it will do that automatically.&lt;br /&gt;
&lt;br /&gt;
== Routing URLs ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; method translates the internal Joomla! URL to a custom URL. &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; has three parameters and its prototype is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;JRoute::_($url, $xhtml = true, $ssl = null);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;$url&amp;lt;/code&amp;gt; is a string containing the absolute or relative internal Joomla! URL.&lt;br /&gt;
* &amp;lt;code&amp;gt;$xhtml&amp;lt;/code&amp;gt; is a boolean value that specifies whether or not the output should be in XHTML. This parameter is optional and if omitted defaults to true.&lt;br /&gt;
* &amp;lt;code&amp;gt;$ssl&amp;lt;/code&amp;gt; is an integer value that specifies whether the URI should be secure. It should be set to 1 to force the URI to be secure using the global secure site URI, 0 to leave it in the same state as when it was passed, and -1 to force the URI to be unsecure using the global unsecure site URI.&lt;br /&gt;
&lt;br /&gt;
The most important parameter is &amp;lt;code&amp;gt;$url&amp;lt;/code&amp;gt;. A call to this method might look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;JRoute::_(&#039;index.php?view=article&amp;amp;id=&#039; . $row-&amp;gt;slug);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$row-­&amp;gt;slug&amp;lt;/code&amp;gt; is the value that was generated in step 2 from a combination of id and title alias.&lt;br /&gt;
&lt;br /&gt;
Another advantage of using &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; is that the router now handles &amp;lt;code&amp;gt;$option&amp;lt;/code&amp;gt; (the component name) and the &amp;lt;code&amp;gt;$Itemid&amp;lt;/code&amp;gt; (the menu item ID). The component itself doesn&#039;t have to know its name (&amp;lt;code&amp;gt;$option&amp;lt;/code&amp;gt;) or the active menu item (&amp;lt;code&amp;gt;$Itemid&amp;lt;/code&amp;gt;) like it did in previous version of Joomla!.&lt;br /&gt;
&lt;br /&gt;
It is important that you think about the sequence of the URL parameter in this stage. This will be more clear when we have a deeper look at the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; in the next section.&lt;br /&gt;
&lt;br /&gt;
The building process of JRouter is divided into two steps:&lt;br /&gt;
&lt;br /&gt;
* Create the application route. The application route is fully handled by JRouter and the component developer doesn’t have to do anything to make it work.&lt;br /&gt;
* Create the component route. To create the component route, JRouter looks for the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; in the component directory which is responsible for building the route for the component.&lt;br /&gt;
&lt;br /&gt;
== The Component Router ==&lt;br /&gt;
&lt;br /&gt;
We will have two functions in the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt;. One is responsible for building the URL and the other is responsible for parsing it. In the next examples, a very basic and a more advanced one, we assume that we have three views that links can point to. The first is a categories overview (&amp;lt;code&amp;gt;view=categories&amp;lt;/code&amp;gt;), the second is a single category (&amp;lt;code&amp;gt;view=category&amp;lt;/code&amp;gt;) and the third is a single article (&amp;lt;code&amp;gt;view=article&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The file &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; should be in the site area of your component. It is not used on admin/backend pages. Don&#039;t forget to add it to your XML [[Manifest files|manifest file]] in the site folder.&lt;br /&gt;
&lt;br /&gt;
=== A Simple Example ===&lt;br /&gt;
&lt;br /&gt;
This simple example will illustrate the basics of implementing a router for your component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]BuildRoute(&amp;amp;$query)&lt;br /&gt;
{&lt;br /&gt;
       $segments = array();&lt;br /&gt;
       if (isset($query[&#039;view&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;view&#039;];&lt;br /&gt;
                unset($query[&#039;view&#039;]);&lt;br /&gt;
       }&lt;br /&gt;
       if (isset($query[&#039;id&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;id&#039;];&lt;br /&gt;
                unset($query[&#039;id&#039;]);&lt;br /&gt;
       };&lt;br /&gt;
       return $segments;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; passes a &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array to the &amp;lt;code&amp;gt;[&#039;&#039;componentname&#039;&#039;]BuildRoute&amp;lt;/code&amp;gt; function. This function will add the relevant parts of the array to the $segments array in the right order and will return the properly ordered array. The content of the &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array needs to be unset, otherwise &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; will add it to the URL in the form of a query string (i.e. any variables that are not handled by the router will be passed in the query string).&lt;br /&gt;
&lt;br /&gt;
The prefix &#039;&#039;componentname&#039;&#039; is the name for your component, as found in the directory holding the component&#039;s files. For instance, a component &amp;quot;Magic&amp;quot; in directory &amp;lt;tt&amp;gt;/components/com_magic/...&amp;lt;/tt&amp;gt; would use a prefix &amp;lt;code&amp;gt;magic&amp;lt;/code&amp;gt; (all lower case).&lt;br /&gt;
&lt;br /&gt;
The next function in the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; parses the URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]ParseRoute($segments)&lt;br /&gt;
{&lt;br /&gt;
       $vars = array();&lt;br /&gt;
       switch($segments[0])&lt;br /&gt;
       {&lt;br /&gt;
               case &#039;categories&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;categories&#039;;&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;category&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;category&#039;;&lt;br /&gt;
                       $id = explode(&#039;:&#039;, $segments[1]);&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;article&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       $id = explode(&#039;:&#039;, $segments[1]);&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
       }&lt;br /&gt;
       return $vars;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What happens here? In the function &amp;lt;code&amp;gt;[&#039;&#039;componentname&#039;&#039;]BuildRoute&amp;lt;/code&amp;gt; we arranged the items in the &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array in a specific sequence. This means that in this example the view is first and the id is second in the array.&lt;br /&gt;
&lt;br /&gt;
By reading &amp;lt;code&amp;gt;$segments[0]&amp;lt;/code&amp;gt;, we access the name of the view. We set the right view and/or identifier depending on its value and we return the &amp;lt;code&amp;gt;$vars&amp;lt;/code&amp;gt; array to &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;$vars&amp;lt;/code&amp;gt; should be an associative array similar to the array that was passed to the BuildRoute method.&lt;br /&gt;
&lt;br /&gt;
The above example of the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; is a very simple way to generate SEF URLs but should show how this works quite clearly.&lt;br /&gt;
&lt;br /&gt;
The generated URL in this example contains the name of the view and doesn&#039;t reflect the content hierarchy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[view]/[slug]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A More Advanced Example ===&lt;br /&gt;
&lt;br /&gt;
In the next example we will try to get rid of the need for the view and we will try to reflect the current hierarchy level in the URL.&lt;br /&gt;
&lt;br /&gt;
The goal is URL&#039;s that look like:&lt;br /&gt;
&lt;br /&gt;
* When viewing an article: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[category]/[article]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* When viewing a category: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[category]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* When viewing the categories overview: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have done step 1 and 2 also for the category.&lt;br /&gt;
&lt;br /&gt;
The link to the article would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JRoute::_(&#039;index.php?view=article&amp;amp;catid=&#039; . $row-­&amp;gt;catslug . &#039;&amp;amp;id=&#039;.$row-­&amp;gt;slug);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the Link to the category would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JRoute::_(&#039;index.php?view=category&amp;amp;id=&#039; . $row-&amp;gt;catslug);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function [componentname]BuildRoute(&amp;amp;$query)&lt;br /&gt;
{&lt;br /&gt;
       $segments = array();&lt;br /&gt;
       if (isset($query[&#039;catid&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;catid&#039;];&lt;br /&gt;
                unset($query[&#039;catid&#039;]);&lt;br /&gt;
       };&lt;br /&gt;
       if (isset($query[&#039;id&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;id&#039;];&lt;br /&gt;
                unset($query[&#039;id&#039;]);&lt;br /&gt;
       };&lt;br /&gt;
       unset($query[&#039;view&#039;]);&lt;br /&gt;
       return $segments;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The difference now is that we don’t add the name of the view to the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array. We still unset the view key since otherwise, &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; would add it to the URL as part of the query string. Another new thing here is the additional parameter catid that we push into the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]ParseRoute($segments)&lt;br /&gt;
{&lt;br /&gt;
       $vars = array();&lt;br /&gt;
       $app = JFactory::getApplication();&lt;br /&gt;
       $menu = $app-&amp;gt;getMenu();&lt;br /&gt;
       $item = $menu-&amp;gt;getActive();&lt;br /&gt;
       // Count segments&lt;br /&gt;
       $count = count($segments);&lt;br /&gt;
       // Handle View and Identifier&lt;br /&gt;
       switch ($item-&amp;gt;query[&#039;view&#039;])&lt;br /&gt;
       {&lt;br /&gt;
               case &#039;categories&#039;:&lt;br /&gt;
                       if ($count == 1)&lt;br /&gt;
                       {&lt;br /&gt;
                               $vars[&#039;view&#039;] = &#039;category&#039;;&lt;br /&gt;
                       }&lt;br /&gt;
                       if ($count == 2)&lt;br /&gt;
                       {&lt;br /&gt;
                               $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       }&lt;br /&gt;
                       $id = explode(&#039;:&#039;, $segments[$count-1]);&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;category&#039;:&lt;br /&gt;
                       $id = explode(&#039;:&#039;, $segments[$count-1]);&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       break;&lt;br /&gt;
       }&lt;br /&gt;
       return $vars;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this ParseRoute function has a lot of different code parts in comparison to the previous. The reason for this is simple. We don’t have the name of the view in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array and we need to find another way to determine it.&lt;br /&gt;
&lt;br /&gt;
We need to find out which level of hierarchy we are in by receiving the root element. We do this by looking to the view name of the active menu item:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$item-­&amp;gt;query[&#039;view&#039;]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also we need to know the number of items in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$count = count($segments);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this information we can correctly set the view for all possible three cases:&lt;br /&gt;
&lt;br /&gt;
* The menu item is a link to the categories view and the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array has two items (&amp;lt;code&amp;gt;$catid&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt;). In this case we know that we need to parse a link to an article.&lt;br /&gt;
* The menu item is a link to the categories view and the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array has one item (&amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt;). In this case we know that we need to parse a link to a category.&lt;br /&gt;
* The menu item is a link to a category. In this case, we know that any item in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array is the identifier for an article.&lt;br /&gt;
&lt;br /&gt;
The result of all this code is clean and human-readable component URLs.&lt;br /&gt;
&lt;br /&gt;
== Routers and Menu Items ==&lt;br /&gt;
&lt;br /&gt;
A last important part of creating a router is considering what to do with menu items. As explained on [[Search Engine Friendly URLs]], the output of the component router is used &#039;&#039;after&#039;&#039; the first segment of a route, the first segment being the menu item&#039;s alias. This creates a difficult question: how is your router and/or other code to know which menu item to route through?&lt;br /&gt;
&lt;br /&gt;
Suppose, for example, that your component is currently producing output for the page &amp;lt;tt&amp;gt;/dogs&amp;lt;/tt&amp;gt;, which lists all dogs in the system. Of course, the items in the list need to be links to pages that display more details about one dog. What should the URL to the dog with ID 21 and name Fido become? Using a router that works according to the principles we&#039;ve seen so far, the route that is produced is &amp;lt;tt&amp;gt;dogs/21-fido&amp;lt;/tt&amp;gt;, or with some additional work &amp;lt;tt&amp;gt;/dogs/fido&amp;lt;/tt&amp;gt;. But perhaps the user has created a menu item with the alias &amp;lt;tt&amp;gt;mydoggy&amp;lt;/tt&amp;gt; which displays exactly that dog&#039;s details. Then it is probably the user&#039;s intention to route this URL through that menu item, and the item in the list should link to the page &amp;lt;tt&amp;gt;/mydoggy&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
More generally, whenever you are building a route, you will need to find the menu item that is most suitable as a &#039;&#039;starting point&#039;&#039; for building your route. The term &#039;&#039;starting point&#039;&#039; is emphasized because the rest of the route depends on the configuration of the menu item. In our example above, &amp;lt;tt&amp;gt;/dogs/21-fido&amp;lt;/tt&amp;gt; is an acceptable route, &amp;lt;tt&amp;gt;/mydoggy&amp;lt;/tt&amp;gt; is arguably even better, but &amp;lt;tt&amp;gt;/mydoggy/21-fido&amp;lt;/tt&amp;gt; is simply wrong, since &amp;lt;tt&amp;gt;/mydoggy&amp;lt;/tt&amp;gt; is in itself a menu item that is set up to display &amp;lt;tt&amp;gt;fido&amp;lt;/tt&amp;gt;&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Several approaches are available to tackle this problem. Joomla!&#039;s core components take a mixed approach, separating responsibilities in two units of code: the router itself and the so-called &amp;lt;code&amp;gt;[componentname]RouteHelper&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;[componentname]RouteHelper&amp;lt;/code&amp;gt; provides methods that find the most suitable menu item for a given piece of data to be displayed, while the router analyzes the menu item and puts any information that is not determined by the menu item&#039;s configuration into the route. This does mean that the &#039;&#039;calling code&#039;&#039; must explicitly call the helper&#039;s method before routing (&amp;lt;code&amp;gt;echo JRoute::_(DogsRouteHelper::getDogRoute(21));&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
There is a useful thread on this subject here: [[jtopic:148632]] (note, may be out of date)&lt;br /&gt;
&lt;br /&gt;
For details on the internals of routing, see [[Routing implementation details]].&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Tutorials]][[Category:Component Development]][[Category:Search Engine Friendly URLs]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Manifest_files&amp;diff=125189</id>
		<title>Manifest files</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Manifest_files&amp;diff=125189"/>
		<updated>2014-08-29T12:25:28Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: /* SQL */ Removed nonexistent attributes&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 [[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 [[Component|components]] apply to both the [[Site (Application)|site]] and the [[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;
&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;menu link=&amp;quot;anoption=avalue&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;
&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;
{{Needsinfo|In Platform 11.1 no alt attribute processed and if link provide in menu tag other provided attributes were ignore. The other tags are task, view, controller, act, layout, sub. Please confirm this, please.}}&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;IntallerScript&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;
&lt;br /&gt;
[[Category:Extension development]]&lt;br /&gt;
[[Category:Specifications]]&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J2.5:Supporting_SEF_URLs_in_your_component&amp;diff=125185</id>
		<title>J2.5:Supporting SEF URLs in your component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J2.5:Supporting_SEF_URLs_in_your_component&amp;diff=125185"/>
		<updated>2014-08-28T22:22:01Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: /* Preparing Your Data for Routing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|2.5,3.1}}&lt;br /&gt;
{{:Search Engine Friendly URLs}}&lt;br /&gt;
In Joomla!, each [[component]] is responsible for handling its own SEF URLs. Therefore, as the [[Developers|developer]] of a component, you will have to create your own &#039;&#039;&#039;router&#039;&#039;&#039; to allow your component to use SEF URLs.&lt;br /&gt;
&lt;br /&gt;
== The Concept ==&lt;br /&gt;
&lt;br /&gt;
Assuming you are following standard development practices, your component is probably using &amp;quot;system URLs&amp;quot; that look a lot like &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_yourcomponent&amp;amp;view=article&amp;amp;id=1&amp;amp;catid=20&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;, and your goal is to transform this into &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;. As the developer, you have two tasks: signalling the system that certain pieces of text are URLs and need to be transformed, and explaining the system how to transform URLs.&lt;br /&gt;
&lt;br /&gt;
=== Applying &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
It is difficult and inefficient for Joomla! to figure out which parts of your component&#039;s output are URLs. To support SEF URLs, you will need to change URL-generating code so that it applies &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; before outputting the URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
echo JRoute::_(&#039;index.php?view=article&amp;amp;id=1&amp;amp;catid=20&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that it is possible to leave out the parameters &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; defaults to the name of the component currently being executed, and &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt; defaults to the current menu item&#039;s ID.&lt;br /&gt;
&lt;br /&gt;
In general, you should only apply this to URLs that users and/or search engines are able to see. For example, there is no need to transform URLs used in redirects that immediately result in other redirects.&lt;br /&gt;
&lt;br /&gt;
If the user turns off SEF URLs in the site&#039;s settings, &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; will produce working non-SEF URLs without any changes to the code.&lt;br /&gt;
&lt;br /&gt;
=== Writing a router ===&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also need to write a router, which is a single file with two functions that convert system URLs to and from SEF URLs. This file needs to be placed at &amp;lt;tt&amp;gt;/components/com_yourcomponent/router.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The first function, &amp;lt;code&amp;gt;[componentname]BuildRoute(&amp;amp;$query)&amp;lt;/code&amp;gt;, must transform an array of URL parameters into an array of segments that will form the SEF URL. Schematically, the transformation works as follows:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_yourcomponent&amp;amp;view=article&amp;amp;id=1&amp;amp;catid=20&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt;, called by your component or any other extension&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$query = array(&#039;view&#039; =&amp;gt; &#039;article&#039;, &#039;id&#039; =&amp;gt; 1, &#039;catid&#039; =&amp;gt; 20)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Your router&#039;s &amp;lt;code&amp;gt;com_yourcomponentBuildRoute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$segments = array(20, 1);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Joomla&#039;s internal route building (for display)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second function, &amp;lt;code&amp;gt;[componentname]ParseRoute($segments)&amp;lt;/code&amp;gt;, must transform an array of segments back into an array of URL parameters. Schematically:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Joomla&#039;s internal route parsing&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$segments = array(20, 1);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Your router&#039;s &amp;lt;code&amp;gt;com_yourcomponentParseRoute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$query = array(&#039;view&#039; =&amp;gt; &#039;article&#039;, &#039;id&#039; =&amp;gt; 1, &#039;catid&#039; =&amp;gt; 20)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two functions must cooperate in such a way that the original URL can be reconstructed. You can think of &amp;lt;code&amp;gt;BuildRoute&amp;lt;/code&amp;gt; as a form of [[wikipedia:Encoding|encoding]] and &amp;lt;code&amp;gt;ParseRoute&amp;lt;/code&amp;gt; as the corresponding decoding. When the original URL isn&#039;t properly reproduced, your component will stop working.&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Data for Routing ==&lt;br /&gt;
&lt;br /&gt;
Clearly, any URL format needs to contain some kind of information that identifies the data you want to show. If your system URLs look like &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_yourcomponent&amp;amp;view=article&amp;amp;id=1&amp;amp;catid=20&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;, that information is currently the &amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt; URL parameter (&amp;lt;tt&amp;gt;id=1&amp;lt;/tt&amp;gt;). You probably want your SEF URLs to contain a textual description of the data they point to. In Joomla!, this is usually done by giving your users a way to enter an &#039;&#039;&#039;alias&#039;&#039;&#039; to be used in the URL.&lt;br /&gt;
&lt;br /&gt;
=== The Alias ===&lt;br /&gt;
&lt;br /&gt;
Even if your users can enter an alias, they might not do so, leaving the generation of a sensible alias up to your component. If your data has a title field, you can use that as a candidate for the alias (like the core [[Content]] component does).&lt;br /&gt;
&lt;br /&gt;
Considering that the alias will be used in URLs, it has to be URL safe. Joomla! provides a method making arbitrary strings URI safe, which includes replacing accented UTF­8 characters by their ASCII­7 equivalents, white spaces by hyphens, etc. Whether the user entered the alias or a candidate has been chosen automatically, you should ensure that the above requirements for a URL safe alias are met. A good place for implementing this, if you are using &amp;lt;code&amp;gt;JTable&amp;lt;/code&amp;gt;, is the &amp;lt;code&amp;gt;JTable::check()&amp;lt;/code&amp;gt; method, which is called during the save process. Have a look at this example code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function check()&lt;br /&gt;
{&lt;br /&gt;
    jimport(&#039;joomla.filter.output&#039;);&lt;br /&gt;
    if (empty($this-&amp;gt;alias))&lt;br /&gt;
    {&lt;br /&gt;
	    $this-&amp;gt;alias = $this-&amp;gt;title;&lt;br /&gt;
    }&lt;br /&gt;
    $this-&amp;gt;alias = JFilterOutput::stringURLSafe($this-&amp;gt;alias);&lt;br /&gt;
&lt;br /&gt;
    /* All your other checks */&lt;br /&gt;
    return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the alias field is empty the title is used as alias. Then the alias is made URL safe using the &amp;lt;code&amp;gt;JFilterOutput::stringURLSafe()&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
=== The Slug ===&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;&#039;slug&#039;&#039;&#039; is used to minimise the amount of code you need to support SEF URLs. It consists of the numerical identifier (&amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt;) your system URLs used, a colon (&amp;lt;tt&amp;gt;:&amp;lt;/tt&amp;gt;), and the alias you created as described above. &lt;br /&gt;
&lt;br /&gt;
Consider a SEF URL for an [[Article]] with &amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt; 1 and title &amp;quot;Welcome to Joomla!&amp;quot;. The automatically generated alias for this article is &amp;lt;tt&amp;gt;welcome-to-joomla&amp;lt;/tt&amp;gt;, and the slug becomes &amp;lt;tt&amp;gt;1­:welcome­-to­-joomla&amp;lt;/tt&amp;gt;. In the [[Content]] component, the two elements are combined during the database query in the model (&amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; represents &amp;lt;code&amp;gt;#__content&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$query = &#039;SELECT a.*, &#039;.&lt;br /&gt;
         &#039;CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(&amp;quot;:&amp;quot;, a.id, a.alias) ELSE a.id END as slug,&#039;&lt;br /&gt;
         /*...*/;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The advantage of this method of creating a slug is that you can simply use the slug as a drop-in replacement for the id in most places. For example, you don&#039;t need to check for and remove the colon and the alias from the request data manually: if you use [[Retrieving request data using JInput|JInput]]&#039;s &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; (integer) filter, it will do that automatically.&lt;br /&gt;
&lt;br /&gt;
== Routing URLs ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; method translates the internal Joomla! URL to a custom URL. &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; has three parameters and its prototype is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;JRoute::_($url, $xhtml = true, $ssl = null);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;$url&amp;lt;/code&amp;gt; is a string containing the absolute or relative internal Joomla! URL.&lt;br /&gt;
* &amp;lt;code&amp;gt;$xhtml&amp;lt;/code&amp;gt; is a boolean value that specifies whether or not the output should be in XHTML. This parameter is optional and if omitted defaults to true.&lt;br /&gt;
* &amp;lt;code&amp;gt;$ssl&amp;lt;/code&amp;gt; is an integer value that specifies whether the URI should be secure. It should be set to 1 to force the URI to be secure using the global secure site URI, 0 to leave it in the same state as when it was passed, and -1 to force the URI to be unsecure using the global unsecure site URI.&lt;br /&gt;
&lt;br /&gt;
The most important parameter is &amp;lt;code&amp;gt;$url&amp;lt;/code&amp;gt;. A call to this method might look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;JRoute::_(&#039;index.php?view=article&amp;amp;id=&#039; . $row-&amp;gt;slug);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$row-­&amp;gt;slug&amp;lt;/code&amp;gt; is the value that was generated in step 2 from a combination of id and title alias.&lt;br /&gt;
&lt;br /&gt;
Another advantage of using &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; is that the router now handles &amp;lt;code&amp;gt;$option&amp;lt;/code&amp;gt; (the component name) and the &amp;lt;code&amp;gt;$Itemid&amp;lt;/code&amp;gt; (the menu item ID). The component itself doesn&#039;t have to know its name (&amp;lt;code&amp;gt;$option&amp;lt;/code&amp;gt;) or the active menu item (&amp;lt;code&amp;gt;$Itemid&amp;lt;/code&amp;gt;) like it did in previous version of Joomla!.&lt;br /&gt;
&lt;br /&gt;
It is important that you think about the sequence of the URL parameter in this stage. This will be more clear when we have a deeper look at the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; in the next section.&lt;br /&gt;
&lt;br /&gt;
The building process of JRouter is divided into two steps:&lt;br /&gt;
&lt;br /&gt;
* Create the application route. The application route is fully handled by JRouter and the component developer doesn’t have to do anything to make it work.&lt;br /&gt;
* Create the component route. To create the component route, JRouter looks for the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; in the component directory which is responsible for building the route for the component.&lt;br /&gt;
&lt;br /&gt;
== The Component Router ==&lt;br /&gt;
&lt;br /&gt;
We will have two functions in the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt;. One is responsible for building the URL and the other is responsible for parsing it. In the next examples, a very basic and a more advanced one, we assume that we have three views that links can point to. The first is a categories overview (&amp;lt;code&amp;gt;view=categories&amp;lt;/code&amp;gt;), the second is a single category (&amp;lt;code&amp;gt;view=category&amp;lt;/code&amp;gt;) and the third is a single article (&amp;lt;code&amp;gt;view=article&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The file &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; should be in the site area of your component. It is not used on admin/backend pages. Don&#039;t forget to add it to your XML [[Manifest files|manifest file]] in the site folder.&lt;br /&gt;
&lt;br /&gt;
=== A Simple Example ===&lt;br /&gt;
&lt;br /&gt;
This simple example will illustrate the basics of implementing a router for your component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]BuildRoute(&amp;amp;$query)&lt;br /&gt;
{&lt;br /&gt;
       $segments = array();&lt;br /&gt;
       if (isset($query[&#039;view&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;view&#039;];&lt;br /&gt;
                unset($query[&#039;view&#039;]);&lt;br /&gt;
       }&lt;br /&gt;
       if (isset($query[&#039;id&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;id&#039;];&lt;br /&gt;
                unset($query[&#039;id&#039;]);&lt;br /&gt;
       };&lt;br /&gt;
       return $segments;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; passes a &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array to the &amp;lt;code&amp;gt;[&#039;&#039;componentname&#039;&#039;]BuildRoute&amp;lt;/code&amp;gt; function. This function will add the relevant parts of the array to the $segments array in the right order and will return the properly ordered array. The content of the &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array needs to be unset, otherwise &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; will add it to the URL in the form of a query string (i.e. any variables that are not handled by the router will be passed in the query string).&lt;br /&gt;
&lt;br /&gt;
The prefix &#039;&#039;componentname&#039;&#039; is the name for your component, as found in the directory holding the component&#039;s files. For instance, a component &amp;quot;Magic&amp;quot; in directory &amp;lt;tt&amp;gt;/components/com_magic/...&amp;lt;/tt&amp;gt; would use a prefix &amp;lt;code&amp;gt;magic&amp;lt;/code&amp;gt; (all lower case).&lt;br /&gt;
&lt;br /&gt;
The next function in the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; parses the URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]ParseRoute($segments)&lt;br /&gt;
{&lt;br /&gt;
       $vars = array();&lt;br /&gt;
       switch($segments[0])&lt;br /&gt;
       {&lt;br /&gt;
               case &#039;categories&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;categories&#039;;&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;category&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;category&#039;;&lt;br /&gt;
                       $id = explode(&#039;:&#039;, $segments[1]);&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;article&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       $id = explode(&#039;:&#039;, $segments[1]);&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
       }&lt;br /&gt;
       return $vars;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What happens here? In the function &amp;lt;code&amp;gt;[&#039;&#039;componentname&#039;&#039;]BuildRoute&amp;lt;/code&amp;gt; we arranged the items in the &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array in a specific sequence. This means that in this example the view is first and the id is second in the array.&lt;br /&gt;
&lt;br /&gt;
By reading &amp;lt;code&amp;gt;$segments[0]&amp;lt;/code&amp;gt;, we access the name of the view. We set the right view and/or identifier depending on its value and we return the &amp;lt;code&amp;gt;$vars&amp;lt;/code&amp;gt; array to &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;$vars&amp;lt;/code&amp;gt; should be an associative array similar to the array that was passed to the BuildRoute method.&lt;br /&gt;
&lt;br /&gt;
The above example of the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; is a very simple way to generate SEF URLs but should show how this works quite clearly.&lt;br /&gt;
&lt;br /&gt;
The generated URL in this example contains the name of the view and doesn&#039;t reflect the content hierarchy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[view]/[slug]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A More Advanced Example ===&lt;br /&gt;
&lt;br /&gt;
In the next example we will try to get rid of the need for the view and we will try to reflect the current hierarchy level in the URL.&lt;br /&gt;
&lt;br /&gt;
The goal is URL&#039;s that look like:&lt;br /&gt;
&lt;br /&gt;
* When viewing an article: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[category]/[article]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* When viewing a category: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[category]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* When viewing the categories overview: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have done step 1 and 2 also for the category.&lt;br /&gt;
&lt;br /&gt;
The link to the article would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JRoute::_(&#039;index.php?view=article&amp;amp;catid=&#039; . $row-­&amp;gt;catslug . &#039;&amp;amp;id=&#039;.$row-­&amp;gt;slug);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the Link to the category would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JRoute::_(&#039;index.php?view=category&amp;amp;id=&#039; . $row-&amp;gt;catslug);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function [componentname]BuildRoute(&amp;amp;$query)&lt;br /&gt;
{&lt;br /&gt;
       $segments = array();&lt;br /&gt;
       if (isset($query[&#039;catid&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;catid&#039;];&lt;br /&gt;
                unset($query[&#039;catid&#039;]);&lt;br /&gt;
       };&lt;br /&gt;
       if (isset($query[&#039;id&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;id&#039;];&lt;br /&gt;
                unset($query[&#039;id&#039;]);&lt;br /&gt;
       };&lt;br /&gt;
       unset($query[&#039;view&#039;]);&lt;br /&gt;
       return $segments;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The difference now is that we don’t add the name of the view to the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array. We still unset the view key since otherwise, &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; would add it to the URL as part of the query string. Another new thing here is the additional parameter catid that we push into the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]ParseRoute($segments)&lt;br /&gt;
{&lt;br /&gt;
       $vars = array();&lt;br /&gt;
       $app = JFactory::getApplication();&lt;br /&gt;
       $menu = $app-&amp;gt;getMenu();&lt;br /&gt;
       $item = $menu-&amp;gt;getActive();&lt;br /&gt;
       // Count segments&lt;br /&gt;
       $count = count($segments);&lt;br /&gt;
       // Handle View and Identifier&lt;br /&gt;
       switch ($item-&amp;gt;query[&#039;view&#039;])&lt;br /&gt;
       {&lt;br /&gt;
               case &#039;categories&#039;:&lt;br /&gt;
                       if ($count == 1)&lt;br /&gt;
                       {&lt;br /&gt;
                               $vars[&#039;view&#039;] = &#039;category&#039;;&lt;br /&gt;
                       }&lt;br /&gt;
                       if ($count == 2)&lt;br /&gt;
                       {&lt;br /&gt;
                               $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       }&lt;br /&gt;
                       $id = explode(&#039;:&#039;, $segments[$count-1]);&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;category&#039;:&lt;br /&gt;
                       $id = explode(&#039;:&#039;, $segments[$count-1]);&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       break;&lt;br /&gt;
       }&lt;br /&gt;
       return $vars;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this ParseRoute function has a lot of different code parts in comparison to the previous. The reason for this is simple. We don’t have the name of the view in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array and we need to find another way to determine it.&lt;br /&gt;
&lt;br /&gt;
We need to find out which level of hierarchy we are in by receiving the root element. We do this by looking to the view name of the active menu item:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$item-­&amp;gt;query[&#039;view&#039;]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also we need to know the number of items in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$count = count($segments);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this information we can correctly set the view for all possible three cases:&lt;br /&gt;
&lt;br /&gt;
* The menu item is a link to the categories view and the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array has two items (&amp;lt;code&amp;gt;$catid&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt;). In this case we know that we need to parse a link to an article.&lt;br /&gt;
* The menu item is a link to the categories view and the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array has one item (&amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt;). In this case we know that we need to parse a link to a category.&lt;br /&gt;
* The menu item is a link to a category. In this case, we know that any item in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array is the identifier for an article.&lt;br /&gt;
&lt;br /&gt;
The result of all this code is clean and human-readable component URLs.&lt;br /&gt;
&lt;br /&gt;
== Routers and Menu Items ==&lt;br /&gt;
&lt;br /&gt;
A last important part of creating a router is considering what to do with menu items. As explained on [[Search Engine Friendly URLs]], the output of the component router is used &#039;&#039;after&#039;&#039; the first segment of a route, the first segment being the menu item&#039;s alias. This creates a difficult question: how is your router and/or other code to know which menu item to route through?&lt;br /&gt;
&lt;br /&gt;
Suppose, for example, that your component is currently producing output for the page &amp;lt;tt&amp;gt;/dogs&amp;lt;/tt&amp;gt;, which lists all dogs in the system. Of course, the items in the list need to be links to pages that display more details about one dog. What should the URL to the dog with ID 21 and name Fido become? Using a router that works according to the principles we&#039;ve seen so far, the route that is produced is &amp;lt;tt&amp;gt;dogs/21-fido&amp;lt;/tt&amp;gt;, or with some additional work &amp;lt;tt&amp;gt;/dogs/fido&amp;lt;/tt&amp;gt;. But perhaps the user has created a menu item with the alias &amp;lt;tt&amp;gt;mydoggy&amp;lt;/tt&amp;gt; which displays exactly that dog&#039;s details. Then it is probably the user&#039;s intention to route this URL through that menu item, and the item in the list should link to the page &amp;lt;tt&amp;gt;/mydoggy&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
More generally, whenever you are building a route, you will need to find the menu item that is most suitable as a &#039;&#039;starting point&#039;&#039; for building your route. The term &#039;&#039;starting point&#039;&#039; is emphasized because the rest of the route depends on the configuration of the menu item. In our example above, &amp;lt;tt&amp;gt;/dogs/21-fido&amp;lt;/tt&amp;gt; is an acceptable route, &amp;lt;tt&amp;gt;/mydoggy&amp;lt;/tt&amp;gt; is arguably even better, but &amp;lt;tt&amp;gt;/mydoggy/21-fido&amp;lt;/tt&amp;gt; is simply wrong, since &amp;lt;tt&amp;gt;/mydoggy&amp;lt;/tt&amp;gt; is in itself a menu item that is set up to display &amp;lt;tt&amp;gt;fido&amp;lt;/tt&amp;gt;&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Several approaches are available to tackle this problem. Joomla!&#039;s core components take a mixed approach, separating responsibilities in two units of code: the router itself and the so-called &amp;lt;code&amp;gt;[componentname]RouteHelper&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;[componentname]RouteHelper&amp;lt;/code&amp;gt; provides methods that find the most suitable menu item for a given piece of data to be displayed, while the router analyzes the menu item and puts any information that is not determined by the menu item&#039;s configuration into the route. This does mean that the &#039;&#039;calling code&#039;&#039; must explicitly call the helper&#039;s method before routing (&amp;lt;code&amp;gt;echo JRoute::_(DogsRouteHelper::getDogRoute(21));&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
There is a useful thread on this subject here: [[jtopic:148632]] (note, may be out of date)&lt;br /&gt;
&lt;br /&gt;
For details on the internals of routing, see [[Routing implementation details]].&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Tutorials]][[Category:Component Development]][[Category:Search Engine Friendly URLs]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J2.5:Supporting_SEF_URLs_in_your_component&amp;diff=125181</id>
		<title>J2.5:Supporting SEF URLs in your component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J2.5:Supporting_SEF_URLs_in_your_component&amp;diff=125181"/>
		<updated>2014-08-28T00:13:17Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: /* Preparing Your Data for Routing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|2.5,3.1}}&lt;br /&gt;
{{:Search Engine Friendly URLs}}&lt;br /&gt;
In Joomla!, each [[component]] is responsible for handling its own SEF URLs. Therefore, as the [[Developers|developer]] of a component, you will have to create your own &#039;&#039;&#039;router&#039;&#039;&#039; to allow your component to use SEF URLs.&lt;br /&gt;
&lt;br /&gt;
== The Concept ==&lt;br /&gt;
&lt;br /&gt;
Assuming you are following standard development practices, your component is probably using &amp;quot;system URLs&amp;quot; that look a lot like &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_yourcomponent&amp;amp;view=article&amp;amp;id=1&amp;amp;catid=20&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;, and your goal is to transform this into &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;. As the developer, you have two tasks: signalling the system that certain pieces of text are URLs and need to be transformed, and explaining the system how to transform URLs.&lt;br /&gt;
&lt;br /&gt;
=== Applying &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
It is difficult and inefficient for Joomla! to figure out which parts of your component&#039;s output are URLs. To support SEF URLs, you will need to change URL-generating code so that it applies &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; before outputting the URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
echo JRoute::_(&#039;index.php?view=article&amp;amp;id=1&amp;amp;catid=20&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that it is possible to leave out the parameters &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; defaults to the name of the component currently being executed, and &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt; defaults to the current menu item&#039;s ID.&lt;br /&gt;
&lt;br /&gt;
In general, you should only apply this to URLs that users and/or search engines are able to see. For example, there is no need to transform URLs used in redirects that immediately result in other redirects.&lt;br /&gt;
&lt;br /&gt;
If the user turns off SEF URLs in the site&#039;s settings, &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; will produce working non-SEF URLs without any changes to the code.&lt;br /&gt;
&lt;br /&gt;
=== Writing a router ===&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also need to write a router, which is a single file with two functions that convert system URLs to and from SEF URLs. This file needs to be placed at &amp;lt;tt&amp;gt;/components/com_yourcomponent/router.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The first function, &amp;lt;code&amp;gt;[componentname]BuildRoute(&amp;amp;$query)&amp;lt;/code&amp;gt;, must transform an array of URL parameters into an array of segments that will form the SEF URL. Schematically, the transformation works as follows:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_yourcomponent&amp;amp;view=article&amp;amp;id=1&amp;amp;catid=20&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt;, called by your component or any other extension&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$query = array(&#039;view&#039; =&amp;gt; &#039;article&#039;, &#039;id&#039; =&amp;gt; 1, &#039;catid&#039; =&amp;gt; 20)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Your router&#039;s &amp;lt;code&amp;gt;com_yourcomponentBuildRoute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$segments = array(20, 1);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Joomla&#039;s internal route building (for display)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second function, &amp;lt;code&amp;gt;[componentname]ParseRoute($segments)&amp;lt;/code&amp;gt;, must transform an array of segments back into an array of URL parameters. Schematically:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Joomla&#039;s internal route parsing&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$segments = array(20, 1);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Your router&#039;s &amp;lt;code&amp;gt;com_yourcomponentParseRoute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$query = array(&#039;view&#039; =&amp;gt; &#039;article&#039;, &#039;id&#039; =&amp;gt; 1, &#039;catid&#039; =&amp;gt; 20)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two functions must cooperate in such a way that the original URL can be reconstructed. You can think of &amp;lt;code&amp;gt;BuildRoute&amp;lt;/code&amp;gt; as a form of [[wikipedia:Encoding|encoding]] and &amp;lt;code&amp;gt;ParseRoute&amp;lt;/code&amp;gt; as the corresponding decoding. When the original URL isn&#039;t properly reproduced, your component will stop working.&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Data for Routing ==&lt;br /&gt;
&lt;br /&gt;
Clearly, any URL format needs to contain some kind of information that identifies the data you want to show. If your system URLs look like &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_yourcomponent&amp;amp;view=article&amp;amp;id=1&amp;amp;catid=20&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;, that information is currently the &amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt; URL parameter (&amp;lt;tt&amp;gt;id=1&amp;lt;/tt&amp;gt;). You probably want your SEF URLs to contain a textual description of the data they point to. In Joomla!, this is usually done by giving your users a way to enter an &#039;&#039;&#039;alias&#039;&#039;&#039; to be used in the URL.&lt;br /&gt;
&lt;br /&gt;
=== The Alias ===&lt;br /&gt;
&lt;br /&gt;
Even if your users can enter an alias, they might not do so, leaving the generation of a sensible alias up to your component. If your data has a title field, you can use that as a candidate alias (like the core [[Content]] component does).&lt;br /&gt;
&lt;br /&gt;
Considering that the alias will be used in URLs, it has to be URL safe. Joomla! provides a method making arbitrary strings URI safe, which includes replacing accented UTF­8 characters by their ASCII­7 equivalents, white spaces by hyphens, etc. Whether the user entered the alias or a candidate has been chosen automatically, you should ensure that the above requirements for a URL safe alias are met. A good place for implementing this, if you are using &amp;lt;code&amp;gt;JTable&amp;lt;/code&amp;gt;, is the &amp;lt;code&amp;gt;JTable::check()&amp;lt;/code&amp;gt; method, which is called during the save process. Have a look at this example code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function check()&lt;br /&gt;
{&lt;br /&gt;
    jimport(&#039;joomla.filter.output&#039;);&lt;br /&gt;
    if (empty($this-&amp;gt;alias))&lt;br /&gt;
    {&lt;br /&gt;
	    $this-&amp;gt;alias = $this-&amp;gt;title;&lt;br /&gt;
    }&lt;br /&gt;
    $this-&amp;gt;alias = JFilterOutput::stringURLSafe($this-&amp;gt;alias);&lt;br /&gt;
&lt;br /&gt;
    /* All your other checks */&lt;br /&gt;
    return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the alias field is empty the title is used as alias. Then the alias is made URL safe using the &amp;lt;code&amp;gt;JFilterOutput::stringURLSafe()&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
=== The Slug ===&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;&#039;slug&#039;&#039;&#039; is used to minimise the amount of code you need to support SEF URLs. It consists of the numerical identifier (&amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt;) your system URLs used, a colon (&amp;lt;tt&amp;gt;:&amp;lt;/tt&amp;gt;), and the alias you created as described above. &lt;br /&gt;
&lt;br /&gt;
Consider a SEF URL for an [[Article]] with &amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt; 1 and title &amp;quot;Welcome to Joomla!&amp;quot;. The automatically generated alias for this article is &amp;lt;tt&amp;gt;welcome-to-joomla&amp;lt;/tt&amp;gt;, and the slug becomes &amp;lt;tt&amp;gt;1­:welcome­-to­-joomla&amp;lt;/tt&amp;gt;. In the [[Content]] component, the two elements are combined during the database query in the model (&amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; represents &amp;lt;code&amp;gt;#__content&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$query = &#039;SELECT a.*, &#039;.&lt;br /&gt;
         &#039;CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(&amp;quot;:&amp;quot;, a.id, a.alias) ELSE a.id END as slug,&#039;&lt;br /&gt;
         /*...*/;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The advantage of this method of creating a slug is that you can simply use the slug as a drop-in replacement for the id in most places. For example, you don&#039;t need to check for and remove the colon and the alias from the request data manually: if you use [[Retrieving request data using JInput|JInput]]&#039;s &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; (integer) filter, it will do that automatically.&lt;br /&gt;
&lt;br /&gt;
== Routing URLs ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; method translates the internal Joomla! URL to a custom URL. &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; has three parameters and its prototype is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;JRoute::_($url, $xhtml = true, $ssl = null);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;$url&amp;lt;/code&amp;gt; is a string containing the absolute or relative internal Joomla! URL.&lt;br /&gt;
* &amp;lt;code&amp;gt;$xhtml&amp;lt;/code&amp;gt; is a boolean value that specifies whether or not the output should be in XHTML. This parameter is optional and if omitted defaults to true.&lt;br /&gt;
* &amp;lt;code&amp;gt;$ssl&amp;lt;/code&amp;gt; is an integer value that specifies whether the URI should be secure. It should be set to 1 to force the URI to be secure using the global secure site URI, 0 to leave it in the same state as when it was passed, and -1 to force the URI to be unsecure using the global unsecure site URI.&lt;br /&gt;
&lt;br /&gt;
The most important parameter is &amp;lt;code&amp;gt;$url&amp;lt;/code&amp;gt;. A call to this method might look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;JRoute::_(&#039;index.php?view=article&amp;amp;id=&#039; . $row-&amp;gt;slug);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$row-­&amp;gt;slug&amp;lt;/code&amp;gt; is the value that was generated in step 2 from a combination of id and title alias.&lt;br /&gt;
&lt;br /&gt;
Another advantage of using &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; is that the router now handles &amp;lt;code&amp;gt;$option&amp;lt;/code&amp;gt; (the component name) and the &amp;lt;code&amp;gt;$Itemid&amp;lt;/code&amp;gt; (the menu item ID). The component itself doesn&#039;t have to know its name (&amp;lt;code&amp;gt;$option&amp;lt;/code&amp;gt;) or the active menu item (&amp;lt;code&amp;gt;$Itemid&amp;lt;/code&amp;gt;) like it did in previous version of Joomla!.&lt;br /&gt;
&lt;br /&gt;
It is important that you think about the sequence of the URL parameter in this stage. This will be more clear when we have a deeper look at the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; in the next section.&lt;br /&gt;
&lt;br /&gt;
The building process of JRouter is divided into two steps:&lt;br /&gt;
&lt;br /&gt;
* Create the application route. The application route is fully handled by JRouter and the component developer doesn’t have to do anything to make it work.&lt;br /&gt;
* Create the component route. To create the component route, JRouter looks for the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; in the component directory which is responsible for building the route for the component.&lt;br /&gt;
&lt;br /&gt;
== The Component Router ==&lt;br /&gt;
&lt;br /&gt;
We will have two functions in the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt;. One is responsible for building the URL and the other is responsible for parsing it. In the next examples, a very basic and a more advanced one, we assume that we have three views that links can point to. The first is a categories overview (&amp;lt;code&amp;gt;view=categories&amp;lt;/code&amp;gt;), the second is a single category (&amp;lt;code&amp;gt;view=category&amp;lt;/code&amp;gt;) and the third is a single article (&amp;lt;code&amp;gt;view=article&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The file &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; should be in the site area of your component. It is not used on admin/backend pages. Don&#039;t forget to add it to your XML [[Manifest files|manifest file]] in the site folder.&lt;br /&gt;
&lt;br /&gt;
=== A Simple Example ===&lt;br /&gt;
&lt;br /&gt;
This simple example will illustrate the basics of implementing a router for your component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]BuildRoute(&amp;amp;$query)&lt;br /&gt;
{&lt;br /&gt;
       $segments = array();&lt;br /&gt;
       if (isset($query[&#039;view&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;view&#039;];&lt;br /&gt;
                unset($query[&#039;view&#039;]);&lt;br /&gt;
       }&lt;br /&gt;
       if (isset($query[&#039;id&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;id&#039;];&lt;br /&gt;
                unset($query[&#039;id&#039;]);&lt;br /&gt;
       };&lt;br /&gt;
       return $segments;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; passes a &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array to the &amp;lt;code&amp;gt;[&#039;&#039;componentname&#039;&#039;]BuildRoute&amp;lt;/code&amp;gt; function. This function will add the relevant parts of the array to the $segments array in the right order and will return the properly ordered array. The content of the &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array needs to be unset, otherwise &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; will add it to the URL in the form of a query string (i.e. any variables that are not handled by the router will be passed in the query string).&lt;br /&gt;
&lt;br /&gt;
The prefix &#039;&#039;componentname&#039;&#039; is the name for your component, as found in the directory holding the component&#039;s files. For instance, a component &amp;quot;Magic&amp;quot; in directory &amp;lt;tt&amp;gt;/components/com_magic/...&amp;lt;/tt&amp;gt; would use a prefix &amp;lt;code&amp;gt;magic&amp;lt;/code&amp;gt; (all lower case).&lt;br /&gt;
&lt;br /&gt;
The next function in the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; parses the URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]ParseRoute($segments)&lt;br /&gt;
{&lt;br /&gt;
       $vars = array();&lt;br /&gt;
       switch($segments[0])&lt;br /&gt;
       {&lt;br /&gt;
               case &#039;categories&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;categories&#039;;&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;category&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;category&#039;;&lt;br /&gt;
                       $id = explode(&#039;:&#039;, $segments[1]);&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;article&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       $id = explode(&#039;:&#039;, $segments[1]);&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
       }&lt;br /&gt;
       return $vars;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What happens here? In the function &amp;lt;code&amp;gt;[&#039;&#039;componentname&#039;&#039;]BuildRoute&amp;lt;/code&amp;gt; we arranged the items in the &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array in a specific sequence. This means that in this example the view is first and the id is second in the array.&lt;br /&gt;
&lt;br /&gt;
By reading &amp;lt;code&amp;gt;$segments[0]&amp;lt;/code&amp;gt;, we access the name of the view. We set the right view and/or identifier depending on its value and we return the &amp;lt;code&amp;gt;$vars&amp;lt;/code&amp;gt; array to &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;$vars&amp;lt;/code&amp;gt; should be an associative array similar to the array that was passed to the BuildRoute method.&lt;br /&gt;
&lt;br /&gt;
The above example of the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; is a very simple way to generate SEF URLs but should show how this works quite clearly.&lt;br /&gt;
&lt;br /&gt;
The generated URL in this example contains the name of the view and doesn&#039;t reflect the content hierarchy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[view]/[slug]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A More Advanced Example ===&lt;br /&gt;
&lt;br /&gt;
In the next example we will try to get rid of the need for the view and we will try to reflect the current hierarchy level in the URL.&lt;br /&gt;
&lt;br /&gt;
The goal is URL&#039;s that look like:&lt;br /&gt;
&lt;br /&gt;
* When viewing an article: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[category]/[article]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* When viewing a category: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[category]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* When viewing the categories overview: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have done step 1 and 2 also for the category.&lt;br /&gt;
&lt;br /&gt;
The link to the article would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JRoute::_(&#039;index.php?view=article&amp;amp;catid=&#039; . $row-­&amp;gt;catslug . &#039;&amp;amp;id=&#039;.$row-­&amp;gt;slug);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the Link to the category would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JRoute::_(&#039;index.php?view=category&amp;amp;id=&#039; . $row-&amp;gt;catslug);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function [componentname]BuildRoute(&amp;amp;$query)&lt;br /&gt;
{&lt;br /&gt;
       $segments = array();&lt;br /&gt;
       if (isset($query[&#039;catid&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;catid&#039;];&lt;br /&gt;
                unset($query[&#039;catid&#039;]);&lt;br /&gt;
       };&lt;br /&gt;
       if (isset($query[&#039;id&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;id&#039;];&lt;br /&gt;
                unset($query[&#039;id&#039;]);&lt;br /&gt;
       };&lt;br /&gt;
       unset($query[&#039;view&#039;]);&lt;br /&gt;
       return $segments;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The difference now is that we don’t add the name of the view to the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array. We still unset the view key since otherwise, &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; would add it to the URL as part of the query string. Another new thing here is the additional parameter catid that we push into the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]ParseRoute($segments)&lt;br /&gt;
{&lt;br /&gt;
       $vars = array();&lt;br /&gt;
       $app = JFactory::getApplication();&lt;br /&gt;
       $menu = $app-&amp;gt;getMenu();&lt;br /&gt;
       $item = $menu-&amp;gt;getActive();&lt;br /&gt;
       // Count segments&lt;br /&gt;
       $count = count($segments);&lt;br /&gt;
       // Handle View and Identifier&lt;br /&gt;
       switch ($item-&amp;gt;query[&#039;view&#039;])&lt;br /&gt;
       {&lt;br /&gt;
               case &#039;categories&#039;:&lt;br /&gt;
                       if ($count == 1)&lt;br /&gt;
                       {&lt;br /&gt;
                               $vars[&#039;view&#039;] = &#039;category&#039;;&lt;br /&gt;
                       }&lt;br /&gt;
                       if ($count == 2)&lt;br /&gt;
                       {&lt;br /&gt;
                               $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       }&lt;br /&gt;
                       $id = explode(&#039;:&#039;, $segments[$count-1]);&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;category&#039;:&lt;br /&gt;
                       $id = explode(&#039;:&#039;, $segments[$count-1]);&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       break;&lt;br /&gt;
       }&lt;br /&gt;
       return $vars;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this ParseRoute function has a lot of different code parts in comparison to the previous. The reason for this is simple. We don’t have the name of the view in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array and we need to find another way to determine it.&lt;br /&gt;
&lt;br /&gt;
We need to find out which level of hierarchy we are in by receiving the root element. We do this by looking to the view name of the active menu item:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$item-­&amp;gt;query[&#039;view&#039;]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also we need to know the number of items in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$count = count($segments);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this information we can correctly set the view for all possible three cases:&lt;br /&gt;
&lt;br /&gt;
* The menu item is a link to the categories view and the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array has two items (&amp;lt;code&amp;gt;$catid&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt;). In this case we know that we need to parse a link to an article.&lt;br /&gt;
* The menu item is a link to the categories view and the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array has one item (&amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt;). In this case we know that we need to parse a link to a category.&lt;br /&gt;
* The menu item is a link to a category. In this case, we know that any item in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array is the identifier for an article.&lt;br /&gt;
&lt;br /&gt;
The result of all this code is clean and human-readable component URLs.&lt;br /&gt;
&lt;br /&gt;
== Routers and Menu Items ==&lt;br /&gt;
&lt;br /&gt;
A last important part of creating a router is considering what to do with menu items. As explained on [[Search Engine Friendly URLs]], the output of the component router is used &#039;&#039;after&#039;&#039; the first segment of a route, the first segment being the menu item&#039;s alias. This creates a difficult question: how is your router and/or other code to know which menu item to route through?&lt;br /&gt;
&lt;br /&gt;
Suppose, for example, that your component is currently producing output for the page &amp;lt;tt&amp;gt;/dogs&amp;lt;/tt&amp;gt;, which lists all dogs in the system. Of course, the items in the list need to be links to pages that display more details about one dog. What should the URL to the dog with ID 21 and name Fido become? Using a router that works according to the principles we&#039;ve seen so far, the route that is produced is &amp;lt;tt&amp;gt;dogs/21-fido&amp;lt;/tt&amp;gt;, or with some additional work &amp;lt;tt&amp;gt;/dogs/fido&amp;lt;/tt&amp;gt;. But perhaps the user has created a menu item with the alias &amp;lt;tt&amp;gt;mydoggy&amp;lt;/tt&amp;gt; which displays exactly that dog&#039;s details. Then it is probably the user&#039;s intention to route this URL through that menu item, and the item in the list should link to the page &amp;lt;tt&amp;gt;/mydoggy&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
More generally, whenever you are building a route, you will need to find the menu item that is most suitable as a &#039;&#039;starting point&#039;&#039; for building your route. The term &#039;&#039;starting point&#039;&#039; is emphasized because the rest of the route depends on the configuration of the menu item. In our example above, &amp;lt;tt&amp;gt;/dogs/21-fido&amp;lt;/tt&amp;gt; is an acceptable route, &amp;lt;tt&amp;gt;/mydoggy&amp;lt;/tt&amp;gt; is arguably even better, but &amp;lt;tt&amp;gt;/mydoggy/21-fido&amp;lt;/tt&amp;gt; is simply wrong, since &amp;lt;tt&amp;gt;/mydoggy&amp;lt;/tt&amp;gt; is in itself a menu item that is set up to display &amp;lt;tt&amp;gt;fido&amp;lt;/tt&amp;gt;&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Several approaches are available to tackle this problem. Joomla!&#039;s core components take a mixed approach, separating responsibilities in two units of code: the router itself and the so-called &amp;lt;code&amp;gt;[componentname]RouteHelper&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;[componentname]RouteHelper&amp;lt;/code&amp;gt; provides methods that find the most suitable menu item for a given piece of data to be displayed, while the router analyzes the menu item and puts any information that is not determined by the menu item&#039;s configuration into the route. This does mean that the &#039;&#039;calling code&#039;&#039; must explicitly call the helper&#039;s method before routing (&amp;lt;code&amp;gt;echo JRoute::_(DogsRouteHelper::getDogRoute(21));&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
There is a useful thread on this subject here: [[jtopic:148632]] (note, may be out of date)&lt;br /&gt;
&lt;br /&gt;
For details on the internals of routing, see [[Routing implementation details]].&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Tutorials]][[Category:Component Development]][[Category:Search Engine Friendly URLs]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J2.5:Supporting_SEF_URLs_in_your_component&amp;diff=125174</id>
		<title>J2.5:Supporting SEF URLs in your component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J2.5:Supporting_SEF_URLs_in_your_component&amp;diff=125174"/>
		<updated>2014-08-26T15:20:33Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Adjusted layout&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|2.5,3.1}}&lt;br /&gt;
{{:Search Engine Friendly URLs}}&lt;br /&gt;
In Joomla!, each [[component]] is responsible for handling its own SEF URLs. Therefore, as the [[Developers|developer]] of a component, you will have to create your own &#039;&#039;&#039;router&#039;&#039;&#039; to allow your component to use SEF URLs.&lt;br /&gt;
&lt;br /&gt;
== The Concept ==&lt;br /&gt;
&lt;br /&gt;
Assuming you are following standard development practices, your component is probably using &amp;quot;system URLs&amp;quot; that look a lot like &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_yourcomponent&amp;amp;view=article&amp;amp;id=1&amp;amp;catid=20&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;, and your goal is to transform this into &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;. As the developer, you have two tasks: signalling the system that certain pieces of text are URLs and need to be transformed, and explaining the system how to transform URLs.&lt;br /&gt;
&lt;br /&gt;
=== Applying &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
It is difficult and inefficient for Joomla! to figure out which parts of your component&#039;s output are URLs. To support SEF URLs, you will need to change URL-generating code so that it applies &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; before outputting the URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
echo JRoute::_(&#039;index.php?view=article&amp;amp;id=1&amp;amp;catid=20&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that it is possible to leave out the parameters &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; defaults to the name of the component currently being executed, and &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt; defaults to the current menu item&#039;s ID.&lt;br /&gt;
&lt;br /&gt;
In general, you should only apply this to URLs that users and/or search engines are able to see. For example, there is no need to transform URLs used in redirects that immediately result in other redirects.&lt;br /&gt;
&lt;br /&gt;
If the user turns off SEF URLs in the site&#039;s settings, &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; will produce working non-SEF URLs without any changes to the code.&lt;br /&gt;
&lt;br /&gt;
=== Writing a router ===&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also need to write a router, which is a single file with two functions that convert system URLs to and from SEF URLs. This file needs to be placed at &amp;lt;tt&amp;gt;/components/com_yourcomponent/router.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The first function, &amp;lt;code&amp;gt;[componentname]BuildRoute(&amp;amp;$query)&amp;lt;/code&amp;gt;, must transform an array of URL parameters into an array of segments that will form the SEF URL. Schematically, the transformation works as follows:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_yourcomponent&amp;amp;view=article&amp;amp;id=1&amp;amp;catid=20&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt;, called by your component or any other extension&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$query = array(&#039;view&#039; =&amp;gt; &#039;article&#039;, &#039;id&#039; =&amp;gt; 1, &#039;catid&#039; =&amp;gt; 20)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Your router&#039;s &amp;lt;code&amp;gt;com_yourcomponentBuildRoute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$segments = array(20, 1);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Joomla&#039;s internal route building (for display)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second function, &amp;lt;code&amp;gt;[componentname]ParseRoute($segments)&amp;lt;/code&amp;gt;, must transform an array of segments back into an array of URL parameters. Schematically:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Joomla&#039;s internal route parsing&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$segments = array(20, 1);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Your router&#039;s &amp;lt;code&amp;gt;com_yourcomponentParseRoute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$query = array(&#039;view&#039; =&amp;gt; &#039;article&#039;, &#039;id&#039; =&amp;gt; 1, &#039;catid&#039; =&amp;gt; 20)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two functions must cooperate in such a way that the original URL can be reconstructed. You can think of &amp;lt;code&amp;gt;BuildRoute&amp;lt;/code&amp;gt; as a form of [[wikipedia:Encoding|encoding]] and &amp;lt;code&amp;gt;ParseRoute&amp;lt;/code&amp;gt; as the corresponding decoding. When the original URL isn&#039;t properly reproduced, your component will stop working.&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Data for Routing ==&lt;br /&gt;
&lt;br /&gt;
=== The Alias ===&lt;br /&gt;
&lt;br /&gt;
The first step is the generation of the so called alias. The alias is used in the URL instead of the title (the alias is the text you want to have in the URL). The alias has to be URI safe, which means accented UTF­8 characters are replaced by their ASCII­7 equivalents, white spaces by hyphens, etc.&lt;br /&gt;
&lt;br /&gt;
The alias can be defined by the user, but you should ensure that the above requirements for a URL safe alias are met. A good way to do so is to use the &amp;lt;code&amp;gt;JTable::check()&amp;lt;/code&amp;gt; method during the save process. Have a look at this example code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function check()&lt;br /&gt;
{&lt;br /&gt;
    jimport(&#039;joomla.filter.output&#039;);&lt;br /&gt;
    if (empty($this-&amp;gt;alias))&lt;br /&gt;
    {&lt;br /&gt;
	    $this-&amp;gt;alias = $this-&amp;gt;title;&lt;br /&gt;
    }&lt;br /&gt;
    $this-&amp;gt;alias = JFilterOutput::stringURLSafe($this-&amp;gt;alias);&lt;br /&gt;
&lt;br /&gt;
    /* All your other checks */&lt;br /&gt;
    return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the alias field is empty the title will be used as alias. Then the alias will be made URLSafe using the &amp;lt;code&amp;gt;JFilterOutput::stringURLSafe()&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
=== The Slug ===&lt;br /&gt;
&lt;br /&gt;
Continuing with the same example, the &amp;quot;slug&amp;quot; - &amp;quot;1­:welcome­-to­-joomla&amp;quot; has two parts. The first part is the article identifier (id) and the second is the alias. They are separated by a colon. These two elements were combined during the database query in the model:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$query = &#039;SELECT a.*, &#039;.&lt;br /&gt;
         &#039;CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(&amp;quot;:&amp;quot;, a.id, a.alias) ELSE a.id END as slug,&#039;&lt;br /&gt;
         /*...*/;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this step the slug is used instead of the id.&lt;br /&gt;
&lt;br /&gt;
== Routing URLs ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; method translates the internal Joomla! URL to a custom URL. &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; has three parameters and its prototype is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;JRoute::_($url, $xhtml = true, $ssl = null);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;$url&amp;lt;/code&amp;gt; is a string containing the absolute or relative internal Joomla! URL.&lt;br /&gt;
* &amp;lt;code&amp;gt;$xhtml&amp;lt;/code&amp;gt; is a boolean value that specifies whether or not the output should be in XHTML. This parameter is optional and if omitted defaults to true.&lt;br /&gt;
* &amp;lt;code&amp;gt;$ssl&amp;lt;/code&amp;gt; is an integer value that specifies whether the URI should be secure. It should be set to 1 to force the URI to be secure using the global secure site URI, 0 to leave it in the same state as when it was passed, and -1 to force the URI to be unsecure using the global unsecure site URI.&lt;br /&gt;
&lt;br /&gt;
The most important parameter is &amp;lt;code&amp;gt;$url&amp;lt;/code&amp;gt;. A call to this method might look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;JRoute::_(&#039;index.php?view=article&amp;amp;id=&#039; . $row-&amp;gt;slug);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$row-­&amp;gt;slug&amp;lt;/code&amp;gt; is the value that was generated in step 2 from a combination of id and title alias.&lt;br /&gt;
&lt;br /&gt;
Another advantage of using &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; is that the router now handles &amp;lt;code&amp;gt;$option&amp;lt;/code&amp;gt; (the component name) and the &amp;lt;code&amp;gt;$Itemid&amp;lt;/code&amp;gt; (the menu item ID). The component itself doesn&#039;t have to know its name (&amp;lt;code&amp;gt;$option&amp;lt;/code&amp;gt;) or the active menu item (&amp;lt;code&amp;gt;$Itemid&amp;lt;/code&amp;gt;) like it did in previous version of Joomla!.&lt;br /&gt;
&lt;br /&gt;
It is important that you think about the sequence of the URL parameter in this stage. This will be more clear when we have a deeper look at the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; in the next section.&lt;br /&gt;
&lt;br /&gt;
The building process of JRouter is divided into two steps:&lt;br /&gt;
&lt;br /&gt;
* Create the application route. The application route is fully handled by JRouter and the component developer doesn’t have to do anything to make it work.&lt;br /&gt;
* Create the component route. To create the component route, JRouter looks for the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; in the component directory which is responsible for building the route for the component.&lt;br /&gt;
&lt;br /&gt;
== The Component Router ==&lt;br /&gt;
&lt;br /&gt;
We will have two functions in the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt;. One is responsible for building the URL and the other is responsible for parsing it. In the next examples, a very basic and a more advanced one, we assume that we have three views that links can point to. The first is a categories overview (&amp;lt;code&amp;gt;view=categories&amp;lt;/code&amp;gt;), the second is a single category (&amp;lt;code&amp;gt;view=category&amp;lt;/code&amp;gt;) and the third is a single article (&amp;lt;code&amp;gt;view=article&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The file &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; should be in the site area of your component. It is not used on admin/backend pages. Don&#039;t forget to add it to your XML [[Manifest files|manifest file]] in the site folder.&lt;br /&gt;
&lt;br /&gt;
=== A Simple Example ===&lt;br /&gt;
&lt;br /&gt;
This simple example will illustrate the basics of implementing a router for your component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]BuildRoute(&amp;amp;$query)&lt;br /&gt;
{&lt;br /&gt;
       $segments = array();&lt;br /&gt;
       if (isset($query[&#039;view&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;view&#039;];&lt;br /&gt;
                unset($query[&#039;view&#039;]);&lt;br /&gt;
       }&lt;br /&gt;
       if (isset($query[&#039;id&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;id&#039;];&lt;br /&gt;
                unset($query[&#039;id&#039;]);&lt;br /&gt;
       };&lt;br /&gt;
       return $segments;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; passes a &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array to the &amp;lt;code&amp;gt;[&#039;&#039;componentname&#039;&#039;]BuildRoute&amp;lt;/code&amp;gt; function. This function will add the relevant parts of the array to the $segments array in the right order and will return the properly ordered array. The content of the &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array needs to be unset, otherwise &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; will add it to the URL in the form of a query string (i.e. any variables that are not handled by the router will be passed in the query string).&lt;br /&gt;
&lt;br /&gt;
The prefix &#039;&#039;componentname&#039;&#039; is the name for your component, as found in the directory holding the component&#039;s files. For instance, a component &amp;quot;Magic&amp;quot; in directory &amp;lt;tt&amp;gt;/components/com_magic/...&amp;lt;/tt&amp;gt; would use a prefix &amp;lt;code&amp;gt;magic&amp;lt;/code&amp;gt; (all lower case).&lt;br /&gt;
&lt;br /&gt;
The next function in the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; parses the URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]ParseRoute($segments)&lt;br /&gt;
{&lt;br /&gt;
       $vars = array();&lt;br /&gt;
       switch($segments[0])&lt;br /&gt;
       {&lt;br /&gt;
               case &#039;categories&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;categories&#039;;&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;category&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;category&#039;;&lt;br /&gt;
                       $id = explode(&#039;:&#039;, $segments[1]);&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;article&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       $id = explode(&#039;:&#039;, $segments[1]);&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
       }&lt;br /&gt;
       return $vars;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What happens here? In the function &amp;lt;code&amp;gt;[&#039;&#039;componentname&#039;&#039;]BuildRoute&amp;lt;/code&amp;gt; we arranged the items in the &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array in a specific sequence. This means that in this example the view is first and the id is second in the array.&lt;br /&gt;
&lt;br /&gt;
By reading &amp;lt;code&amp;gt;$segments[0]&amp;lt;/code&amp;gt;, we access the name of the view. We set the right view and/or identifier depending on its value and we return the &amp;lt;code&amp;gt;$vars&amp;lt;/code&amp;gt; array to &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;$vars&amp;lt;/code&amp;gt; should be an associative array similar to the array that was passed to the BuildRoute method.&lt;br /&gt;
&lt;br /&gt;
The above example of the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; is a very simple way to generate SEF URLs but should show how this works quite clearly.&lt;br /&gt;
&lt;br /&gt;
The generated URL in this example contains the name of the view and doesn&#039;t reflect the content hierarchy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[view]/[slug]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A More Advanced Example ===&lt;br /&gt;
&lt;br /&gt;
In the next example we will try to get rid of the need for the view and we will try to reflect the current hierarchy level in the URL.&lt;br /&gt;
&lt;br /&gt;
The goal is URL&#039;s that look like:&lt;br /&gt;
&lt;br /&gt;
* When viewing an article: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[category]/[article]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* When viewing a category: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[category]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* When viewing the categories overview: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have done step 1 and 2 also for the category.&lt;br /&gt;
&lt;br /&gt;
The link to the article would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JRoute::_(&#039;index.php?view=article&amp;amp;catid=&#039; . $row-­&amp;gt;catslug . &#039;&amp;amp;id=&#039;.$row-­&amp;gt;slug);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the Link to the category would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JRoute::_(&#039;index.php?view=category&amp;amp;id=&#039; . $row-&amp;gt;catslug);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function [componentname]BuildRoute(&amp;amp;$query)&lt;br /&gt;
{&lt;br /&gt;
       $segments = array();&lt;br /&gt;
       if (isset($query[&#039;catid&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;catid&#039;];&lt;br /&gt;
                unset($query[&#039;catid&#039;]);&lt;br /&gt;
       };&lt;br /&gt;
       if (isset($query[&#039;id&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;id&#039;];&lt;br /&gt;
                unset($query[&#039;id&#039;]);&lt;br /&gt;
       };&lt;br /&gt;
       unset($query[&#039;view&#039;]);&lt;br /&gt;
       return $segments;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The difference now is that we don’t add the name of the view to the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array. We still unset the view key since otherwise, &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; would add it to the URL as part of the query string. Another new thing here is the additional parameter catid that we push into the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]ParseRoute($segments)&lt;br /&gt;
{&lt;br /&gt;
       $vars = array();&lt;br /&gt;
       $app = JFactory::getApplication();&lt;br /&gt;
       $menu = $app-&amp;gt;getMenu();&lt;br /&gt;
       $item = $menu-&amp;gt;getActive();&lt;br /&gt;
       // Count segments&lt;br /&gt;
       $count = count($segments);&lt;br /&gt;
       // Handle View and Identifier&lt;br /&gt;
       switch ($item-&amp;gt;query[&#039;view&#039;])&lt;br /&gt;
       {&lt;br /&gt;
               case &#039;categories&#039;:&lt;br /&gt;
                       if ($count == 1)&lt;br /&gt;
                       {&lt;br /&gt;
                               $vars[&#039;view&#039;] = &#039;category&#039;;&lt;br /&gt;
                       }&lt;br /&gt;
                       if ($count == 2)&lt;br /&gt;
                       {&lt;br /&gt;
                               $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       }&lt;br /&gt;
                       $id = explode(&#039;:&#039;, $segments[$count-1]);&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;category&#039;:&lt;br /&gt;
                       $id = explode(&#039;:&#039;, $segments[$count-1]);&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       break;&lt;br /&gt;
       }&lt;br /&gt;
       return $vars;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this ParseRoute function has a lot of different code parts in comparison to the previous. The reason for this is simple. We don’t have the name of the view in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array and we need to find another way to determine it.&lt;br /&gt;
&lt;br /&gt;
We need to find out which level of hierarchy we are in by receiving the root element. We do this by looking to the view name of the active menu item:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$item-­&amp;gt;query[&#039;view&#039;]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also we need to know the number of items in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$count = count($segments);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this information we can correctly set the view for all possible three cases:&lt;br /&gt;
&lt;br /&gt;
* The menu item is a link to the categories view and the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array has two items (&amp;lt;code&amp;gt;$catid&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt;). In this case we know that we need to parse a link to an article.&lt;br /&gt;
* The menu item is a link to the categories view and the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array has one item (&amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt;). In this case we know that we need to parse a link to a category.&lt;br /&gt;
* The menu item is a link to a category. In this case, we know that any item in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array is the identifier for an article.&lt;br /&gt;
&lt;br /&gt;
The result of all this code is clean and human-readable component URLs.&lt;br /&gt;
&lt;br /&gt;
== Routers and Menu Items ==&lt;br /&gt;
&lt;br /&gt;
A last important part of creating a router is considering what to do with menu items. As explained on [[Search Engine Friendly URLs]], the output of the component router is used &#039;&#039;after&#039;&#039; the first segment of a route, the first segment being the menu item&#039;s alias. This creates a difficult question: how is your router and/or other code to know which menu item to route through?&lt;br /&gt;
&lt;br /&gt;
Suppose, for example, that your component is currently producing output for the page &amp;lt;tt&amp;gt;/dogs&amp;lt;/tt&amp;gt;, which lists all dogs in the system. Of course, the items in the list need to be links to pages that display more details about one dog. What should the URL to the dog with ID 21 and name Fido become? Using a router that works according to the principles we&#039;ve seen so far, the route that is produced is &amp;lt;tt&amp;gt;dogs/21-fido&amp;lt;/tt&amp;gt;, or with some additional work &amp;lt;tt&amp;gt;/dogs/fido&amp;lt;/tt&amp;gt;. But perhaps the user has created a menu item with the alias &amp;lt;tt&amp;gt;mydoggy&amp;lt;/tt&amp;gt; which displays exactly that dog&#039;s details. Then it is probably the user&#039;s intention to route this URL through that menu item, and the item in the list should link to the page &amp;lt;tt&amp;gt;/mydoggy&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
More generally, whenever you are building a route, you will need to find the menu item that is most suitable as a &#039;&#039;starting point&#039;&#039; for building your route. The term &#039;&#039;starting point&#039;&#039; is emphasized because the rest of the route depends on the configuration of the menu item. In our example above, &amp;lt;tt&amp;gt;/dogs/21-fido&amp;lt;/tt&amp;gt; is an acceptable route, &amp;lt;tt&amp;gt;/mydoggy&amp;lt;/tt&amp;gt; is arguably even better, but &amp;lt;tt&amp;gt;/mydoggy/21-fido&amp;lt;/tt&amp;gt; is simply wrong, since &amp;lt;tt&amp;gt;/mydoggy&amp;lt;/tt&amp;gt; is in itself a menu item that is set up to display &amp;lt;tt&amp;gt;fido&amp;lt;/tt&amp;gt;&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Several approaches are available to tackle this problem. Joomla!&#039;s core components take a mixed approach, separating responsibilities in two units of code: the router itself and the so-called &amp;lt;code&amp;gt;[componentname]RouteHelper&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;[componentname]RouteHelper&amp;lt;/code&amp;gt; provides methods that find the most suitable menu item for a given piece of data to be displayed, while the router analyzes the menu item and puts any information that is not determined by the menu item&#039;s configuration into the route. This does mean that the &#039;&#039;calling code&#039;&#039; must explicitly call the helper&#039;s method before routing (&amp;lt;code&amp;gt;echo JRoute::_(DogsRouteHelper::getDogRoute(21));&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
There is a useful thread on this subject here: [[jtopic:148632]] (note, may be out of date)&lt;br /&gt;
&lt;br /&gt;
For details on the internals of routing, see [[Routing implementation details]].&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Tutorials]][[Category:Component Development]][[Category:Search Engine Friendly URLs]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J2.5:Supporting_SEF_URLs_in_your_component&amp;diff=125173</id>
		<title>J2.5:Supporting SEF URLs in your component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J2.5:Supporting_SEF_URLs_in_your_component&amp;diff=125173"/>
		<updated>2014-08-26T15:13:22Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Adjusted code style&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|2.5,3.1}}&lt;br /&gt;
{{:Search Engine Friendly URLs}}&lt;br /&gt;
In Joomla!, each [[component]] is responsible for handling its own SEF URLs. Therefore, as the [[Developers|developer]] of a component, you will have to create your own &#039;&#039;&#039;router&#039;&#039;&#039; to allow your component to use SEF URLs.&lt;br /&gt;
&lt;br /&gt;
== The Concept ==&lt;br /&gt;
&lt;br /&gt;
Assuming you are following standard development practices, your component is probably using &amp;quot;system URLs&amp;quot; that look a lot like &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_yourcomponent&amp;amp;view=article&amp;amp;id=1&amp;amp;catid=20&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;, and your goal is to transform this into &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;. As the developer, you have two tasks: signalling the system that certain pieces of text are URLs and need to be transformed, and explaining the system how to transform URLs.&lt;br /&gt;
&lt;br /&gt;
=== Applying &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
It is difficult and inefficient for Joomla! to figure out which parts of your component&#039;s output are URLs. To support SEF URLs, you will need to change URL-generating code so that it applies &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; before outputting the URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
echo JRoute::_(&#039;index.php?view=article&amp;amp;id=1&amp;amp;catid=20&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that it is possible to leave out the parameters &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; defaults to the name of the component currently being executed, and &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt; defaults to the current menu item&#039;s ID.&lt;br /&gt;
&lt;br /&gt;
In general, you should only apply this to URLs that users and/or search engines are able to see. For example, there is no need to transform URLs used in redirects that immediately result in other redirects.&lt;br /&gt;
&lt;br /&gt;
If the user turns off SEF URLs in the site&#039;s settings, &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; will produce working non-SEF URLs without any changes to the code.&lt;br /&gt;
&lt;br /&gt;
=== Writing a router ===&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also need to write a router, which is a single file with two functions that convert system URLs to and from SEF URLs. This file needs to be placed at &amp;lt;tt&amp;gt;/components/com_yourcomponent/router.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The first function, &amp;lt;code&amp;gt;[componentname]BuildRoute(&amp;amp;$query)&amp;lt;/code&amp;gt;, must transform an array of URL parameters into an array of segments that will form the SEF URL. Schematically, the transformation works as follows:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_yourcomponent&amp;amp;view=article&amp;amp;id=1&amp;amp;catid=20&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt;, called by your component or any other extension&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$query = array(&#039;view&#039; =&amp;gt; &#039;article&#039;, &#039;id&#039; =&amp;gt; 1, &#039;catid&#039; =&amp;gt; 20)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Your router&#039;s &amp;lt;code&amp;gt;com_yourcomponentBuildRoute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$segments = array(20, 1);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Joomla&#039;s internal route building (for display)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second function, &amp;lt;code&amp;gt;[componentname]ParseRoute($segments)&amp;lt;/code&amp;gt;, must transform an array of segments back into an array of URL parameters. Schematically:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Joomla&#039;s internal route parsing&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$segments = array(20, 1);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Your router&#039;s &amp;lt;code&amp;gt;com_yourcomponentParseRoute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$query = array(&#039;view&#039; =&amp;gt; &#039;article&#039;, &#039;id&#039; =&amp;gt; 1, &#039;catid&#039; =&amp;gt; 20)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two functions must cooperate in such a way that the original URL can be reconstructed. You can think of &amp;lt;code&amp;gt;BuildRoute&amp;lt;/code&amp;gt; as a form of [[wikipedia:Encoding|encoding]] and &amp;lt;code&amp;gt;ParseRoute&amp;lt;/code&amp;gt; as the corresponding decoding. When the original URL isn&#039;t properly reproduced, your component will stop working.&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Data for Routing ==&lt;br /&gt;
&lt;br /&gt;
=== The Alias ===&lt;br /&gt;
&lt;br /&gt;
The first step is the generation of the so called alias. The alias is used in the URL instead of the title (the alias is the text you want to have in the URL). The alias has to be URI safe, which means accented UTF­8 characters are replaced by their ASCII­7 equivalents, white spaces by hyphens, etc.&lt;br /&gt;
&lt;br /&gt;
The alias can be defined by the user, but you should ensure that the above requirements for a URL safe alias are met. A good way to do so is to use the JTable::check() method during the save process. Have a look at this example code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function check()&lt;br /&gt;
{&lt;br /&gt;
    jimport(&#039;joomla.filter.output&#039;);&lt;br /&gt;
    if (empty($this-&amp;gt;alias))&lt;br /&gt;
    {&lt;br /&gt;
	    $this-&amp;gt;alias = $this-&amp;gt;title;&lt;br /&gt;
    }&lt;br /&gt;
    $this-&amp;gt;alias = JFilterOutput::stringURLSafe($this-&amp;gt;alias);&lt;br /&gt;
&lt;br /&gt;
    /* All your other checks */&lt;br /&gt;
    return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the alias field is empty the title will be used as alias. Then the alias will be made URLSafe using the &amp;lt;code&amp;gt;JFilterOutput::stringURLSafe()&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
=== The Slug ===&lt;br /&gt;
&lt;br /&gt;
Continuing with the same example, the &amp;quot;slug&amp;quot; - &amp;quot;1­:welcome­-to­-joomla&amp;quot; has two parts. The first part is the article identifier (id) and the second is the alias. They are separated by a colon. These two elements were combined during the database query in the model:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$query = &#039;SELECT a.*, &#039;.&lt;br /&gt;
         &#039;CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(&amp;quot;:&amp;quot;, a.id, a.alias) ELSE a.id END as slug,&#039;&lt;br /&gt;
         /*...*/;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this step the slug is used instead of the id.&lt;br /&gt;
&lt;br /&gt;
== Routing URLs ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; method translates the internal Joomla! URL to a custom URL. &amp;lt;tt&amp;gt;JRoute&amp;lt;/tt&amp;gt; has three parameters and its prototype is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;JRoute::_($url, $xhtml = true, $ssl = null);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;$url&amp;lt;/code&amp;gt; is a string containing the absolute or relative internal Joomla! URL.&lt;br /&gt;
* &amp;lt;code&amp;gt;$xhtml&amp;lt;/code&amp;gt; is a boolean value that specifies whether or not the output should be in XHTML. This parameter is optional and if omitted defaults to true.&lt;br /&gt;
* &amp;lt;code&amp;gt;$ssl&amp;lt;/code&amp;gt; is an integer value that specifies whether the URI should be secure. It should be set to 1 to force the URI to be secure using the global secure site URI, 0 to leave it in the same state as when it was passed, and -1 to force the URI to be unsecure using the global unsecure site URI.&lt;br /&gt;
&lt;br /&gt;
The most important parameter is &amp;lt;code&amp;gt;$url&amp;lt;/code&amp;gt;. A call to this method might look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;JRoute::_(&#039;index.php?view=article&amp;amp;id=&#039; . $row-&amp;gt;slug);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$row-­&amp;gt;slug&amp;lt;/code&amp;gt; is the value that was generated in step 2 from a combination of id and title alias.&lt;br /&gt;
&lt;br /&gt;
Another advantage of using JRoute is that the router now handles $option (the component name) and the $Itemid (the menu item ID). The component itself doesn’t have to know its name ($option) or the active menu item ($Itemid) like it did in previous version of Joomla!.&lt;br /&gt;
&lt;br /&gt;
It is important that you think about the sequence of the URL parameter in this stage. This will be more clear when we have a deeper look at the router.php in the next section.&lt;br /&gt;
&lt;br /&gt;
The building process of JRouter is divided into two steps:&lt;br /&gt;
&lt;br /&gt;
* Create the application route. The application route is fully handled by JRouter and the component developer doesn’t have to do anything to make it work.&lt;br /&gt;
* Create the component route. To create the component route, JRouter looks for the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; in the component directory which is responsible for building the route for the component.&lt;br /&gt;
&lt;br /&gt;
== The Component Router ==&lt;br /&gt;
&lt;br /&gt;
We will have two functions in the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt;. One is responsible for building the URL and the other is responsible for parsing it. In the next examples, a very basic and a more advanced one, we assume that we have three views that links can point to. The first is a categories overview (&amp;lt;code&amp;gt;view=categories&amp;lt;/code&amp;gt;), the second is a single category (&amp;lt;code&amp;gt;view=category&amp;lt;/code&amp;gt;) and the third is a single article (&amp;lt;code&amp;gt;view=article&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The file &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; should be in the site area of your component. It is not used on admin/backend pages. Don&#039;t forget to add it to your XML [[Manifest files|manifest file]] in the site folder.&lt;br /&gt;
&lt;br /&gt;
=== A Simple Example ===&lt;br /&gt;
&lt;br /&gt;
This simple example will illustrate the basics of implementing a router for your component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]BuildRoute(&amp;amp;$query)&lt;br /&gt;
{&lt;br /&gt;
       $segments = array();&lt;br /&gt;
       if (isset($query[&#039;view&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;view&#039;];&lt;br /&gt;
                unset($query[&#039;view&#039;]);&lt;br /&gt;
       }&lt;br /&gt;
       if (isset($query[&#039;id&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;id&#039;];&lt;br /&gt;
                unset($query[&#039;id&#039;]);&lt;br /&gt;
       };&lt;br /&gt;
       return $segments;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; passes a $query array to the &amp;lt;code&amp;gt;[&#039;&#039;componentname&#039;&#039;]BuildRoute&amp;lt;/code&amp;gt; function. This function will add the relevant parts of the array to the $segments array in the right order and will return the properly ordered array. The content of the &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array needs to be unset, otherwise &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; will add it to the URL in the form of a query string (i.e. any variables that are not handled by the router will be passed in the query string).&lt;br /&gt;
&lt;br /&gt;
The prefix &#039;&#039;componentname&#039;&#039; is the name for your component, as found in the directory holding the component&#039;s files. For instance, a component &amp;quot;Magic&amp;quot; in directory &amp;lt;tt&amp;gt;/components/com_magic/...&amp;lt;/tt&amp;gt; would use a prefix &amp;lt;code&amp;gt;magic&amp;lt;/code&amp;gt; (all lower case).&lt;br /&gt;
&lt;br /&gt;
The next function in the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; parses the URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]ParseRoute($segments)&lt;br /&gt;
{&lt;br /&gt;
       $vars = array();&lt;br /&gt;
       switch($segments[0])&lt;br /&gt;
       {&lt;br /&gt;
               case &#039;categories&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;categories&#039;;&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;category&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;category&#039;;&lt;br /&gt;
                       $id = explode(&#039;:&#039;, $segments[1]);&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;article&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       $id = explode(&#039;:&#039;, $segments[1]);&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
       }&lt;br /&gt;
       return $vars;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What happens here? In the function &amp;lt;code&amp;gt;[&#039;&#039;componentname&#039;&#039;]BuildRoute&amp;lt;/code&amp;gt; we arranged the items in the &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array in a specific sequence. This means that in this example the view is first and the id is second in the array.&lt;br /&gt;
&lt;br /&gt;
By reading &amp;lt;code&amp;gt;$segments[0]&amp;lt;/code&amp;gt;, we access the name of the view. We set the right view and/or identifier depending on its value and we return the &amp;lt;code&amp;gt;$vars&amp;lt;/code&amp;gt; array to &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt;. $vars should be an associative array similar to the array that was passed to the BuildRoute method.&lt;br /&gt;
&lt;br /&gt;
The above example of the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; is a very simple way to generate SEF URLs but should show how this works quite clearly.&lt;br /&gt;
&lt;br /&gt;
The generated URL in this example contains the name of the view and doesn&#039;t reflect the content hierarchy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[view]/[slug]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A More Advanced Example ===&lt;br /&gt;
&lt;br /&gt;
In the next example we will try to get rid of the need for the view and we will try to reflect the current hierarchy level in the URL.&lt;br /&gt;
&lt;br /&gt;
The goal is URL&#039;s that look like:&lt;br /&gt;
&lt;br /&gt;
* When viewing an article: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[category]/[article]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* When viewing a category: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[category]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* When viewing the categories overview: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have done step 1 and 2 also for the category.&lt;br /&gt;
&lt;br /&gt;
The link to the article would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JRoute::_(&#039;index.php?view=article&amp;amp;catid=&#039; . $row-­&amp;gt;catslug . &#039;&amp;amp;id=&#039;.$row-­&amp;gt;slug);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the Link to the category would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JRoute::_(&#039;index.php?view=category&amp;amp;id=&#039; . $row-&amp;gt;catslug);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function [componentname]BuildRoute(&amp;amp;$query)&lt;br /&gt;
{&lt;br /&gt;
       $segments = array();&lt;br /&gt;
       if (isset($query[&#039;catid&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;catid&#039;];&lt;br /&gt;
                unset($query[&#039;catid&#039;]);&lt;br /&gt;
       };&lt;br /&gt;
       if (isset($query[&#039;id&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;id&#039;];&lt;br /&gt;
                unset($query[&#039;id&#039;]);&lt;br /&gt;
       };&lt;br /&gt;
       unset($query[&#039;view&#039;]);&lt;br /&gt;
       return $segments;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The difference now is that we don’t add the name of the view to the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array. We still unset the view key since otherwise, &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; would add it to the URL as part of the query string. Another new thing here is the additional parameter catid that we push into the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]ParseRoute($segments)&lt;br /&gt;
{&lt;br /&gt;
       $vars = array();&lt;br /&gt;
       $app = JFactory::getApplication();&lt;br /&gt;
       $menu = $app-&amp;gt;getMenu();&lt;br /&gt;
       $item = $menu-&amp;gt;getActive();&lt;br /&gt;
       // Count segments&lt;br /&gt;
       $count = count($segments);&lt;br /&gt;
       // Handle View and Identifier&lt;br /&gt;
       switch ($item-&amp;gt;query[&#039;view&#039;])&lt;br /&gt;
       {&lt;br /&gt;
               case &#039;categories&#039;:&lt;br /&gt;
                       if ($count == 1)&lt;br /&gt;
                       {&lt;br /&gt;
                               $vars[&#039;view&#039;] = &#039;category&#039;;&lt;br /&gt;
                       }&lt;br /&gt;
                       if ($count == 2)&lt;br /&gt;
                       {&lt;br /&gt;
                               $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       }&lt;br /&gt;
                       $id = explode(&#039;:&#039;, $segments[$count-1]);&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;category&#039;:&lt;br /&gt;
                       $id = explode(&#039;:&#039;, $segments[$count-1]);&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       break;&lt;br /&gt;
       }&lt;br /&gt;
       return $vars;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this ParseRoute function has a lot of different code parts in comparison to the previous. The reason for this is simple. We don’t have the name of the view in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array and we need to find another way to determine it.&lt;br /&gt;
&lt;br /&gt;
We need to find out which level of hierarchy we are in by receiving the root element. We do this by looking to the view name of the active menu item:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$item-­&amp;gt;query[&#039;view&#039;]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also we need to know the number of items in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$count = count($segments);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this information we can correctly set the view for all possible three cases:&lt;br /&gt;
&lt;br /&gt;
* The menu item is a link to the categories view and the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array has two items (&amp;lt;code&amp;gt;$catid&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt;). In this case we know that we need to parse a link to an article.&lt;br /&gt;
* The menu item is a link to the categories view and the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array has one item (&amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt;). In this case we know that we need to parse a link to a category.&lt;br /&gt;
* The menu item is a link to a category. In this case, we know that any item in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array is the identifier for an article.&lt;br /&gt;
&lt;br /&gt;
The result of all this code is clean and human-readable component URLs.&lt;br /&gt;
&lt;br /&gt;
== Routers and Menu Items ==&lt;br /&gt;
&lt;br /&gt;
A last important part of creating a router is considering what to do with menu items. As explained on [[Search Engine Friendly URLs]], the output of the component router is used &#039;&#039;after&#039;&#039; the first segment of a route, the first segment being the menu item&#039;s alias. This creates a difficult question: how is your router and/or other code to know which menu item to route through?&lt;br /&gt;
&lt;br /&gt;
Suppose, for example, that your component is currently producing output for the page &amp;lt;tt&amp;gt;/dogs&amp;lt;/tt&amp;gt;, which lists all dogs in the system. Of course, the items in the list need to be links to pages that display more details about one dog. What should the URL to the dog with ID 21 and name Fido become? Using a router that works according to the principles we&#039;ve seen so far, the route that is produced is &amp;lt;tt&amp;gt;dogs/21-fido&amp;lt;/tt&amp;gt;, or with some additional work &amp;lt;tt&amp;gt;/dogs/fido&amp;lt;/tt&amp;gt;. But perhaps the user has created a menu item with the alias &amp;lt;tt&amp;gt;mydoggy&amp;lt;/tt&amp;gt; which displays exactly that dog&#039;s details. Then it is probably the user&#039;s intention to route this URL through that menu item, and the item in the list should link to the page &amp;lt;tt&amp;gt;/mydoggy&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
More generally, whenever you are building a route, you will need to find the menu item that is most suitable as a &#039;&#039;starting point&#039;&#039; for building your route. The term &#039;&#039;starting point&#039;&#039; is emphasized because the rest of the route depends on the configuration of the menu item. In our example above, &amp;lt;tt&amp;gt;/dogs/21-fido&amp;lt;/tt&amp;gt; is an acceptable route, &amp;lt;tt&amp;gt;/mydoggy&amp;lt;/tt&amp;gt; is arguably even better, but &amp;lt;tt&amp;gt;/mydoggy/21-fido&amp;lt;/tt&amp;gt; is simply wrong, since &amp;lt;tt&amp;gt;/mydoggy&amp;lt;/tt&amp;gt; is in itself a menu item that is set up to display &amp;lt;tt&amp;gt;fido&amp;lt;/tt&amp;gt;&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Several approaches are available to tackle this problem. Joomla!&#039;s core components take a mixed approach, separating responsibilities in two units of code: the router itself and the so-called &amp;lt;code&amp;gt;[componentname]RouteHelper&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;[componentname]RouteHelper&amp;lt;/code&amp;gt; provides methods that find the most suitable menu item for a given piece of data to be displayed, while the router analyzes the menu item and puts any information that is not determined by the menu item&#039;s configuration into the route. This does mean that the &#039;&#039;calling code&#039;&#039; must explicitly call the helper&#039;s method before routing (&amp;lt;code&amp;gt;echo JRoute::_(DogsRouteHelper::getDogRoute(21));&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
There is a useful thread on this subject here: [[jtopic:148632]] (note, may be out of date)&lt;br /&gt;
&lt;br /&gt;
For details on the internals of routing, see [[Routing implementation details]].&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Tutorials]][[Category:Component Development]][[Category:Search Engine Friendly URLs]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Manifest_files&amp;diff=121920</id>
		<title>Manifest files</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Manifest_files&amp;diff=121920"/>
		<updated>2014-07-07T22:54:25Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Fixed layout&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 [[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 [[Component|components]] apply to both the [[Site (Application)|site]] and the [[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;
&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;menu link=&amp;quot;anoption=avalue&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;
&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;
{{Needsinfo|In Platform 11.1 no alt attribute processed and if link provide in menu tag other provided attributes were ignore. The other tags are task, view, controller, act, layout, sub. Please confirm this, please.}}&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 folder=&amp;quot;admin&amp;quot;&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 folder=&amp;quot;admin&amp;quot;&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;quot;admin/sql&amp;quot; folder of the installation package. You have to include the &amp;quot;sql&amp;quot; folder in the administration files.&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;IntallerScript&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;
&lt;br /&gt;
[[Category:Extension development]]&lt;br /&gt;
[[Category:Specifications]]&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Framework:Home&amp;diff=100362</id>
		<title>Framework:Home</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Framework:Home&amp;diff=100362"/>
		<updated>2013-06-15T15:54:48Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: /* What is the Joomla Framework ? */ Fixed links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:{{FULLPAGENAME}}/header}}__NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:auto; vertical-align:top; background-color:#fff; margin:5px 0 10px 0; padding:8px;  box-shadow: 1px 1px 8px #000;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; padding-left:15px;&amp;quot;&amp;gt;&amp;lt;markdown&amp;gt;&lt;br /&gt;
[![Build Status](https://travis-ci.org/joomla/joomla-framework.png?branch=master)](https://travis-ci.org/joomla/joomla-framework)&lt;br /&gt;
&amp;lt;/markdown&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
== What is the Joomla Framework ? ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;Joomla Framework&amp;lt;/code&amp;gt; is a platform for writing web and command line applications in PHP. It is free and open source software, distributed under the GNU General Public License version 2 or later.&lt;br /&gt;
&lt;br /&gt;
It is comprises code originally developed for the Joomla Content Management System (CMS). For more information about the Joomla CMS visit http://www.joomla.org/about-joomla.html.&lt;br /&gt;
&lt;br /&gt;
For news and information about developering with Joomla, please visit http://developer.joomla.org.&lt;br /&gt;
&lt;br /&gt;
View the Joomla Framework API Documentation at http://joomla.github.io/joomla-framework. Powered by [http://www.phpdoc.org phpDocumentor 2].&lt;br /&gt;
&lt;br /&gt;
You can discuss Joomla Framework development by joining the mailing list at http://groups.google.com/group/joomla-dev-framework.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* PHP 5.3.10&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
=== Via Composer ===&lt;br /&gt;
&lt;br /&gt;
* Create a project and add a &amp;lt;code&amp;gt;composer.json&amp;lt;/code&amp;gt; file to it with the content :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
    &amp;quot;require&amp;quot;: {&lt;br /&gt;
        &amp;quot;joomla/joomla-framework&amp;quot;: &amp;quot;dev-master&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Download Composer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;curl -sS &amp;lt;nowiki&amp;gt;https://getcomposer.org/installer&amp;lt;/nowiki&amp;gt; | php&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Install the Joomla Framework&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;php composer.phar install&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Via Git ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;git clone git://github.com/joomla/joomla-framework.git&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
General documentation about the Joomla Platform can be found under the [https://github.com/joomla/joomla-framework/tree/master/docs /docs] folder of the Git repository. In addition, each package has documentation in a &amp;lt;code&amp;gt;README.md&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
== Reporting Bugs and Issue ==&lt;br /&gt;
&lt;br /&gt;
Bugs and issues found in the Joomla Framework code can be reported on the [https://github.com/joomla/joomla-framework/issues Issues] list.&lt;br /&gt;
&lt;br /&gt;
== Contributing ==&lt;br /&gt;
&lt;br /&gt;
All kind of contributions are welcome. Please read about how to contribute [https://github.com/joomla/joomla-framework/blob/master/CONTRIBUTING.markdown here].&lt;br /&gt;
&lt;br /&gt;
You may find tasks you can do on the [https://github.com/joomla/joomla-framework/issues Issues] list by filtering on labels and milestones&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
[[Category:Joomla! Framework]]&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Chunk:Platform&amp;diff=100349</id>
		<title>Chunk:Platform</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Chunk:Platform&amp;diff=100349"/>
		<updated>2013-06-14T23:37:13Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Cleaned up&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{chunk}}&amp;lt;/noinclude&amp;gt;__NOTOC__&lt;br /&gt;
&amp;lt;blockquote style=&amp;quot;width:auto; border:1px solid grey; background-color:cornsilk; padding:5px; font-style:italic;&amp;quot;&amp;gt;The Joomla Platform is a platform for writing Web and command line applications in PHP. It is free and open source software, distributed under the GNU General Public License version 2 or later. The Joomla Content Management System (CMS) is built on top of the Joomla Platform.&amp;lt;ref&amp;gt;https://github.com/joomla/joomla-platform&amp;lt;/ref&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Architecture Joomla Platform.png|frame|400px|The Joomla! Platform]]&lt;br /&gt;
&lt;br /&gt;
As of 24 April 2013, the Platform project has been retired. The Platform has been merged back into the [[CMS]], and the [[Framework]] has taken its place as the standalone application framework for Joomla! applications.&amp;lt;ref&amp;gt;[https://github.com/joomla/joomla-platform/blob/84014ad35b0d6294a43fcd2745aecb130849ed9e/CONTRIBUTING.markdown CONTRIBUTING.markdown]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;https://groups.google.com/d/msg/joomla-dev-platform/zzNrsCUKCts/hsBntnONm9MJ&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The release of the Joomla Platform on 5 July 2011&amp;lt;ref&amp;gt;http://developer.joomla.org/code/cms/history/2010/12/02.html&amp;lt;/ref&amp;gt; marked an important change in the Joomla! CMS architecture. The Joomla! CMS was initially a monolithic application. One of the aims of the Joomla! project was to separate the codebase into the CMS and an underlying library, which could then be reused for other projects. In version 1.5 and 1.6, that separation was prepared by creating a division between the [[Framework (CMS 1.5 and 1.6)]] &#039;&#039;(which is unrelated to the new [[Framework]] project)&#039;&#039; and the Joomla! [[CMS]] Application. The Joomla! Platform project continued this effort by separating that framework into an independent project (both in terms of code and organization). The Joomla! Platform is an independent set of libraries which do not depend on the Joomla! CMS Application. These libraries are made up of libraries maintained by the Joomla! Project and libraries maintained by other 3rd party developers. The Platform could be used for web and command-line applications entirely independent of and unrelated to the CMS.&lt;br /&gt;
&lt;br /&gt;
The home of the Joomla! Platform was [https://github.com/joomla/joomla-platform the &#039;&#039;joomla/joomla-platform&#039;&#039; GitHub repository] that contains the source and documentation. The Platform stopped accepting contributions on or before 24 April 2013.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&amp;lt;references/&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Framework_(CMS_1.5_and_1.6)&amp;diff=100307</id>
		<title>Framework (CMS 1.5 and 1.6)</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Framework_(CMS_1.5_and_1.6)&amp;diff=100307"/>
		<updated>2013-06-14T16:46:38Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Adjusted link after page move&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Chunk:Framework quote}}&lt;br /&gt;
{{Chunk:Framework (CMS 1.5 and 1.6)}}&lt;br /&gt;
== API Reference ==&lt;br /&gt;
&lt;br /&gt;
On this page we&#039;d like to provide you a way to reference of all classes and respective methods. Use the links below to navigate to further information about framework versions or the version classes which include, where possible, examples of use.&lt;br /&gt;
&lt;br /&gt;
If you would like to help us improve this resource, please read about the [[API Reference Project]].&lt;br /&gt;
&lt;br /&gt;
{{Navbox&lt;br /&gt;
|state=off&lt;br /&gt;
|navbar=off&lt;br /&gt;
|title=API documentation is available in the following &#039;&#039;&#039;Joomla! Framework Versions&#039;&#039;&#039;&lt;br /&gt;
|titlestyle=font-weight:normal; padding:5px;&lt;br /&gt;
|image=[[File:Joomla vert logo.png|120px]]&lt;br /&gt;
|group1= Select a framework version&lt;br /&gt;
|group2= See also&lt;br /&gt;
|group1style=font-size:1.1em; width:18%;&lt;br /&gt;
|list1=&lt;br /&gt;
* [[API15:Framework|Framework]] {{JVer|1.5}}&lt;br /&gt;
* [[API16:Framework|Framework]] {{JVer|1.6}}&lt;br /&gt;
|list2=&lt;br /&gt;
* [[API17:Platform|Platform]] {{JVer|11.1}}&lt;br /&gt;
|list1style=padding-left:10px; font-size:1.2em;&lt;br /&gt;
|list2style=padding-left:10px; font-size:1.2em;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
=== Further Reading ===&lt;br /&gt;
*[[Joomla! Framework vs Joomla! Platform]]&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Framework]][[Category:Subpackages]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Joomla!_Framework_(CMS_1.5_and_1.6)_vs_Joomla!_Platform&amp;diff=100306</id>
		<title>Joomla! Framework (CMS 1.5 and 1.6) vs Joomla! Platform</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Joomla!_Framework_(CMS_1.5_and_1.6)_vs_Joomla!_Platform&amp;diff=100306"/>
		<updated>2013-06-14T16:28:07Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Updated contents&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{notice|This page discusses the differences between the Framework in the 1.5 and 1.6 versions of the Joomla CMS and the now-retired Joomla Platform. For information about the Joomla Framework project, see [[Framework]].}}&lt;br /&gt;
&lt;br /&gt;
== Framework (CMS 1.5 and 1.6) ==&lt;br /&gt;
{{Chunk:Framework (CMS 1.5 and 1.6)}}&lt;br /&gt;
== Introduction to Platform ==&lt;br /&gt;
{{Chunk:Platform}}&lt;br /&gt;
== Differences ==&lt;br /&gt;
The Joomla! Platform can now be used to build other CMS Applications or Web and command line Applications specific to a developer&#039;s needs such as eCommerce, Social Media, and other stand alone Applications. The Platform is stored on GitHub, which allows developers to easily fork the Platform code for their own purposes, and then if they want, integrate it into the main code branch. This will encourage more developers and even attract larger corporations to contribute to the Joomla! Platform who might not have done so before.&amp;lt;ref&amp;gt;http://magazine.joomla.org/issues/Issue-Dec-2011/item/616-Write-your-own-App-using-Joomla-Platform?tmpl=component&amp;amp;print=1&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Another good thing about the separation of the the Joomla! Platform it has a release schedule of every 3 months which allows for a faster integration of core features used by extension developers. The version number is determined by the the year of its release. For example, Joomla! Platform 11.1 was released in 2011 and 12.1 was released in 2012.&amp;lt;ref&amp;gt;http://magazine.joomla.org/issues/Issue-Dec-2011/item/616-Write-your-own-App-using-Joomla-Platform?tmpl=component&amp;amp;print=1&amp;lt;/ref&amp;gt;&lt;br /&gt;
== See also and References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Platform]][[Category:Framework]][[Category:Frameworks and Platforms]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Joomla!_Framework_vs_Joomla!_Platform&amp;diff=100305</id>
		<title>Joomla! Framework vs Joomla! Platform</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Joomla!_Framework_vs_Joomla!_Platform&amp;diff=100305"/>
		<updated>2013-06-14T16:24:16Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Mvangeest moved page Joomla! Framework vs Joomla! Platform to Joomla! Framework (CMS 1.5 and 1.6) vs Joomla! Platform: The name Framework has been reused for the new Joomla Framework project&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Joomla! Framework (CMS 1.5 and 1.6) vs Joomla! Platform]]&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Joomla!_Framework_(CMS_1.5_and_1.6)_vs_Joomla!_Platform&amp;diff=100304</id>
		<title>Joomla! Framework (CMS 1.5 and 1.6) vs Joomla! Platform</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Joomla!_Framework_(CMS_1.5_and_1.6)_vs_Joomla!_Platform&amp;diff=100304"/>
		<updated>2013-06-14T16:24:16Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Mvangeest moved page Joomla! Framework vs Joomla! Platform to Joomla! Framework (CMS 1.5 and 1.6) vs Joomla! Platform: The name Framework has been reused for the new Joomla Framework project&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
== Framework ==&lt;br /&gt;
{{Chunk:Framework (CMS 1.5 and 1.6)}}&lt;br /&gt;
== Introduction to Platform ==&lt;br /&gt;
{{Chunk:Platform}}&lt;br /&gt;
== Differences ==&lt;br /&gt;
The Joomla! Platform can now be used to build other CMS Applications or Web and command line Applications specific to a developer&#039;s needs such as eCommerce, Social Media, and other stand alone Applications. The Platform is stored on GitHub, which allows developers to easily fork the Platform code for their own purposes, and then if they want, integrate it into the main code branch. This will encourage more developers and even attract larger corporations to contribute to the Joomla! Platform who might not have done so before.&amp;lt;ref&amp;gt;http://magazine.joomla.org/issues/Issue-Dec-2011/item/616-Write-your-own-App-using-Joomla-Platform?tmpl=component&amp;amp;print=1&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Another good thing about the separation of the the Joomla! Platform it has a release schedule of every 3 months which allows for a faster integration of core features used by extension developers. The version number is determined by the the year of its release. For example, Joomla! Platform 11.1 was released in 2011 and 12.1 was released in 2012.&amp;lt;ref&amp;gt;http://magazine.joomla.org/issues/Issue-Dec-2011/item/616-Write-your-own-App-using-Joomla-Platform?tmpl=component&amp;amp;print=1&amp;lt;/ref&amp;gt;&lt;br /&gt;
== See also and References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Platform]][[Category:Framework]][[Category:Frameworks and Platforms]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Chunk:Framework&amp;diff=100303</id>
		<title>Chunk:Framework</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Chunk:Framework&amp;diff=100303"/>
		<updated>2013-06-14T16:14:48Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Added link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{chunk}}&amp;lt;/noinclude&amp;gt;__NOTOC__&lt;br /&gt;
The Joomla Framework is a platform for writing web and command line applications in PHP.  It is free and open source software, distributed under the GNU General Public License version 2 or later.&amp;lt;ref&amp;gt;https://github.com/joomla/joomla-framework/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Framework comprises code originally developed for the Joomla [[Content Management System]] and is a continuation of the [[Platform]] project. The Joomla Framework and the Joomla CMS are separate projects with separate development teams. Unlike the Platform, the Framework is not primarily intended as a platform for the Joomla CMS, and the Joomla CMS is not currently built on the Framework. More information about the differences between the Platform and the Framework can be found in [http://magazine.joomla.org/issues/issue-mar-2013/item/1136-differences-between-the-joomla-framework-and-joomla-platform the March 2013 edition of the Joomla Community Magazine].&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&amp;lt;references/&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Chunk:Platform&amp;diff=100301</id>
		<title>Chunk:Platform</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Chunk:Platform&amp;diff=100301"/>
		<updated>2013-06-14T15:36:53Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Fixed layout, hopefully&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{chunk}}&amp;lt;/noinclude&amp;gt;__NOTOC__&lt;br /&gt;
&amp;lt;blockquote style=&amp;quot;width:auto; border:1px solid grey; background-color:cornsilk; padding:5px; font-style:italic;&amp;quot;&amp;gt;The Joomla Platform is a platform for writing Web and command line applications in PHP. It is free and open source software, distributed under the GNU General Public License version 2 or later. The Joomla Content Management System (CMS) is built on top of the Joomla Platform.&amp;lt;ref&amp;gt;https://github.com/joomla/joomla-platform&amp;lt;/ref&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Architecture Joomla Platform.png|frame|400px|The Joomla! Platform]]&lt;br /&gt;
&lt;br /&gt;
As of 24 April 2013, the Platform project has been retired. The Platform has been merged back into the [[CMS]] (see also http://github.com/joomla/joomla-cms), and the [[Framework]] (see also http://github.com/joomla/joomla-framework) has taken its place as the standalone application framework for Joomla! applications.&amp;lt;ref&amp;gt;[https://github.com/joomla/joomla-platform/blob/84014ad35b0d6294a43fcd2745aecb130849ed9e/CONTRIBUTING.markdown CONTRIBUTING.markdown]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;https://groups.google.com/d/msg/joomla-dev-platform/zzNrsCUKCts/hsBntnONm9MJ&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The release of the Joomla Platform on 5 July 2011&amp;lt;ref&amp;gt;http://developer.joomla.org/code/cms/history/2010/12/02.html&amp;lt;/ref&amp;gt; marked an important change in the Joomla! CMS architecture. The Joomla! CMS was initially a monolithic application. One of the aims of the Joomla! project was to separate the codebase into the CMS and an underlying library, which could then be reused for other projects. In version 1.5 and 1.6, that separation was prepared by creating a division between the [[Framework (CMS 1.5 and 1.6)]] &#039;&#039;(which is unrelated to the new [[Framework]] project)&#039;&#039; and the Joomla! [[CMS]] Application. The Joomla! Platform project continued this effort by separating that framework into an independent project (both in terms of code and organization). The Joomla! Platform is an independent set of libraries which do not depend on the Joomla! CMS Application. These libraries are made up of libraries maintained by the Joomla! Project and libraries maintained by other 3rd party developers. The Platform could be used for web and command-line applications entirely independent of and unrelated to the CMS.&lt;br /&gt;
&lt;br /&gt;
The home of the Joomla! Platform was [https://github.com/joomla/joomla-platform the &#039;&#039;joomla/joomla-platform&#039;&#039; GitHub repository] that contains the source and documentation. The Platform stopped accepting contributions on or before 24 April 2013.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&amp;lt;references/&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Main_Page&amp;diff=100300</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Main_Page&amp;diff=100300"/>
		<updated>2013-06-14T15:33:30Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: The Platform has been retired - updated references to the Framework&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot; style=&amp;quot;margin:0em 0em 1em 0em; width:100%;&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;1&amp;quot; style=&amp;quot;width:100%; vertical-align:top; border:1px solid #B356C1; background-color:#fff; -moz-border-radius:10px; border-radius:10px;&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color:#fff; padding:0.8em 1.1em 0 1.1em; margin:0 7px;&amp;quot;&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;span class=&amp;quot;mw-headline&amp;quot;&amp;gt;Joomla! Official Documentation&amp;lt;/span&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:1em 1em 1em 1em;&amp;quot;&amp;gt; &amp;lt;!--Note: Top, right, bottom, left --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot; style=&amp;quot;margin:0em 0em 1em 0em; width:100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;width:50%; vertical-align:top; border:1px solid #abd5f5; background-color: #fff;-moz-border-radius:10px; border-radius:10px;&amp;quot; rowspan=&amp;quot;1&amp;quot;|&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid abd5f5; background-color:#d0e5f5; padding:0.2em 0.5em 0.2em 0.5em; font-size:110%; font-weight:bold; -moz-border-radius:10px 10px 0 0;  border-radius:10px 10px 0 0;&amp;quot;&amp;gt;Reader profiles&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:0.4em 1em 0.3em 1em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- PICTURE ON LEFT OF TWO BOX SECTION --&amp;gt;&lt;br /&gt;
Find the profile that most accurately describes your role and you will find the documentation that you need more quickly.  These are the most frequent profiles...&lt;br /&gt;
* [[Beginners]]&lt;br /&gt;
* [[Developers]]&lt;br /&gt;
* [[Web designers]]&lt;br /&gt;
* [[Administrators]]&lt;br /&gt;
* [[Evaluators]]&lt;br /&gt;
* [[Joomla! Code Contributors]]&lt;br /&gt;
None of the above?  Then look for [[Start here|more user profiles]].&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;padding:0em 0.5em 0em 0.5em;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;width:30%; vertical-align:top; background-color: #fff;-moz-border-radius:10px;  border-radius:10px;&amp;quot; rowspan=&amp;quot;1&amp;quot;|&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid abd5f5; background-color:#fff; padding:0.2em 0.5em 0.2em 0.5em; font-size:110%; font-weight:bold;-moz-border-radius:10px 10px 0 0; border-radius:10px 10px 0 0;&amp;quot;&amp;gt;Quick links&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:0.4em 1em 0.3em 1em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- PICTURE ON LEFT OF TWO BOX SECTION --&amp;gt;&lt;br /&gt;
* [[:Category:FAQ|Frequently Asked Questions]]&lt;br /&gt;
* [[:Category:Tips and tricks|Tips and tricks]]&lt;br /&gt;
* [[Security Checklist|Joomla! Security Checklist]]&lt;br /&gt;
* [[Vulnerable Extensions List]]&lt;br /&gt;
* [[:Category:Top_Level|Browse all categories]]&lt;br /&gt;
* [[JDOC:Wiki policy|Wiki policy]]&lt;br /&gt;
* [[JEDL|Documentation license]]&lt;br /&gt;
* [[Framework:Home|Joomla! Framework]]&lt;br /&gt;
* [[Glossary]]&lt;br /&gt;
* [[References]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;padding:0em 0.5em 0em 0.5em;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;vertical-align:top; border:none; background-color:#fff;&amp;quot; |&lt;br /&gt;
&amp;lt;!-- PICTURE ON RIGHT OF TWO BOX SECTION--&amp;gt;&lt;br /&gt;
[[Image:documentation_all_together.jpg|border|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot; style=&amp;quot;margin:0em 0em 1em 0em; width:100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;width:50%; vertical-align:top; border:1px solid #abd5f5; background-color: #f1f5fc;-moz-border-radius:10px; border-radius:10px;&amp;quot; rowspan=&amp;quot;1&amp;quot;|&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid abd5f5; background-color:#d0e5f5; padding:0.2em 0.5em 0.2em 0.5em; font-size:110%; font-weight:bold;-moz-border-radius:10px 10px 0 0; border-radius:10px 10px 0 0;&amp;quot;&amp;gt;Getting started&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:0.4em 1em 0.3em 1em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- PICTURE ON LEFT OF TWO BOX SECTION --&amp;gt;&lt;br /&gt;
If you have only recently starting working with Joomla you will probably have experienced the pain of learning a new system.  New terminology, new ways of doing things, perhaps even the web itself may be new to you.  Then let these guides relieve some of that pain.&lt;br /&gt;
&lt;br /&gt;
* [[J3.1:Getting Started with Joomla!|Getting Started with Joomla! 3.x]] {{JVer|3.x}}&lt;br /&gt;
* [[Getting Started with Joomla!|Getting Started with Joomla! 2.5]] {{JVer|2.5}}&lt;br /&gt;
* [[J1.5:Getting Started with Joomla!|Getting Started with Joomla! 1.5]] {{JVer|1.5}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;padding:0em 0.5em 0em 0.5em;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;width:50%; vertical-align:top; border:1px solid Gold; background-color: LightYellow;-moz-border-radius:10px; border-radius:10px;&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid #Gold; background-color:#ffffaa; padding:0.2em 0.5em 0.2em 0.5em; font-size:110%; font-weight:bold;-moz-border-radius:10px 10px 0 0; border-radius:10px 10px 0 0;&amp;quot;&amp;gt;Important&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:0.4em 1em 0.3em 1em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- PICTURE ON RIGHT OF TWO BOX SECTION--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;You don&#039;t need to register here if you just want to read the documentation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You should only register if you want to make changes to the information contained here.  Also note that registration on this wiki is entirely separate from registration on our other sites, such as the [http://forum.joomla.org forum].&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot; style=&amp;quot;margin:0em 0em 1em 0em; width:100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;width:50%; vertical-align:top; border:1px solid #abd5f5; background-color: #f1f5fc;-moz-border-radius:10px; border-radius:10px;&amp;quot; rowspan=&amp;quot;1&amp;quot;|&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid abd5f5; background-color:#d0e5f5; padding:0.2em 0.5em 0.2em 0.5em; font-size:110%; font-weight:bold;-moz-border-radius:10px 10px 0 0;  border-radius:10px 10px 0 0;&amp;quot;&amp;gt;Coming soon&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:0.4em 1em 0.3em 1em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- PICTURE ON LEFT OF TWO BOX SECTION --&amp;gt;&lt;br /&gt;
With Joomla 2.5 safely released the focus of development is shifting to 3. Joomla 3.1 was released in April 2013.  This is the second of a new series (3.0/3.1/3.2/3.5) and maintaining backwards compatibility with 2.5 will not be required.&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Version 3.1 FAQ|Version 3.1 FAQs]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;padding:0em 0.5em 0em 0.5em;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;width:50%; vertical-align:top; border:1px solid Gold; background-color: LightYellow;-moz-border-radius:10px; border-radius:10px;&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid #Gold; background-color:#ffffaa; padding:0.2em 0.5em 0.2em 0.5em; font-size:110%; font-weight:bold;-moz-border-radius:10px 10px 0 0; border-radius:10px 10px 0 0;&amp;quot;&amp;gt;Joomla [[Framework]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:0.4em 1em 0.3em 1em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- PICTURE ON RIGHT OF TWO BOX SECTION--&amp;gt;&lt;br /&gt;
The Joomla Framework, a modern PHP application platform project independent of the CMS, is available.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/joomla/joomla-framework Joomla Framework on Github]&lt;br /&gt;
* [http://joomla.github.io/joomla-framework/ API documentation]&lt;br /&gt;
* [[Platform|The Platform, predecessor of the Framework]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot; style=&amp;quot;margin:0em 0em 1em 0em; width:100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;width:50%; vertical-align:top; border:1px solid #abd5f5; background-color: #f1f5fc;-moz-border-radius:10px; border-radius:10px;&amp;quot; rowspan=&amp;quot;1&amp;quot;|&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid abd5f5; background-color:#d0e5f5; padding:0.2em 0.5em 0.2em 0.5em; font-size:110%; font-weight:bold;-moz-border-radius:10px 10px 0 0; border-radius:10px 10px 0 0;&amp;quot;&amp;gt;Quick links for [[Administrators]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:0.4em 1em 0.3em 1em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- PICTURE ON LEFT OF TWO BOX SECTION --&amp;gt;&lt;br /&gt;
* [[Joomla Installation|Installation]]&lt;br /&gt;
* [[Template Management]]&lt;br /&gt;
* [[Article Management]]&lt;br /&gt;
* [[User Management|User and Access Management]]&lt;br /&gt;
* [[Menu Management]]&lt;br /&gt;
* [[Security]]&lt;br /&gt;
* [[Module Management]]&lt;br /&gt;
* [[Component Management]]&lt;br /&gt;
* [[Category Management]]&lt;br /&gt;
* [[Plugin Management]]&lt;br /&gt;
* [[Global Configuration Management]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;padding:0em 0.5em 0em 0.5em;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;width:50%; vertical-align:top; border:1px solid Gold; background-color: LightYellow;-moz-border-radius:10px; border-radius:10px;&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid #Gold; background-color:#ffffaa; padding:0.2em 0.5em 0.2em 0.5em; font-size:110%; font-weight:bold;-moz-border-radius:10px 10px 0 0; border-radius:10px 10px 0 0;&amp;quot;&amp;gt;{{JVer|{{CurrentLTSVer|minor}}}} Joomla! {{CurrentLTSVer|minor}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:0.4em 1em 0.3em 1em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- PICTURE ON RIGHT OF TWO BOX SECTION--&amp;gt;&lt;br /&gt;
Joomla! {{CurrentLTSVer|minor}} is the current [[Release and support cycle|LTS version]]. The previous LTS version, Joomla 1.5, is still widely used and will be supported with security fixes only until September 2012.&lt;br /&gt;
* [[J2.5:Upgrading_from_an_existing_version|Upgrading your site from 1.6/1.7 to 2.5]]&lt;br /&gt;
* [[J2.5:Migrating_from_Joomla_1.5_to_Joomla_2.5|Migrating your site from 1.5 to 2.5]]&lt;br /&gt;
* [[:Category:Version {{CurrentLTSVer}} FAQ|Version {{CurrentLTSVer}} FAQ]]&lt;br /&gt;
* [http://www.joomla.org/about-joomla/technical-requirements.html Technical Requirements]&lt;br /&gt;
* [[Installing Joomla!]]&lt;br /&gt;
&lt;br /&gt;
For more information see the [[:Category:Joomla! {{CurrentLTSVer|minor}}|Joomla {{CurrentLTSVer|minor}} category page]].&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot; style=&amp;quot;margin:0em 0em 1em 0em; width:100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;width:50%; vertical-align:top; border:1px solid #abd5f5; background-color: #f1f5fc;-moz-border-radius:10px; border-radius:10px;&amp;quot; rowspan=&amp;quot;1&amp;quot;|&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid abd5f5; background-color:#d0e5f5; padding:0.2em 0.5em 0.2em 0.5em; font-size:110%; font-weight:bold;-moz-border-radius:10px 10px 0 0; border-radius:10px 10px 0 0;&amp;quot;&amp;gt;Quick links for [[Developers]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:0.4em 1em 0.3em 1em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- PICTURE ON LEFT OF TWO BOX SECTION --&amp;gt;&lt;br /&gt;
* [http://api.joomla.org/ Platform API Documentation]&lt;br /&gt;
* [[Template Development|Templates]]&lt;br /&gt;
* [[Component Development|Components]]&lt;br /&gt;
* [[Module Development|Modules]]&lt;br /&gt;
* [[Language Development|Languages]]&lt;br /&gt;
* [[Plugin Development|Plugins]]&lt;br /&gt;
* [[CMS]] versus [[Platform]]&lt;br /&gt;
* [http://developer.joomla.org Joomla! Developer Portal]&lt;br /&gt;
* [[Portal:Bug_Squad|Joomal! Bug Squad members]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;padding:0em 0.5em 0em 0.5em;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;width:50%; vertical-align:top; border:1px solid Gold; background-color: LightYellow;-moz-border-radius:10px; border-radius:10px;&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid #Gold; background-color:#ffffaa; padding:0.2em 0.5em 0.2em 0.5em; font-size:110%; font-weight:bold;-moz-border-radius:10px 10px 0 0; border-radius:10px 10px 0 0;&amp;quot;&amp;gt;{{JVer|{{CurrentSTSVer|minor}}}} Joomla! {{CurrentSTSVer|minor}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:0.4em 1em 0.3em 1em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- PICTURE ON RIGHT OF TWO BOX SECTION--&amp;gt;&lt;br /&gt;
Joomla {{CurrentSTSVer|minor}} is the latest [[Release and support cycle|STS version]] after Joomla 2.5. Support for Joomla {{CurrentSTSVer|minor}} is still active.&lt;br /&gt;
* [[Technical requirements]]&lt;br /&gt;
* [[J{{CurrentSTSVer|minor}}:Installing Joomla!|Installing Joomla! {{CurrentSTSVer|major}}]]&lt;br /&gt;
* [[J{{CurrentSTSVer|minor}}:What&#039;s new in Joomla!|What&#039;s new]]&lt;br /&gt;
* [[J{{CurrentSTSVer|minor}}:Access_Control_List_Tutorial|Access control system]]&lt;br /&gt;
&amp;lt;!-- * [[International Enhancements for Version {{CurrentSTSVer|minor}}|International enhancements]] --&amp;gt;&lt;br /&gt;
&amp;lt;!-- * [[Layout Overrides in Joomla! {{CurrentSTSVer|minor}}|Layout overrides]] --&amp;gt;&lt;br /&gt;
* [[:Category:Version {{CurrentSTSVer}} FAQ|Version {{CurrentSTSVer}} FAQ]]&lt;br /&gt;
&lt;br /&gt;
For more information see the [[:Category:Joomla! {{CurrentSTSVer|minor}}|Joomla {{CurrentSTSVer|minor}} category page]].&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot; style=&amp;quot;margin:0em 0em 1em 0em; width:100%&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;1&amp;quot; style=&amp;quot;width:100%; vertical-align:top; border:1px solid Sienna; background-color:Cornsilk;-moz-border-radius:10px; border-radius:10px;&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid Sienna; background-color:Wheat; padding:0.2em 0.5em 0.2em 0.5em; font-size:130%; font-weight:bold;-moz-border-radius:10px 10px 0 0; border-radius:10px 10px 0 0;&amp;quot;&amp;gt;Helping with the documentation effort&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:1em 1em 1em 1em;&amp;quot;&amp;gt; &amp;lt;!--Note: Top, right, bottom, left --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot; style=&amp;quot;margin:0em 0em 1em 0em; width:100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;width:50%; vertical-align:top; border:1px solid #abd5f5; background-color: #f1f5fc;-moz-border-radius:10px; border-radius:10px;&amp;quot; rowspan=&amp;quot;1&amp;quot;|&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid abd5f5; background-color:#d0e5f5; padding:0.2em 0.5em 0.2em 0.5em; font-size:110%; font-weight:bold;-moz-border-radius:10px 10px 0 0; border-radius:10px 10px 0 0;&amp;quot;&amp;gt;Documentation Projects&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:0.4em 1em 0.3em 1em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- PICTURE ON LEFT OF TWO BOX SECTION --&amp;gt;&lt;br /&gt;
You don&#039;t need to join the [[Documentation Working Group]] to help us improve the documentation.  Just [[Special:UserLogin|register]] on this wiki and get started.  Feel free to fix any errors you find; take a look in the [[JDOC:Cookie jar|Cookie jar]]; or consider helping out in one of our mini-projects...&lt;br /&gt;
&lt;br /&gt;
{{:JDOC:Projects}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;padding:0em 0.5em 0em 0.5em;background-color:CornSilk;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;width:50%; vertical-align:top; border:1px solid Gold; background-color: White;-moz-border-radius:10px; border-radius:10px;&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;border-bottom:1px solid #Gold; background-color:#ffffaa; padding:0.2em 0.5em 0.2em 0.5em; font-size:110%; font-weight:bold;-moz-border-radius:10px 10px 0 0; border-radius:10px 10px 0 0;&amp;quot;&amp;gt;Most popular pages&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:0.4em 1em 0.3em 1em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- PICTURE ON RIGHT OF TWO BOX SECTION--&amp;gt;&lt;br /&gt;
{{Most popular pages}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{{license}}&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Chunk:Platform&amp;diff=100299</id>
		<title>Chunk:Platform</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Chunk:Platform&amp;diff=100299"/>
		<updated>2013-06-14T15:24:07Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Updated contents, adjusted layout&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{chunk}}&amp;lt;/noinclude&amp;gt;__NOTOC__&lt;br /&gt;
&amp;lt;blockquote style=&amp;quot;width:auto; border:1px solid grey; background-color:cornsilk; padding:5px; font-style:italic;&amp;quot;&amp;gt;The Joomla Platform is a platform for writing Web and command line applications in PHP. It is free and open source software, distributed under the GNU General Public License version 2 or later. The Joomla Content Management System (CMS) is built on top of the Joomla Platform.&amp;lt;ref&amp;gt;https://github.com/joomla/joomla-platform&amp;lt;/ref&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Architecture Joomla Platform.png|frame|400px|The Joomla! Platform]]&lt;br /&gt;
&lt;br /&gt;
As of 24 April 2013, the Platform project has been retired. The Platform has been merged back into the [[CMS]] (see also http://github.com/joomla/joomla-cms), and the [[Framework]] (see also http://github.com/joomla/joomla-framework) has taken its place as the standalone application framework for Joomla! applications.&amp;lt;ref&amp;gt;[https://github.com/joomla/joomla-platform/blob/84014ad35b0d6294a43fcd2745aecb130849ed9e/CONTRIBUTING.markdown CONTRIBUTING.markdown]&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;https://groups.google.com/d/msg/joomla-dev-platform/zzNrsCUKCts/hsBntnONm9MJ&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The release of the Joomla Platform on 5 July 2011&amp;lt;ref&amp;gt;http://developer.joomla.org/code/cms/history/2010/12/02.html&amp;lt;/ref&amp;gt; marked an important change in the Joomla! CMS architecture. The Joomla! CMS was initially a monolithic application. One of the aims of the Joomla! project was to separate the codebase into the CMS and an underlying library, which could then be reused for other projects. In version 1.5 and 1.6, that separation was prepared by creating a division between the [[Framework (CMS 1.5 and 1.6)]] &#039;&#039;(which is unrelated to the new [[Framework]] project)&#039;&#039; and the Joomla! [[CMS]] Application. The Joomla! Platform project continued this effort by separating that framework into an independent project (both in terms of code and organization). The Joomla! Platform is an independent set of libraries which do not depend on the Joomla! CMS Application. These libraries are made up of libraries maintained by the Joomla! Project and libraries maintained by other 3rd party developers. The Platform could be used for web and command-line applications entirely independent of and unrelated to the CMS.&lt;br /&gt;
&lt;br /&gt;
The home of the Joomla! Platform was [https://github.com/joomla/joomla-platform the &#039;&#039;joomla/joomla-platform&#039;&#039; GitHub repository] that contains the source and documentation. The Platform stopped accepting contributions on or before 24 April 2013.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&amp;lt;references/&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Framework&amp;diff=100298</id>
		<title>Framework</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Framework&amp;diff=100298"/>
		<updated>2013-06-14T14:39:42Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Started page about the Framework project&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Chunk:Framework}}&lt;br /&gt;
The home of the Joomla! Framework is [https://github.com/joomla/joomla-framework/ the joomla/joomla-framework GitHub repository] that contains the source, documentation and means to contribute (pull requests).&lt;br /&gt;
&lt;br /&gt;
API documentation for the Framework can be found on http://joomla.github.io/joomla-framework/.&lt;br /&gt;
&lt;br /&gt;
Framework development can be discussed on [http://groups.google.com/group/joomla-dev-framework the joomla-dev-framework Google Group].&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Chunk:Framework&amp;diff=100297</id>
		<title>Chunk:Framework</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Chunk:Framework&amp;diff=100297"/>
		<updated>2013-06-14T14:32:21Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Started page about the Framework project&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{chunk}}&amp;lt;/noinclude&amp;gt;__NOTOC__&lt;br /&gt;
The Joomla Framework is a platform for writing web and command line applications in PHP.  It is free and open source software, distributed under the GNU General Public License version 2 or later.&amp;lt;ref&amp;gt;https://github.com/joomla/joomla-framework/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Framework comprises code originally developed for the Joomla [[Content Management System]] and is a continuation of the [[Platform]] project. The Joomla Framework and the Joomla CMS are separate projects with separate development teams. Unlike the Platform, the Framework is not primarily intended as a platform for the Joomla CMS, and the Joomla CMS is not currently built on the Framework.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&amp;lt;references/&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Talk:Framework_(CMS_1.5_and_1.6)&amp;diff=100295</id>
		<title>Talk:Framework (CMS 1.5 and 1.6)</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Talk:Framework_(CMS_1.5_and_1.6)&amp;diff=100295"/>
		<updated>2013-06-14T14:20:36Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Mvangeest moved page Talk:Framework to Talk:Framework (CMS 1.5 and 1.6): The name Framework has been reused for the new Joomla Framework project&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Wanted pages on the Framework ==&lt;br /&gt;
&lt;br /&gt;
While emptying the Tutorial namespace, I deleted the Tutorial:Framework page. It only contained a sentence praising the exquisite flexibility of the &amp;quot;new, streamlined&amp;quot; framework, plus the following two links:&lt;br /&gt;
  * [[framework:database_part1|Using the 1.5 Database Libraries]]&lt;br /&gt;
  * [[framework:router_part1|Creating Custom URLs]]&lt;br /&gt;
These pages were probably requested by developers, so if anyone has the time to write them, please do.&lt;br /&gt;
[[User:Mvangeest|Mvangeest]] 18:29, 14 January 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Framework&amp;diff=100292</id>
		<title>Framework</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Framework&amp;diff=100292"/>
		<updated>2013-06-14T14:20:35Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Mvangeest moved page Framework to Framework (CMS 1.5 and 1.6): The name Framework has been reused for the new Joomla Framework project&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Framework (CMS 1.5 and 1.6)]]&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Framework_(CMS_1.5_and_1.6)&amp;diff=100291</id>
		<title>Framework (CMS 1.5 and 1.6)</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Framework_(CMS_1.5_and_1.6)&amp;diff=100291"/>
		<updated>2013-06-14T14:20:34Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Mvangeest moved page Framework to Framework (CMS 1.5 and 1.6): The name Framework has been reused for the new Joomla Framework project&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Chunk:Framework quote}}&lt;br /&gt;
{{Chunk:Framework}}&lt;br /&gt;
== API Reference ==&lt;br /&gt;
&lt;br /&gt;
On this page we&#039;d like to provide you a way to reference of all classes and respective methods. Use the links below to navigate to further information about framework versions or the version classes which include, where possible, examples of use.&lt;br /&gt;
&lt;br /&gt;
If you would like to help us improve this resource, please read about the [[API Reference Project]].&lt;br /&gt;
&lt;br /&gt;
{{Navbox&lt;br /&gt;
|state=off&lt;br /&gt;
|navbar=off&lt;br /&gt;
|title=API documentation is available in the following &#039;&#039;&#039;Joomla! Framework Versions&#039;&#039;&#039;&lt;br /&gt;
|titlestyle=font-weight:normal; padding:5px;&lt;br /&gt;
|image=[[File:Joomla vert logo.png|120px]]&lt;br /&gt;
|group1= Select a framework version&lt;br /&gt;
|group2= See also&lt;br /&gt;
|group1style=font-size:1.1em; width:18%;&lt;br /&gt;
|list1=&lt;br /&gt;
* [[API15:Framework|Framework]] {{JVer|1.5}}&lt;br /&gt;
* [[API16:Framework|Framework]] {{JVer|1.6}}&lt;br /&gt;
|list2=&lt;br /&gt;
* [[API17:Platform|Platform]] {{JVer|11.1}}&lt;br /&gt;
|list1style=padding-left:10px; font-size:1.2em;&lt;br /&gt;
|list2style=padding-left:10px; font-size:1.2em;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
=== Further Reading ===&lt;br /&gt;
*[[Joomla! Framework vs Joomla! Platform]]&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Framework]][[Category:Subpackages]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=API16:Framework&amp;diff=100290</id>
		<title>API16:Framework</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=API16:Framework&amp;diff=100290"/>
		<updated>2013-06-14T14:18:43Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Archive maintenance: a page move could have caused major confusion&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Chunk:Framework (CMS 1.5 and 1.6)}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JAccess|JAccess]]&lt;br /&gt;
|[[API16:JElementComponentLayouts|JElementComponentLayouts]]&lt;br /&gt;
|[[API16:JFormFieldSQL|JFormFieldSQL]]&lt;br /&gt;
|[[API16:JPane|JPane]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JAdapter|JAdapter]]&lt;br /&gt;
|[[API16:JElementContentLanguages|JElementContentLanguages]]&lt;br /&gt;
|[[API16:JFormFieldSessionHandler|JFormFieldSessionHandler]]&lt;br /&gt;
|[[API16:JPaneSliders|JPaneSliders]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JAdapterInstance|JAdapterInstance]]&lt;br /&gt;
|[[API16:JElementEditors|JElementEditors]]&lt;br /&gt;
|[[API16:JFormFieldSpacer|JFormFieldSpacer]]&lt;br /&gt;
|[[API16:JPaneTabs|JPaneTabs]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JApplication|JApplication]]&lt;br /&gt;
|[[API16:JElementFilelist|JElementFilelist]]&lt;br /&gt;
|[[API16:JFormFieldTemplateStyle|JFormFieldTemplateStyle]]&lt;br /&gt;
|[[API16:JParameter|JParameter]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JApplicationHelper|JApplicationHelper]]&lt;br /&gt;
|[[API16:JElementFolderlist|JElementFolderlist]]&lt;br /&gt;
|[[API16:JFormFieldText|JFormFieldText]]&lt;br /&gt;
|[[API16:JPath|JPath]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JArchive|JArchive]]&lt;br /&gt;
|[[API16:JElementHelpsites|JElementHelpsites]]&lt;br /&gt;
|[[API16:JFormFieldTextarea|JFormFieldTextarea]]&lt;br /&gt;
|[[API16:JPathway|JPathway]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JArchiveBzip2|JArchiveBzip2]]&lt;br /&gt;
|[[API16:JElementHidden|JElementHidden]]&lt;br /&gt;
|[[API16:JFormFieldTimezone|JFormFieldTimezone]]&lt;br /&gt;
|[[API16:JPlugin|JPlugin]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JArchiveGzip|JArchiveGzip]]&lt;br /&gt;
|[[API16:JElementImageList|JElementImageList]]&lt;br /&gt;
|[[API16:JFormFieldUser|JFormFieldUser]]&lt;br /&gt;
|[[API16:JPluginHelper|JPluginHelper]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JArchiveTar|JArchiveTar]]&lt;br /&gt;
|[[API16:JElementLanguages|JElementLanguages]]&lt;br /&gt;
|[[API16:JFormFieldUserGroup|JFormFieldUserGroup]]&lt;br /&gt;
|[[API16:JProfiler|JProfiler]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JArchiveZip|JArchiveZip]]&lt;br /&gt;
|[[API16:JElementList|JElementList]]&lt;br /&gt;
|[[API16:JFormRule|JFormRule]]&lt;br /&gt;
|[[API16:JRegistry|JRegistry]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JArrayHelper|JArrayHelper]]&lt;br /&gt;
|[[API16:JElementMenu|JElementMenu]]&lt;br /&gt;
|[[API16:JFormRuleBoolean|JFormRuleBoolean]]&lt;br /&gt;
|[[API16:JRegistryFormat|JRegistryFormat]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JAuthentication|JAuthentication]]&lt;br /&gt;
|[[API16:JElementMenuItem|JElementMenuItem]]&lt;br /&gt;
|[[API16:JFormRuleEmail|JFormRuleEmail]]&lt;br /&gt;
|[[API16:JRegistryFormatINI|JRegistryFormatINI]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JAuthenticationResponse|JAuthenticationResponse]]&lt;br /&gt;
|[[API16:JElementModuleLayouts|JElementModuleLayouts]]&lt;br /&gt;
|[[API16:JFormRuleEquals|JFormRuleEquals]]&lt;br /&gt;
|[[API16:JRegistryFormatJSON|JRegistryFormatJSON]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JBrowser|JBrowser]]&lt;br /&gt;
|[[API16:JElementPassword|JElementPassword]]&lt;br /&gt;
|[[API16:JFormRuleRules|JFormRuleRules]]&lt;br /&gt;
|[[API16:JRegistryFormatPHP|JRegistryFormatPHP]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JBuffer|JBuffer]]&lt;br /&gt;
|[[API16:JElementRadio|JElementRadio]]&lt;br /&gt;
|[[API16:JFormRuleUsername|JFormRuleUsername]]&lt;br /&gt;
|[[API16:JRegistryFormatXML|JRegistryFormatXML]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JButton|JButton]]&lt;br /&gt;
|[[API16:JElementSQL|JElementSQL]]&lt;br /&gt;
|[[API16:JFormValidator|JFormValidator]]&lt;br /&gt;
|[[API16:JRequest|JRequest]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JButtonConfirm|JButtonConfirm]]&lt;br /&gt;
|[[API16:JElementSpacer|JElementSpacer]]&lt;br /&gt;
|[[API16:JFrameworkConfig|JFrameworkConfig]]&lt;br /&gt;
|[[API16:JResponse|JResponse]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JButtonCustom|JButtonCustom]]&lt;br /&gt;
|[[API16:JElementTemplateStyle|JElementTemplateStyle]]&lt;br /&gt;
|[[API16:JHelp|JHelp]]&lt;br /&gt;
|[[API16:JRoute|JRoute]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JButtonHelp|JButtonHelp]]&lt;br /&gt;
|[[API16:JElementText|JElementText]]&lt;br /&gt;
|[[API16:JHtml|JHtml]]&lt;br /&gt;
|[[API16:JRouter|JRouter]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JButtonLink|JButtonLink]]&lt;br /&gt;
|[[API16:JElementTextarea|JElementTextarea]]&lt;br /&gt;
|[[API16:JHtmlAccess|JHtmlAccess]]&lt;br /&gt;
|[[API16:JRule|JRule]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JButtonPopup|JButtonPopup]]&lt;br /&gt;
|[[API16:JElementTimezones|JElementTimezones]]&lt;br /&gt;
|[[API16:JHtmlBehavior|JHtmlBehavior]]&lt;br /&gt;
|[[API16:JRules|JRules]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JButtonSeparator|JButtonSeparator]]&lt;br /&gt;
|[[API16:JElementUserGroup|JElementUserGroup]]&lt;br /&gt;
|[[API16:JHtmlCategory|JHtmlCategory]]&lt;br /&gt;
|[[API16:JSession|JSession]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JButtonStandard|JButtonStandard]]&lt;br /&gt;
|[[API16:JError|JError]]&lt;br /&gt;
|[[API16:JHtmlContent|JHtmlContent]]&lt;br /&gt;
|[[API16:JSessionStorage|JSessionStorage]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JCache|JCache]]&lt;br /&gt;
|[[API16:JEvent|JEvent]]&lt;br /&gt;
|[[API16:JHtmlEmail|JHtmlEmail]]&lt;br /&gt;
|[[API16:JSessionStorageApc|JSessionStorageApc]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JCacheCallback|JCacheCallback]]&lt;br /&gt;
|[[API16:JException|JException]]&lt;br /&gt;
|[[API16:JHtmlForm|JHtmlForm]]&lt;br /&gt;
|[[API16:JSessionStorageDatabase|JSessionStorageDatabase]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JCacheOutput|JCacheOutput]]&lt;br /&gt;
|[[API16:JExtension|JExtension]]&lt;br /&gt;
|[[API16:JHtmlGrid|JHtmlGrid]]&lt;br /&gt;
|[[API16:JSessionStorageEaccelerator|JSessionStorageEaccelerator]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JCachePage|JCachePage]]&lt;br /&gt;
|[[API16:JFTP|JFTP]]&lt;br /&gt;
|[[API16:JHtmlImage|JHtmlImage]]&lt;br /&gt;
|[[API16:JSessionStorageMemcache|JSessionStorageMemcache]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JCacheStorage|JCacheStorage]]&lt;br /&gt;
|[[API16:JFactory|JFactory]]&lt;br /&gt;
|[[API16:JHtmlJGrid|JHtmlJGrid]]&lt;br /&gt;
|[[API16:JSessionStorageNone|JSessionStorageNone]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JCacheStorageApc|JCacheStorageApc]]&lt;br /&gt;
|[[API16:JFeedEnclosure|JFeedEnclosure]]&lt;br /&gt;
|[[API16:JHtmlList|JHtmlList]]&lt;br /&gt;
|[[API16:JSessionStorageXcache|JSessionStorageXcache]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JCacheStorageEaccelerator|JCacheStorageEaccelerator]]&lt;br /&gt;
|[[API16:JFeedImage|JFeedImage]]&lt;br /&gt;
|[[API16:JHtmlMenu|JHtmlMenu]]&lt;br /&gt;
|[[API16:JSimpleCrypt|JSimpleCrypt]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JCacheStorageFile|JCacheStorageFile]]&lt;br /&gt;
|[[API16:JFeedItem|JFeedItem]]&lt;br /&gt;
|[[API16:JHtmlRules|JHtmlRules]]&lt;br /&gt;
|[[API16:JSimpleXML|JSimpleXML]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JCacheStorageMemcache|JCacheStorageMemcache]]&lt;br /&gt;
|[[API16:JFile|JFile]]&lt;br /&gt;
|[[API16:JHtmlSelect|JHtmlSelect]]&lt;br /&gt;
|[[API16:JSimpleXMLElement|JSimpleXMLElement]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JCacheStorageXCache|JCacheStorageXCache]]&lt;br /&gt;
|[[API16:JFilesystemHelper|JFilesystemHelper]]&lt;br /&gt;
|[[API16:JHtmlSliders|JHtmlSliders]]&lt;br /&gt;
|[[API16:JStream|JStream]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JCacheView|JCacheView]]&lt;br /&gt;
|[[API16:JFilterInput|JFilterInput]]&lt;br /&gt;
|[[API16:JHtmlString|JHtmlString]]&lt;br /&gt;
|[[API16:JStreamString|JStreamString]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JCategories|JCategories]]&lt;br /&gt;
|[[API16:JFilterOutput|JFilterOutput]]&lt;br /&gt;
|[[API16:JHtmlTabs|JHtmlTabs]]&lt;br /&gt;
|[[API16:JString|JString]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JCategoryNode|JCategoryNode]]&lt;br /&gt;
|[[API16:JFolder|JFolder]]&lt;br /&gt;
|[[API16:JInstaller|JInstaller]]&lt;br /&gt;
|[[API16:JStringController|JStringController]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JClientHelper|JClientHelper]]&lt;br /&gt;
|[[API16:JForm|JForm]]&lt;br /&gt;
|[[API16:JInstallerComponent|JInstallerComponent]]&lt;br /&gt;
|[[API16:JTable|JTable]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JComponentHelper|JComponentHelper]]&lt;br /&gt;
|[[API16:JFormField|JFormField]]&lt;br /&gt;
|[[API16:JInstallerFile|JInstallerFile]]&lt;br /&gt;
|[[API16:JTableAsset|JTableAsset]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JController|JController]]&lt;br /&gt;
|[[API16:JFormFieldAccessLevel|JFormFieldAccessLevel]]&lt;br /&gt;
|[[API16:JInstallerHelper|JInstallerHelper]]&lt;br /&gt;
|[[API16:JTableCategory|JTableCategory]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JControllerForm|JControllerForm]]&lt;br /&gt;
|[[API16:JFormFieldCacheHandler|JFormFieldCacheHandler]]&lt;br /&gt;
|[[API16:JInstallerLanguage|JInstallerLanguage]]&lt;br /&gt;
|[[API16:JTableContent|JTableContent]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDatabase|JDatabase]]&lt;br /&gt;
|[[API16:JFormFieldCalendar|JFormFieldCalendar]]&lt;br /&gt;
|[[API16:JInstallerLibrary|JInstallerLibrary]]&lt;br /&gt;
|[[API16:JTableExtension|JTableExtension]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDatabaseMySQL|JDatabaseMySQL]]&lt;br /&gt;
|[[API16:JFormFieldCategory|JFormFieldCategory]]&lt;br /&gt;
|[[API16:JInstallerModule|JInstallerModule]]&lt;br /&gt;
|[[API16:JTableMenu|JTableMenu]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDatabaseMySQLi|JDatabaseMySQLi]]&lt;br /&gt;
|[[API16:JFormFieldCheckbox|JFormFieldCheckbox]]&lt;br /&gt;
|[[API16:JInstallerPackage|JInstallerPackage]]&lt;br /&gt;
|[[API16:JTableMenuType|JTableMenuType]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDatabaseQuery|JDatabaseQuery]]&lt;br /&gt;
|[[API16:JFormFieldCombo|JFormFieldCombo]]&lt;br /&gt;
|[[API16:JInstallerPlugin|JInstallerPlugin]]&lt;br /&gt;
|[[API16:JTableModule|JTableModule]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDatabaseQueryElement|JDatabaseQueryElement]]&lt;br /&gt;
|[[API16:JFormFieldComponentLayout|JFormFieldComponentLayout]]&lt;br /&gt;
|[[API16:JInstallerTemplate|JInstallerTemplate]]&lt;br /&gt;
|[[API16:JTableNested|JTableNested]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDate|JDate]]&lt;br /&gt;
|[[API16:JFormFieldContentLanguage|JFormFieldContentLanguage]]&lt;br /&gt;
|[[API16:JLDAP|JLDAP]]&lt;br /&gt;
|[[API16:JTableSession|JTableSession]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDispatcher|JDispatcher]]&lt;br /&gt;
|[[API16:JFormFieldEditor|JFormFieldEditor]]&lt;br /&gt;
|[[API16:JLanguage|JLanguage]]&lt;br /&gt;
|[[API16:JTableUpdate|JTableUpdate]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDocument|JDocument]]&lt;br /&gt;
|[[API16:JFormFieldEditors|JFormFieldEditors]]&lt;br /&gt;
|[[API16:JLanguageHelper|JLanguageHelper]]&lt;br /&gt;
|[[API16:JTableUser|JTableUser]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDocumentError|JDocumentError]]&lt;br /&gt;
|[[API16:JFormFieldFile|JFormFieldFile]]&lt;br /&gt;
|[[API16:JLanguageTransliterate|JLanguageTransliterate]]&lt;br /&gt;
|[[API16:JTableUsergroup|JTableUsergroup]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDocumentFeed|JDocumentFeed]]&lt;br /&gt;
|[[API16:JFormFieldFileList|JFormFieldFileList]]&lt;br /&gt;
|[[API16:JLibraryManifest|JLibraryManifest]]&lt;br /&gt;
|[[API16:JTableViewlevel|JTableViewlevel]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDocumentHTML|JDocumentHTML]]&lt;br /&gt;
|[[API16:JFormFieldFolderList|JFormFieldFolderList]]&lt;br /&gt;
|[[API16:JLog|JLog]]&lt;br /&gt;
|[[API16:JText|JText]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDocumentJSON|JDocumentJSON]]&lt;br /&gt;
|[[API16:JFormFieldGroupedList|JFormFieldGroupedList]]&lt;br /&gt;
|[[API16:JMail|JMail]]&lt;br /&gt;
|[[API16:JToolBar|JToolBar]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDocumentRAW|JDocumentRAW]]&lt;br /&gt;
|[[API16:JFormFieldHelpsite|JFormFieldHelpsite]]&lt;br /&gt;
|[[API16:JMailHelper|JMailHelper]]&lt;br /&gt;
|[[API16:JTree|JTree]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDocumentRenderer|JDocumentRenderer]]&lt;br /&gt;
|[[API16:JFormFieldHidden|JFormFieldHidden]]&lt;br /&gt;
|[[API16:JMenu|JMenu]]&lt;br /&gt;
|[[API16:JURI|JURI]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDocumentRendererAtom|JDocumentRendererAtom]]&lt;br /&gt;
|[[API16:JFormFieldImageList|JFormFieldImageList]]&lt;br /&gt;
|[[API16:JModel|JModel]]&lt;br /&gt;
|[[API16:JUpdate|JUpdate]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDocumentRendererComponent|JDocumentRendererComponent]]&lt;br /&gt;
|[[API16:JFormFieldInteger|JFormFieldInteger]]&lt;br /&gt;
|[[API16:JModelForm|JModelForm]]&lt;br /&gt;
|[[API16:JUpdateAdapter|JUpdateAdapter]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDocumentRendererHead|JDocumentRendererHead]]&lt;br /&gt;
|[[API16:JFormFieldLanguage|JFormFieldLanguage]]&lt;br /&gt;
|[[API16:JModelItem|JModelItem]]&lt;br /&gt;
|[[API16:JUpdater|JUpdater]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDocumentRendererMessage|JDocumentRendererMessage]]&lt;br /&gt;
|[[API16:JFormFieldList|JFormFieldList]]&lt;br /&gt;
|[[API16:JModelList|JModelList]]&lt;br /&gt;
|[[API16:JUpdaterCollection|JUpdaterCollection]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDocumentRendererModule|JDocumentRendererModule]]&lt;br /&gt;
|[[API16:JFormFieldMedia|JFormFieldMedia]]&lt;br /&gt;
|[[API16:JModuleHelper|JModuleHelper]]&lt;br /&gt;
|[[API16:JUpdaterExtension|JUpdaterExtension]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDocumentRendererModules|JDocumentRendererModules]]&lt;br /&gt;
|[[API16:JFormFieldMediamanager|JFormFieldMediamanager]]&lt;br /&gt;
|[[API16:JNode|JNode]]&lt;br /&gt;
|[[API16:JUser|JUser]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDocumentRendererRSS|JDocumentRendererRSS]]&lt;br /&gt;
|[[API16:JFormFieldMenu|JFormFieldMenu]]&lt;br /&gt;
|[[API16:JObject|JObject]]&lt;br /&gt;
|[[API16:JUserHelper|JUserHelper]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JDocumentXML|JDocumentXML]]&lt;br /&gt;
|[[API16:JFormFieldMenuItem|JFormFieldMenuItem]]&lt;br /&gt;
|[[API16:JObservable|JObservable]]&lt;br /&gt;
|[[API16:JUtility|JUtility]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JEditor|JEditor]]&lt;br /&gt;
|[[API16:JFormFieldModuleLayout|JFormFieldModuleLayout]]&lt;br /&gt;
|[[API16:JObserver|JObserver]]&lt;br /&gt;
|[[API16:JVersion|JVersion]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JElement|JElement]]&lt;br /&gt;
|[[API16:JFormFieldPassword|JFormFieldPassword]]&lt;br /&gt;
|[[API16:JPackageManifest|JPackageManifest]]&lt;br /&gt;
|[[API16:JView|JView]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JElementCalendar|JElementCalendar]]&lt;br /&gt;
|[[API16:JFormFieldRadio|JFormFieldRadio]]&lt;br /&gt;
|[[API16:JPagination|JPagination]]&lt;br /&gt;
|[[API16:JXMLElement|JXMLElement]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API16:JElementCategory|JElementCategory]]&lt;br /&gt;
|[[API16:JFormFieldRules|JFormFieldRules]]&lt;br /&gt;
|[[API16:JPaginationObject|JPaginationObject]]&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=API15:Framework&amp;diff=100289</id>
		<title>API15:Framework</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=API15:Framework&amp;diff=100289"/>
		<updated>2013-06-14T14:18:16Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Archive maintenance: a page move could have caused major confusion&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;[[Chunk:Framework (CMS 1.5 and 1.6)|Edit Descripton]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
{{Chunk:Framework (CMS 1.5 and 1.6)}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JApplication|JApplication]]&lt;br /&gt;
|[[API15:JDocumentRenderer|JDocumentRenderer]]&lt;br /&gt;
|[[API15:JHTMLContent|JHTMLContent]]&lt;br /&gt;
|[[API15:JRegistryFormatPHP|JRegistryFormatPHP]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JApplicationHelper|JApplicationHelper]]&lt;br /&gt;
|[[API15:JDocumentRendererAtom|JDocumentRendererAtom]]&lt;br /&gt;
|[[API15:JHTMLEmail|JHTMLEmail]]&lt;br /&gt;
|[[API15:JRegistryFormatXML|JRegistryFormatXML]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JArchive|JArchive]]&lt;br /&gt;
|[[API15:JDocumentRendererComponent|JDocumentRendererComponent]]&lt;br /&gt;
|[[API15:JHTMLForm|JHTMLForm]]&lt;br /&gt;
|[[API15:JRequest|JRequest]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JArchiveBzip2|JArchiveBzip2]]&lt;br /&gt;
|[[API15:JDocumentRendererHead|JDocumentRendererHead]]&lt;br /&gt;
|[[API15:JHTMLGrid|JHTMLGrid]]&lt;br /&gt;
|[[API15:JResponse|JResponse]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JArchiveGzip|JArchiveGzip]]&lt;br /&gt;
|[[API15:JDocumentRendererMessage|JDocumentRendererMessage]]&lt;br /&gt;
|[[API15:JHTMLImage|JHTMLImage]]&lt;br /&gt;
|[[API15:JRoute|JRoute]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JArchiveTar|JArchiveTar]]&lt;br /&gt;
|[[API15:JDocumentRendererModule|JDocumentRendererModule]]&lt;br /&gt;
|[[API15:JHTMLList|JHTMLList]]&lt;br /&gt;
|[[API15:JRouter|JRouter]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JArchiveZip|JArchiveZip]]&lt;br /&gt;
|[[API15:JDocumentRendererModules|JDocumentRendererModules]]&lt;br /&gt;
|[[API15:JHTMLMenu|JHTMLMenu]]&lt;br /&gt;
|[[API15:JSession|JSession]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JArrayHelper|JArrayHelper]]&lt;br /&gt;
|[[API15:JDocumentRendererRSS|JDocumentRendererRSS]]&lt;br /&gt;
|[[API15:JHTMLSelect|JHTMLSelect]]&lt;br /&gt;
|[[API15:JSessionStorage|JSessionStorage]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JAuthentication|JAuthentication]]&lt;br /&gt;
|[[API15:JEditor|JEditor]]&lt;br /&gt;
|[[API15:JHelp|JHelp]]&lt;br /&gt;
|[[API15:JSessionStorageApc|JSessionStorageApc]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JAuthenticationResponse|JAuthenticationResponse]]&lt;br /&gt;
|[[API15:JElement|JElement]]&lt;br /&gt;
|[[API15:JInstaller|JInstaller]]&lt;br /&gt;
|[[API15:JSessionStorageDatabase|JSessionStorageDatabase]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JAuthorization|JAuthorization]]&lt;br /&gt;
|[[API15:JElementCalendar|JElementCalendar]]&lt;br /&gt;
|[[API15:JInstallerComponent|JInstallerComponent]]&lt;br /&gt;
|[[API15:JSessionStorageEaccelerator|JSessionStorageEaccelerator]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JBrowser|JBrowser]]&lt;br /&gt;
|[[API15:JElementCategory|JElementCategory]]&lt;br /&gt;
|[[API15:JInstallerHelper|JInstallerHelper]]&lt;br /&gt;
|[[API15:JSessionStorageMemcache|JSessionStorageMemcache]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JBuffer|JBuffer]]&lt;br /&gt;
|[[API15:JElementEditors|JElementEditors]]&lt;br /&gt;
|[[API15:JInstallerLanguage|JInstallerLanguage]]&lt;br /&gt;
|[[API15:JSessionStorageNone|JSessionStorageNone]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JButton|JButton]]&lt;br /&gt;
|[[API15:JElementFilelist|JElementFilelist]]&lt;br /&gt;
|[[API15:JInstallerModule|JInstallerModule]]&lt;br /&gt;
|[[API15:JSessionStorageXcache|JSessionStorageXcache]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JButtonConfirm|JButtonConfirm]]&lt;br /&gt;
|[[API15:JElementFolderlist|JElementFolderlist]]&lt;br /&gt;
|[[API15:JInstallerPlugin|JInstallerPlugin]]&lt;br /&gt;
|[[API15:JSimpleCrypt|JSimpleCrypt]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JButtonCustom|JButtonCustom]]&lt;br /&gt;
|[[API15:JElementHelpsites|JElementHelpsites]]&lt;br /&gt;
|[[API15:JInstallerTemplate|JInstallerTemplate]]&lt;br /&gt;
|[[API15:JSimpleXML|JSimpleXML]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JButtonHelp|JButtonHelp]]&lt;br /&gt;
|[[API15:JElementHidden|JElementHidden]]&lt;br /&gt;
|[[API15:JLDAP|JLDAP]]&lt;br /&gt;
|[[API15:JSimpleXMLElement|JSimpleXMLElement]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JButtonLink|JButtonLink]]&lt;br /&gt;
|[[API15:JElementImageList|JElementImageList]]&lt;br /&gt;
|[[API15:JLanguage|JLanguage]]&lt;br /&gt;
|[[API15:JString|JString]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JButtonPopup|JButtonPopup]]&lt;br /&gt;
|[[API15:JElementLanguages|JElementLanguages]]&lt;br /&gt;
|[[API15:JLanguageHelper|JLanguageHelper]]&lt;br /&gt;
|[[API15:JTable|JTable]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JButtonSeparator|JButtonSeparator]]&lt;br /&gt;
|[[API15:JElementList|JElementList]]&lt;br /&gt;
|[[API15:JLog|JLog]]&lt;br /&gt;
|[[API15:JTableARO|JTableARO]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JButtonStandard|JButtonStandard]]&lt;br /&gt;
|[[API15:JElementMenu|JElementMenu]]&lt;br /&gt;
|[[API15:JMail|JMail]]&lt;br /&gt;
|[[API15:JTableAROGroup|JTableAROGroup]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JCache|JCache]]&lt;br /&gt;
|[[API15:JElementMenuItem|JElementMenuItem]]&lt;br /&gt;
|[[API15:JMailHelper|JMailHelper]]&lt;br /&gt;
|[[API15:JTableCategory|JTableCategory]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JCacheCallback|JCacheCallback]]&lt;br /&gt;
|[[API15:JElementPassword|JElementPassword]]&lt;br /&gt;
|[[API15:JMenu|JMenu]]&lt;br /&gt;
|[[API15:JTableComponent|JTableComponent]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JCacheOutput|JCacheOutput]]&lt;br /&gt;
|[[API15:JElementRadio|JElementRadio]]&lt;br /&gt;
|[[API15:JModel|JModel]]&lt;br /&gt;
|[[API15:JTableContent|JTableContent]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JCachePage|JCachePage]]&lt;br /&gt;
|[[API15:JElementSQL|JElementSQL]]&lt;br /&gt;
|[[API15:JModuleHelper|JModuleHelper]]&lt;br /&gt;
|[[API15:JTableMenu|JTableMenu]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JCacheStorage|JCacheStorage]]&lt;br /&gt;
|[[API15:JElementSection|JElementSection]]&lt;br /&gt;
|[[API15:JNode|JNode]]&lt;br /&gt;
|[[API15:JTableMenuTypes|JTableMenuTypes]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JCacheStorageApc|JCacheStorageApc]]&lt;br /&gt;
|[[API15:JElementSpacer|JElementSpacer]]&lt;br /&gt;
|[[API15:JObject|JObject]]&lt;br /&gt;
|[[API15:JTableModule|JTableModule]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JCacheStorageEaccelerator|JCacheStorageEaccelerator]]&lt;br /&gt;
|[[API15:JElementText|JElementText]]&lt;br /&gt;
|[[API15:JObservable|JObservable]]&lt;br /&gt;
|[[API15:JTablePlugin|JTablePlugin]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JCacheStorageFile|JCacheStorageFile]]&lt;br /&gt;
|[[API15:JElementTextarea|JElementTextarea]]&lt;br /&gt;
|[[API15:JObserver|JObserver]]&lt;br /&gt;
|[[API15:JTableSection|JTableSection]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JCacheStorageMemcache|JCacheStorageMemcache]]&lt;br /&gt;
|[[API15:JElementTimezones|JElementTimezones]]&lt;br /&gt;
|[[API15:JPagination|JPagination]]&lt;br /&gt;
|[[API15:JTableSession|JTableSession]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JCacheStorageXCache|JCacheStorageXCache]]&lt;br /&gt;
|[[API15:JElementUserGroup|JElementUserGroup]]&lt;br /&gt;
|[[API15:JPaginationObject|JPaginationObject]]&lt;br /&gt;
|[[API15:JTableUser|JTableUser]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JCacheView|JCacheView]]&lt;br /&gt;
|[[API15:JError|JError]]&lt;br /&gt;
|[[API15:JPane|JPane]]&lt;br /&gt;
|[[API15:JTemplate|JTemplate]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JClientHelper|JClientHelper]]&lt;br /&gt;
|[[API15:JEvent|JEvent]]&lt;br /&gt;
|[[API15:JPaneSliders|JPaneSliders]]&lt;br /&gt;
|[[API15:JText|JText]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JComponentHelper|JComponentHelper]]&lt;br /&gt;
|[[API15:JException|JException]]&lt;br /&gt;
|[[API15:JPaneTabs|JPaneTabs]]&lt;br /&gt;
|[[API15:JToolBar|JToolBar]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JController|JController]]&lt;br /&gt;
|[[API15:JFTP|JFTP]]&lt;br /&gt;
|[[API15:JParameter|JParameter]]&lt;br /&gt;
|[[API15:JTree|JTree]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JDatabase|JDatabase]]&lt;br /&gt;
|[[API15:JFactory|JFactory]]&lt;br /&gt;
|[[API15:JPath|JPath]]&lt;br /&gt;
|[[API15:JURI|JURI]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JDatabaseMySQL|JDatabaseMySQL]]&lt;br /&gt;
|[[API15:JFeedEnclosure|JFeedEnclosure]]&lt;br /&gt;
|[[API15:JPathway|JPathway]]&lt;br /&gt;
|[[API15:JUser|JUser]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JDatabaseMySQLi|JDatabaseMySQLi]]&lt;br /&gt;
|[[API15:JFeedImage|JFeedImage]]&lt;br /&gt;
|[[API15:JPlugin|JPlugin]]&lt;br /&gt;
|[[API15:JUserHelper|JUserHelper]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JDate|JDate]]&lt;br /&gt;
|[[API15:JFeedItem|JFeedItem]]&lt;br /&gt;
|[[API15:JPluginHelper|JPluginHelper]]&lt;br /&gt;
|[[API15:JUtility|JUtility]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JDispatcher|JDispatcher]]&lt;br /&gt;
|[[API15:JFile|JFile]]&lt;br /&gt;
|[[API15:JProfiler|JProfiler]]&lt;br /&gt;
|[[API15:JVersion|JVersion]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JDocument|JDocument]]&lt;br /&gt;
|[[API15:JFilterInput|JFilterInput]]&lt;br /&gt;
|[[API15:JQuery|JQuery]]&lt;br /&gt;
|[[API15:JView|JView]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JDocumentError|JDocumentError]]&lt;br /&gt;
|[[API15:JFilterOutput|JFilterOutput]]&lt;br /&gt;
|[[API15:JQueryElement|JQueryElement]]&lt;br /&gt;
|[[API15:patTemplate_Function_Sef|patTemplate_Function_Sef]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JDocumentFeed|JDocumentFeed]]&lt;br /&gt;
|[[API15:JFolder|JFolder]]&lt;br /&gt;
|[[API15:JRecordSet|JRecordSet]]&lt;br /&gt;
|[[API15:patTemplate_Function_Translate|patTemplate_Function_Translate]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JDocumentHTML|JDocumentHTML]]&lt;br /&gt;
|[[API15:JFrameworkConfig|JFrameworkConfig]]&lt;br /&gt;
|[[API15:JRegistry|JRegistry]]&lt;br /&gt;
|[[API15:patTemplate_Modifier_SEF|patTemplate_Modifier_SEF]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JDocumentPDF|JDocumentPDF]]&lt;br /&gt;
|[[API15:JHTML|JHTML]]&lt;br /&gt;
|[[API15:JRegistryFormat|JRegistryFormat]]&lt;br /&gt;
|[[API15:patTemplate_Modifier_Translate|patTemplate_Modifier_Translate]]&lt;br /&gt;
|-&lt;br /&gt;
|[[API15:JDocumentRAW|JDocumentRAW]]&lt;br /&gt;
|[[API15:JHTMLBehavior|JHTMLBehavior]]&lt;br /&gt;
|[[API15:JRegistryFormatINI|JRegistryFormatINI]]&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Joomla!_Framework_(CMS_1.5_and_1.6)_vs_Joomla!_Platform&amp;diff=100288</id>
		<title>Joomla! Framework (CMS 1.5 and 1.6) vs Joomla! Platform</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Joomla!_Framework_(CMS_1.5_and_1.6)_vs_Joomla!_Platform&amp;diff=100288"/>
		<updated>2013-06-14T14:15:46Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Adjusted link after page move&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
== Framework ==&lt;br /&gt;
{{Chunk:Framework (CMS 1.5 and 1.6)}}&lt;br /&gt;
== Introduction to Platform ==&lt;br /&gt;
{{Chunk:Platform}}&lt;br /&gt;
== Differences ==&lt;br /&gt;
The Joomla! Platform can now be used to build other CMS Applications or Web and command line Applications specific to a developer&#039;s needs such as eCommerce, Social Media, and other stand alone Applications. The Platform is stored on GitHub, which allows developers to easily fork the Platform code for their own purposes, and then if they want, integrate it into the main code branch. This will encourage more developers and even attract larger corporations to contribute to the Joomla! Platform who might not have done so before.&amp;lt;ref&amp;gt;http://magazine.joomla.org/issues/Issue-Dec-2011/item/616-Write-your-own-App-using-Joomla-Platform?tmpl=component&amp;amp;print=1&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Another good thing about the separation of the the Joomla! Platform it has a release schedule of every 3 months which allows for a faster integration of core features used by extension developers. The version number is determined by the the year of its release. For example, Joomla! Platform 11.1 was released in 2011 and 12.1 was released in 2012.&amp;lt;ref&amp;gt;http://magazine.joomla.org/issues/Issue-Dec-2011/item/616-Write-your-own-App-using-Joomla-Platform?tmpl=component&amp;amp;print=1&amp;lt;/ref&amp;gt;&lt;br /&gt;
== See also and References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Platform]][[Category:Framework]][[Category:Frameworks and Platforms]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Chunk:Framework&amp;diff=100287</id>
		<title>Chunk:Framework</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Chunk:Framework&amp;diff=100287"/>
		<updated>2013-06-14T14:14:19Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Mvangeest moved page Chunk:Framework to Chunk:Framework (CMS 1.5 and 1.6): The name Framework has been reused for the new Joomla Framework project&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Chunk:Framework (CMS 1.5 and 1.6)]]&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Chunk:Framework_(CMS_1.5_and_1.6)&amp;diff=100286</id>
		<title>Chunk:Framework (CMS 1.5 and 1.6)</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Chunk:Framework_(CMS_1.5_and_1.6)&amp;diff=100286"/>
		<updated>2013-06-14T14:14:19Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Mvangeest moved page Chunk:Framework to Chunk:Framework (CMS 1.5 and 1.6): The name Framework has been reused for the new Joomla Framework project&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{chunk}}&amp;lt;/noinclude&amp;gt;__NOTOC__&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|The Joomla! Framework&amp;lt;ref&amp;gt;See also [[Subpackages]]&amp;lt;/ref&amp;gt; was an important part of the [[CMS Architecture in 1.5 and 1.6|Joomla! CMS architecture in the versions 1.5 and 1.6]]. It was based on modern object-oriented design patterns that make the Joomla core highly maintainable and easily extendable. Between April and July 2011, the Framework was rebranded as the Joomla! [[Platform]] and is now being developed separately from the Joomla! [[CMS]]. The first version of the CMS to ship with the Platform was version [[:Category:Joomla! 1.7|1.7]].&lt;br /&gt;
&lt;br /&gt;
Third party developers benefit from the rich, and easily accessible functionality that the Joomla Framework provides.&lt;br /&gt;
|[[Image:JoomlaArchitecture0.png|thumb|425px|The Joomla Architecture]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&amp;lt;references/&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Enav/Beginners&amp;diff=82987</id>
		<title>Enav/Beginners</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Enav/Beginners&amp;diff=82987"/>
		<updated>2013-03-17T21:00:51Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Mvangeest moved page Enav/Beginners to User:Enav/Beginners: Moved page to the User namespace after user request&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[User:Enav/Beginners]]&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:Enav/Beginners&amp;diff=82986</id>
		<title>User:Enav/Beginners</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:Enav/Beginners&amp;diff=82986"/>
		<updated>2013-03-17T21:00:51Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Mvangeest moved page Enav/Beginners to User:Enav/Beginners: Moved page to the User namespace after user request&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to Joomla!, a leading open source Content Management System (CMS) platform. Joomla! is a well-tested, extensible and effective tool supported by a very active and friendly community of developers and users.&lt;br /&gt;
&lt;br /&gt;
This page contain several articles to quickly help you understand the basics of Joomla, and be able to create basic Joomla sites in a short time.&lt;br /&gt;
&lt;br /&gt;
== What is Joomla? ==&lt;br /&gt;
&lt;br /&gt;
If you are a boy from the old school (1990 ish) you may think that web sites still work with a bunch of linked HTML files, Not anymore buddy!, Welcome to century XXI! modern websites runs over Content Management Systems (CMS), this systems runs using dynamic languages like PHP and  databases like MySQL databases, this way a CMS can store and manage huge amount of data like thousand of news articles articles.&lt;br /&gt;
&lt;br /&gt;
So in short Joomla is a very flexible CMS that runs on PHP that uses MySQL databases to store the data and let you create websites with dynamic content that will change and adjust to the context or the configuration parameters you provide.&lt;br /&gt;
&lt;br /&gt;
== Play with it ==&lt;br /&gt;
&lt;br /&gt;
Do you want to get started with Joomla!, but you have no idea where to begin? If so, you have come to the right place. The fastest way to learn about Joomla is to start paying with it right now. Visit the demo page and take few minutes to see the demo content and play with the configurations.&lt;br /&gt;
&lt;br /&gt;
Yes right here---&amp;gt; [http://demo.joomla.org/ Joomla demo page]&lt;br /&gt;
&lt;br /&gt;
The first 2 term you need to learn are &amp;quot;Frontend&amp;quot; and &amp;quot;Backend&amp;quot;, the Frontent is the part that shows your site content and all the funny stuff and the Backend is the part that contains the configuration views and it is also the place where you normally manage (create, edit, update) your content. To access to your Joomla site Backend you just need to add the &amp;quot;/administrators&amp;quot; to your Joomla site path in the browser address bar i.e.: &lt;br /&gt;
&lt;br /&gt;
 www.example.com/adminisrator&lt;br /&gt;
&lt;br /&gt;
Now that you know how Joomla looks and feel in the frontend and backend is time to you to learn what kind of magic you can do with this new tool of yours.&lt;br /&gt;
&lt;br /&gt;
Note: On the demo page you can chose to use a free trial hosting account, when the trial period expired if you chose to contract a paid hosting  account with them, the Joomla! Project will receive a royalty for the transaction, consider this option if you would like to support the project.&lt;br /&gt;
&lt;br /&gt;
== What can i do with it? ==&lt;br /&gt;
&lt;br /&gt;
Joomla is a CMS, a system to manage content, To make a small analogy you can compare Joomla with a computer operative system, for example, on your computer the operative system manages the resources of your computer, also you can install applications to do more things on your computer, in this order of ideas Joomla is the one who is in charge to manage the data and you can install &amp;quot;extensions&amp;quot; to extend and enhance the functions of Joomla. &lt;br /&gt;
&lt;br /&gt;
Joomla comes by default with a bunch of extensions pre-installed and pre-configured to make Joomla works as a News website, but you can manually configure your Joomla site to easily make it works as a:&lt;br /&gt;
&lt;br /&gt;
* Blog site&lt;br /&gt;
* Company or Government site&lt;br /&gt;
* Contact directory&lt;br /&gt;
* Simple product Catalog&lt;br /&gt;
&lt;br /&gt;
Now if your interest is to create more complex sites like:&lt;br /&gt;
&lt;br /&gt;
* eCommerce sites with shopping cart&lt;br /&gt;
* Support sites with forums and ticket systems&lt;br /&gt;
* News sites with paid subscription system and comment systems&lt;br /&gt;
* e-learning sites with paid subscription systems&lt;br /&gt;
&lt;br /&gt;
Then you need to install more Joomla extensions to make your vanilla Joomla site work the way you need. Lots and lots of extensions are for free with no cost at all, and others are extensions commercial, this means that you need to pay a fee to have the right to use them but the normally commercial extensions comes with a tech support deals that will help you save precious time and money, and everybody knows time is gold.&lt;br /&gt;
 &lt;br /&gt;
Here at [http://extensions.joomla.org/ The Joomla Extension Directory] you have thousands of extensions to chose from, take some time to visit the directory and do few searches for the sake to get familiarized with it, you may need to use some more extensions in the future if you decide to [http://www.youtube.com/watch?v=HYtbEmO_JC4 pimp up] your Joomla site.&lt;br /&gt;
&lt;br /&gt;
Maybe a client or your boss is asking you for a web solution with a very specific set of requirements and the information so far does not help you to determine if Joomla is suitable for the job, in order to help you to save some time feel free to visit the Joomla community people and make your questions to humans at:&lt;br /&gt;
&lt;br /&gt;
* The official [http://forum.joomla.org/ Joomla Forums]&lt;br /&gt;
* The official [http://webchat.freenode.net/?channels=joomla ##Joomla] IRC channel (aka chat room)&lt;br /&gt;
* The official [http://www.facebook.com/groups/joomlanospam/ Facebook group]&lt;br /&gt;
&lt;br /&gt;
== Installing Joomla! ==&lt;br /&gt;
&lt;br /&gt;
Now that you had enough fun playing with the Joomla demo site you may want to go the next level and start messing around with extensions and templates to see how they do in your very own local test server or your rented web server.&lt;br /&gt;
&lt;br /&gt;
Follow one of this tutorials that suits you better.&lt;br /&gt;
&lt;br /&gt;
* [[Installing Joomla on a rented web server]]&lt;br /&gt;
* [[Installing Joomla on a local web server]]&lt;br /&gt;
&lt;br /&gt;
Note: This tutorials are targeted for non-expert audience, if you need more detailed and advanced information go to the [[developers | Developers page]].&lt;br /&gt;
&lt;br /&gt;
== Understanding How Joomla Works ==&lt;br /&gt;
&lt;br /&gt;
To keep this introductory article as short and friendly as possible we can say that Joomla have tow main parts, the Frontend and the Backend, as explained before the Frontend shows the site content that any visitor can see and the Backend is the administrative part that is normally restricted for users with privileges such as administrators.&lt;br /&gt;
&lt;br /&gt;
Taking a quick look at the average website we can conclude that most of them have this basic layout:&lt;br /&gt;
&lt;br /&gt;
* Header&lt;br /&gt;
* Main menu&lt;br /&gt;
* Main content&lt;br /&gt;
* Side content (left or right of main content)&lt;br /&gt;
* Footer&lt;br /&gt;
&lt;br /&gt;
In Joomla a template is the one in charge to determine the layout and disposition of those chunks of data described in the previous list, also a template is the one used to determine the font types, colors, styles and the presentation in general.&lt;br /&gt;
&lt;br /&gt;
Now you may wonder what is used to render each of those chunks of data, and the answer is modules and components. Joomla depends on extensions (components, modules, plugins) to render chunks of information that have certain characteristics, for example, for small and compact chunks of data like header, main menu, side content and footer Joomla uses Modules who are meant to be use for that kind of data, but for the main content of the page that tend to be a very large and dynamic chunk of data, the element in use is the component.&lt;br /&gt;
&lt;br /&gt;
There are several kinds of plugins and they are categorized depending on the job they do, For example, A content plugin can be used to manipulate data before it is rendered on the page, an authentication plugin is a plugin that can give you the ability to login in a Joomla site using Google accounts or Facebook accounts.&lt;br /&gt;
&lt;br /&gt;
In resume:&lt;br /&gt;
&lt;br /&gt;
* Templates: Defines the site layout and visual styles.&lt;br /&gt;
* Component: Used to render large chucks of dynamic data.&lt;br /&gt;
* Modules: Used to render compact and normally static chunks of data.&lt;br /&gt;
* Plugins: They are used to extend the Joomla functions and manipulate data.&lt;br /&gt;
&lt;br /&gt;
Both the frontend and the backend uses templates and extensions. Is a normal thing that many Joomla sites uses different templates on the frontend and leave the backend with the default template but you can always install a custom 3rd party template for the backend to have a different look and feel.&lt;br /&gt;
&lt;br /&gt;
Note: Since most developers creates extensions based on how the default administrative template looks and work you may experience bugs and visual glitches with 3rd party administrative templates, so we recommend the use of the default Joomla template, most tutorials and documentation screenshots in general are based on the default Joomla administrative template.&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Manifest_files&amp;diff=80036</id>
		<title>Manifest files</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Manifest_files&amp;diff=80036"/>
		<updated>2013-01-22T23:00:42Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: /* Root element */ Corrected and (partly) updated information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete}}&lt;br /&gt;
{{RightTOC}}&lt;br /&gt;
==Introduction==&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! 1.6 {{JVer|1.6}}, there are very few differences between the manifest file formats for the different [[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; || 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;
=== 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;code&amp;gt;&amp;lt;name&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;ndash; raw component name (e.g. &amp;lt;code&amp;gt;com_banners&amp;lt;/code&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;author&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;ndash; author&#039;s name (e.g. &amp;lt;code&amp;gt;Joomla! Project&amp;lt;/code&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;creationDate&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;ndash; date of creation or release (e.g. &amp;lt;code&amp;gt;April 2006&amp;lt;/code&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;copyright&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;ndash; a copyright statement (e.g. &amp;lt;code&amp;gt;(C) 2005 - 2011 Open Source Matters. All rights reserved.&amp;lt;/code&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;license&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;ndash; a license statement (e.g. &amp;lt;code&amp;gt;NU General Public License version 2 or later; see LICENSE.txt&amp;lt;/code&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;authorEmail&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;ndash; author&#039;s email address (e.g. &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;admin@joomla.org&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;authorUrl&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;ndash; URL to the author&#039;s website (e.g. &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;www.joomla.org&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;version&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;ndash; the version number of the extension (e.g. &amp;lt;code&amp;gt;1.6.0&amp;lt;/code&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;description&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;ndash; the description of the component. This is a translatable field. (e.g. &amp;lt;code&amp;gt;COM_BANNERS_XML_DESCRIPTION&amp;lt;/code&amp;gt;)&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 [[Component|components]] apply to both the [[Site (Application)|site]] and the [[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;
&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;menu link=&amp;quot;anoption=avalue&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;
| 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;lt;languages&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;lt;languages&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;
&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 for the majority (non-English speaking!) of Joomla! users experienced under Joomla! 1.5.&lt;br /&gt;
&lt;br /&gt;
{{Needsinfo|In Platform 11.1 no alt attribute processed and if link provide in menu tag other provided attributes were ignore. The other tags are task, view, controller, act, layout, sub. Please confirm this, please.}}&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 folder=&amp;quot;admin&amp;quot;&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 folder=&amp;quot;admin&amp;quot;&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 above example, we put sql files in &amp;quot;admin/sql&amp;quot; folder of installation package. You have to include &amp;quot;sql&amp;quot; folder in administration files.&lt;br /&gt;
&lt;br /&gt;
You can execute SQL during 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. An &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 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, we put extension language files in Joomla! main language file, using &amp;lt;languages&amp;gt;..&amp;lt;/languages&amp;gt; tag as shown below. &#039;&#039;&#039;This tag considered to be deprecated since Joomla! 1.6.&#039;&#039;&#039; We encourage you to put extension &#039;s language files in extension folder and Joomla! is responsible for loading of required language files.&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, deprecated since Joomla! 1.6 --&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;
Storing extension language files in extension folder, you gain benefit when removing some language from Joomla! installation. As your language files were not removed, when reinstall the language again you can use that files without install them again.&lt;br /&gt;
&lt;br /&gt;
The structure of language folder for frontend and backend is the same. You put them in &amp;lt;language&amp;gt; tag of your folder e.g. language/en-GB/. You have to specify these folders in front-end and back-end files too.&lt;br /&gt;
&lt;br /&gt;
During development you can turn on language debuggin in Joomla! global configuration. So you can investigate if the problems exists.&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;IntallerScript&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). 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 __constructor(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)&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)&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;
== Examples ==&lt;br /&gt;
For a real-life example, see [http://joomlacode.org/gf/project/joomla/scmsvn/?action=browse&amp;amp;path=%2Fdevelopment%2Ftags%2F1.6.x%2F1.6.5%2Fadministrator%2Fcomponents%2Fcom_banners%2Fbanners.xml&amp;amp;view=markup the manifest of the Banner component in version 1.6.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;
&lt;br /&gt;
[[Category:Extension development]]&lt;br /&gt;
[[Category:Specifications]]&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Release_and_support_cycle&amp;diff=80009</id>
		<title>Release and support cycle</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Release_and_support_cycle&amp;diff=80009"/>
		<updated>2013-01-20T20:55:35Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Fixed numbering inconsistencies - please be careful when editing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Joomla! is developed using a fixed release cycle. &#039;&#039;&#039;Every six months&#039;&#039;&#039;, the Joomla! Project releases a new &#039;&#039;minor&#039;&#039; or &#039;&#039;major&#039;&#039; version of Joomla!. Joomla!&#039;s version format is:&lt;br /&gt;
:{{dablink|&amp;lt;tt&amp;gt;[major].[minor].[maintenance]&amp;lt;/tt&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Each version of Joomla! is supported by the Joomla! Project for a limited amount of time. There are two classifications for support: short term support (STS) and long term support (LTS). Every &#039;&#039;&#039;fourth&#039;&#039;&#039; release will be assigned long term support.&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;STS (short term support)&#039;&#039;&#039; releases are supported for &#039;&#039;&#039;seven months&#039;&#039;&#039;. Their support ends one month after the next release of Joomla is released.  They are one click upgrades to the next STS or LTS version.&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;LTS (long term support)&#039;&#039;&#039; releases are supported for &#039;&#039;&#039;twenty-seven months&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Please note that both STS and LTS releases, once they have reached the &#039;&#039;GA (General Availability)&#039;&#039; status, are fully functional and ready to be used in production environment. The disadvantage of using STS releases is that you will need to update your installation of Joomla! every six months, while the advantage is that you will have access to new features and extensions earlier.&lt;br /&gt;
&lt;br /&gt;
Generally, the first STS release after an LTS release indicates the beginning of a new &#039;&#039;major release cycle&#039;&#039;. This STS release introduces fundamentally new features and changes that break compatibility with the previous LTS. Two more STS releases follow (usually compatible with the first STS release), and the release cycle is finished by the release of an LTS release which finalizes the work of the three STS releases. The four releases in one cycle will usually be numbered &amp;lt;tt&amp;gt;[major].0&amp;lt;/tt&amp;gt;,&amp;lt;tt&amp;gt;[major].1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;[major].2&amp;lt;/tt&amp;gt; (STS) and &amp;lt;tt&amp;gt;[major].5&amp;lt;/tt&amp;gt; (LTS). For example, the STS release 3.0 will include breaking changes from 2.5, and 3.5 will include matured versions of the changes in 3.0, 3.1 and 3.2.&lt;br /&gt;
&lt;br /&gt;
Usually, there will be a migration path (an officially supported way of migrating to the next version) between two LTS releases (from &amp;lt;tt&amp;gt;[major].5&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;[next major].5&amp;lt;/tt&amp;gt;) and between an LTS release and the STS releases in its major release cycle (from &amp;lt;tt&amp;gt;[major].2&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;[major].5&amp;lt;/tt&amp;gt;, for example), but not necessarily to the &#039;&#039;&#039;following&#039;&#039;&#039; STS releases (from &amp;lt;tt&amp;gt;[major].5&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;[next major].0&amp;lt;/tt&amp;gt;). In the case of 1.5 to 2.5 (LTS to LTS), for example, there is a migration path. Note that in the case of 2.5 to 3.0 (LTS to STS), there is also built-in migration path, since the changes aren&#039;t too incompatible.&lt;br /&gt;
&lt;br /&gt;
For more information, see [http://developer.joomla.org/strategy.html the official Development Strategy].&lt;br /&gt;
&lt;br /&gt;
The latest STS version documented on this Wiki is {{CurrentSTSVer}} (see [[:Category:Joomla! {{CurrentSTSVer|minor}}]]). The latest LTS version documented on this Wiki is {{CurrentLTSVer}} (see [[:Category:Joomla! {{CurrentLTSVer|minor}}]]).&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Upgrading_1.5_from_an_existing_1.5x_version&amp;diff=79996</id>
		<title>J1.5:Upgrading 1.5 from an existing 1.5x version</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Upgrading_1.5_from_an_existing_1.5x_version&amp;diff=79996"/>
		<updated>2013-01-19T23:10:41Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: /* Step 1: Download the upgrade file */ Updated download link and added link to package list&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{upgrade-intro}}&lt;br /&gt;
&lt;br /&gt;
For some basic information on patching and migrating, see [[Upgrading and Migrating FAQs]] and [[Upgrade Instructions]].&lt;br /&gt;
&lt;br /&gt;
You can also use a Joomla! extension to automate the process of loading version updates. See [http://extensions.joomla.org/extensions/core-enhancements/installers/9332 Update Manager for Joomla!] for more information. &lt;br /&gt;
&lt;br /&gt;
Review the release notes for the new version.&lt;br /&gt;
&lt;br /&gt;
When upgrading from a version that is not the most recent, review [http://www.joomla.org/announcements/release-news release notes for the prior releases.]&lt;br /&gt;
&lt;br /&gt;
==Step 1: Download the upgrade file==&lt;br /&gt;
&lt;br /&gt;
To download the most recent patch package and to obtain the MD5 hash:&lt;br /&gt;
&lt;br /&gt;
* Visit the [http://joomlacode.org/gf/project/joomla/frs/?action=index release download index].&lt;br /&gt;
* Find the correct update file. The Joomla 1.5 downloads are located at the bottom of the page.&lt;br /&gt;
** If you are on the version &#039;&#039;prior to the current one&#039;&#039;, use the file that updates from the prior version to the current version (for example,  [http://joomlacode.org/gf/download/frsrelease/16891/73387/Joomla_1.5.25_to_1.5.26-Stable-Patch_Package.zip Joomla_1.5.25_to_1.5.26-Stable-Patch_Package]).&lt;br /&gt;
** If you are on an &#039;&#039;older&#039;&#039; version, use the 1.5.0 to current version file (for example, [http://joomlacode.org/gf/download/frsrelease/16891/73384/Joomla_1.5.0_to_1.5.26-Stable-Patch_Package.zip Joomla_1.5.0_to_1.5.26-Stable-Patch_Package]). &lt;br /&gt;
** Select the archive format (zip, tar.gz or tar.bz2) that is most convenient for you. &lt;br /&gt;
* Verify the download using the MD5 hash listed in the right column on the same line as the package you selected.&lt;br /&gt;
&lt;br /&gt;
If you have questions about these instructions, read the &#039;&#039;Additional Information&#039;&#039; below this table.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Additional information:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{Ambox|image=notice|text=[[Chunk:patch|What is a patch?]]|style=width:400px}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Ambox|image=notice|text=[[Unpacking a package file|Which package format should I use?]]|style=width:400px}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Ambox|image=notice|text=[[How to determine a package checksum|How do I use the MD5 hash to check the package?]]|style=width:400px}}&lt;br /&gt;
&lt;br /&gt;
==Step 2: Backup your site==&lt;br /&gt;
Before you actually upgrade, you really should make a backup of your site. Backup your existing Joomla site files and store all the files and database in case something gets messed up, you wont have any problem reverting back.&lt;br /&gt;
&lt;br /&gt;
All upgrades should be first tested on a copy of your site before being applied to a live site.&lt;br /&gt;
&lt;br /&gt;
==Step 3: Install the upgrade file==&lt;br /&gt;
{{installing a package file}}&lt;br /&gt;
&lt;br /&gt;
==Step 4: Check your live site to make sure it is working correctly==&lt;br /&gt;
Don&#039;t assume that the upgrade will work flawlessly just because the test upgrade worked.  Check to make sure that nothing untoward has happened.  It could be that differences between the live site and test site platforms will bring out a problem that you did not notice during testing.  If you find a problem and it cannot be resolved quickly you might have to rollback the upgrade using the backup copy you created in step 2.&lt;br /&gt;
&lt;br /&gt;
Hopefully all will be well and you can relax.  If you have any questions before, during, or after the upgrade then please ask them on the [http://forum.joomla.org/index.php/board,430.0.html Joomla! 1.5 Migrating and Upgrading Forum].&lt;br /&gt;
&lt;br /&gt;
Return to [[Upgrade Instructions]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Upgrading]]&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J2.5:Supporting_SEF_URLs_in_your_component&amp;diff=77745</id>
		<title>J2.5:Supporting SEF URLs in your component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J2.5:Supporting_SEF_URLs_in_your_component&amp;diff=77745"/>
		<updated>2012-11-25T18:17:47Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Added information and removed Incomplete template - this page is not complete, but contains enough information to be useful&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:Search Engine Friendly URLs}}&lt;br /&gt;
In Joomla!, each [[component]] is responsible for handling its own SEF URLs. Therefore, as the [[Developers|developer]] of a component, you will have to create your own &#039;&#039;&#039;router&#039;&#039;&#039; to allow your component to use SEF URLs.&lt;br /&gt;
&lt;br /&gt;
== The Concept ==&lt;br /&gt;
&lt;br /&gt;
Assuming you are following standard development practices, your component is probably using &amp;quot;system URLs&amp;quot; that look a lot like &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_yourcomponent&amp;amp;view=article&amp;amp;id=1&amp;amp;catid=20&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;, and your goal is to transform this into &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;. As the developer, you have two tasks: signalling the system that certain pieces of text are URLs and need to be transformed, and explaining the system how to transform URLs.&lt;br /&gt;
&lt;br /&gt;
=== Applying &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
It is difficult and inefficient for Joomla! to figure out which parts of your component&#039;s output are URLs. To support SEF URLs, you will need to change URL-generating code so that it applies &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; before outputting the URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
echo JRoute::_(&#039;index.php?view=article&amp;amp;id=1&amp;amp;catid=20&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that it is possible to leave out the parameters &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; defaults to the name of the component currently being executed, and &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt; defaults to the current menu item&#039;s ID.&lt;br /&gt;
&lt;br /&gt;
In general, you should only apply this to URLs that users and/or search engines are able to see. For example, there is no need to transform URLs used in redirects that immediately result in other redirects.&lt;br /&gt;
&lt;br /&gt;
If the user turns off SEF URLs in the site&#039;s settings, &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; will produce working non-SEF URLs without any changes to the code.&lt;br /&gt;
&lt;br /&gt;
=== Writing a router ===&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also need to write a router, which is a single file with two functions that convert system URLs to and from SEF URLs. This file needs to be placed at &amp;lt;tt&amp;gt;/components/com_yourcomponent/router.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The first function, &amp;lt;code&amp;gt;[componentname]BuildRoute(&amp;amp;$query)&amp;lt;/code&amp;gt;, must transform an array of URL parameters into an array of segments that will form the SEF URL. Schematically, the transformation works as follows:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_yourcomponent&amp;amp;view=article&amp;amp;id=1&amp;amp;catid=20&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt;, called by your component or any other extension&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$query = array(&#039;view&#039; =&amp;gt; &#039;article&#039;, &#039;id&#039; =&amp;gt; 1, &#039;catid&#039; =&amp;gt; 20)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Your router&#039;s &amp;lt;code&amp;gt;com_yourcomponentBuildRoute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$segments = array(20, 1);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Joomla&#039;s internal route building (for display)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second function, &amp;lt;code&amp;gt;[componentname]ParseRoute($segments)&amp;lt;/code&amp;gt;, must transform an array of segments back into an array of URL parameters. Schematically:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Joomla&#039;s internal route parsing&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$segments = array(20, 1);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Your router&#039;s &amp;lt;code&amp;gt;com_yourcomponentParseRoute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$query = array(&#039;view&#039; =&amp;gt; &#039;article&#039;, &#039;id&#039; =&amp;gt; 1, &#039;catid&#039; =&amp;gt; 20)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two functions must cooperate in such a way that the original URL can be reconstructed. You can think of &amp;lt;code&amp;gt;BuildRoute&amp;lt;/code&amp;gt; as a form of [[wikipedia:Encoding|encoding]] and &amp;lt;code&amp;gt;ParseRoute&amp;lt;/code&amp;gt; as the corresponding decoding. When the original URL isn&#039;t properly reproduced, your component will stop working.&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Data for Routing ==&lt;br /&gt;
&lt;br /&gt;
=== The Alias ===&lt;br /&gt;
&lt;br /&gt;
The first step is the generation of the so called alias. The alias is used in the URL instead of the title (the alias is the text you want to have in the URL). The alias has to be URI safe, which means accented UTF­8 characters are replaced by their ASCII­7 equivalents, white spaces by hyphens, etc.&lt;br /&gt;
&lt;br /&gt;
The alias can be defined by the user, but you should ensure that the above requirements for a URL safe alias are met. A good way to do so is to use the JTable::check() method during the save process. Have a look at this example code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function check()&lt;br /&gt;
{&lt;br /&gt;
    jimport( &#039;joomla.filter.output&#039; );&lt;br /&gt;
    if(empty($this-&amp;gt;alias)) {&lt;br /&gt;
	    $this-&amp;gt;alias = $this-&amp;gt;title;&lt;br /&gt;
    }&lt;br /&gt;
    $this-&amp;gt;alias = JFilterOutput::stringURLSafe($this-&amp;gt;alias);&lt;br /&gt;
&lt;br /&gt;
    /* All your other checks */&lt;br /&gt;
    return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the alias field is empty the title will be used as alias. Then the alias will be made URLSafe using the &amp;lt;code&amp;gt;JFilterOutput::stringURLSafe()&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
=== The Slug ===&lt;br /&gt;
&lt;br /&gt;
Continuing with the same example, the &amp;quot;slug&amp;quot; - &amp;quot;1­:welcome­-to­-joomla&amp;quot; has two parts. The first part is the article identifier (id) and the second is the alias. They are separated by a colon. These two elements were combined during the database query in the model:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$query = &#039;SELECT a.*, &#039;.&lt;br /&gt;
         &#039;CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(&amp;quot;:&amp;quot;, a.id, a.alias) ELSE a.id END as slug,&#039;&lt;br /&gt;
         /*...*/;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this step the slug is used instead of the id.&lt;br /&gt;
&lt;br /&gt;
== Routing URLs ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; method translates the internal Joomla! URL to a custom URL. &amp;lt;tt&amp;gt;JRoute&amp;lt;/tt&amp;gt; has three parameters and its prototype is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;JRoute::_( $url, $xhtml = true, $ssl=null );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;$url&amp;lt;/code&amp;gt; is a string containing the absolute or relative internal Joomla! URL.&lt;br /&gt;
* &amp;lt;code&amp;gt;$xhtml&amp;lt;/code&amp;gt; is a boolean value that specifies whether or not the output should be in XHTML. This parameter is optional and if omitted defaults to true.&lt;br /&gt;
* &amp;lt;code&amp;gt;$ssl&amp;lt;/code&amp;gt; is an integer value that specifies whether the URI should be secure. It should be set to 1 to force the URI to be secure using the global secure site URI, 0 to leave it in the same state as when it was passed, and -1 to force the URI to be unsecure using the global unsecure site URI.&lt;br /&gt;
&lt;br /&gt;
The most important parameter is &amp;lt;code&amp;gt;$url&amp;lt;/code&amp;gt;. A call to this method might look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;JRoute::_( &#039;index.php?view=article&amp;amp;id=&#039;.$row-&amp;gt;slug );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$row-­&amp;gt;slug&amp;lt;/code&amp;gt; is the value that was generated in step 2 from a combination of id and title alias.&lt;br /&gt;
&lt;br /&gt;
Another advantage of using JRoute is that the router now handles $option (the component name) and the $Itemid (the menu item ID). The component itself doesn’t have to know its name ($option) or the active menu item ($Itemid) like it did in previous version of Joomla!.&lt;br /&gt;
&lt;br /&gt;
It is important that you think about the sequence of the URL parameter in this stage. This will be more clear when we have a deeper look at the router.php in the next section.&lt;br /&gt;
&lt;br /&gt;
The building process of JRouter is divided into two steps:&lt;br /&gt;
&lt;br /&gt;
* Create the application route. The application route is fully handled by JRouter and the component developer doesn’t have to do anything to make it work.&lt;br /&gt;
* Create the component route. To create the component route, JRouter looks for the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; in the component directory which is responsible for building the route for the component.&lt;br /&gt;
&lt;br /&gt;
== The Component Router ==&lt;br /&gt;
&lt;br /&gt;
We will have two functions in the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt;. One is responsible for building the URL and the other is responsible for parsing it. In the next examples, a very basic and a more advanced one, we assume that we have three views that links can point to. The first is a categories overview (&amp;lt;code&amp;gt;view=categories&amp;lt;/code&amp;gt;), the second is a single category (&amp;lt;code&amp;gt;view=category&amp;lt;/code&amp;gt;) and the third is a single article (&amp;lt;code&amp;gt;view=article&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The file &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; should be in the site area of your component. It is not used on admin/backend pages. Don&#039;t forget to add it to your XML [[Manifest files|manifest file]] in the site folder.&lt;br /&gt;
&lt;br /&gt;
=== A Simple Example ===&lt;br /&gt;
&lt;br /&gt;
This simple example will illustrate the basics of implementing a router for your component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]BuildRoute( &amp;amp;$query )&lt;br /&gt;
{&lt;br /&gt;
       $segments = array();&lt;br /&gt;
       if(isset($query[&#039;view&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;view&#039;];&lt;br /&gt;
                unset( $query[&#039;view&#039;] );&lt;br /&gt;
       }&lt;br /&gt;
       if(isset($query[&#039;id&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;id&#039;];&lt;br /&gt;
                unset( $query[&#039;id&#039;] );&lt;br /&gt;
       };&lt;br /&gt;
       return $segments;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; passes a $query array to the &amp;lt;code&amp;gt;[&#039;&#039;componentname&#039;&#039;]BuildRoute&amp;lt;/code&amp;gt; function. This function will add the relevant parts of the array to the $segments array in the right order and will return the properly ordered array. The content of the &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array needs to be unset, otherwise &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; will add it to the URL in the form of a query string (i.e. any variables that are not handled by the router will be passed in the query string).&lt;br /&gt;
&lt;br /&gt;
The prefix &#039;&#039;componentname&#039;&#039; is the name for your component, as found in the directory holding the component&#039;s files. For instance, a component &amp;quot;Magic&amp;quot; in directory &amp;lt;tt&amp;gt;/components/com_magic/...&amp;lt;/tt&amp;gt; would use a prefix &amp;lt;code&amp;gt;magic&amp;lt;/code&amp;gt; (all lower case).&lt;br /&gt;
&lt;br /&gt;
The next function in the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; parses the URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]ParseRoute( $segments )&lt;br /&gt;
{&lt;br /&gt;
       $vars = array();&lt;br /&gt;
       switch($segments[0])&lt;br /&gt;
       {&lt;br /&gt;
               case &#039;categories&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;categories&#039;;&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;category&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;category&#039;;&lt;br /&gt;
                       $id = explode( &#039;:&#039;, $segments[1] );&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;article&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       $id = explode( &#039;:&#039;, $segments[1] );&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
       }&lt;br /&gt;
       return $vars;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What happens here? In the function &amp;lt;code&amp;gt;[&#039;&#039;componentname&#039;&#039;]BuildRoute&amp;lt;/code&amp;gt; we arranged the items in the &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array in a specific sequence. This means that in this example the view is first and the id is second in the array.&lt;br /&gt;
&lt;br /&gt;
By reading &amp;lt;code&amp;gt;$segments[0]&amp;lt;/code&amp;gt;, we access the name of the view. We set the right view and/or identifier depending on its value and we return the &amp;lt;code&amp;gt;$vars&amp;lt;/code&amp;gt; array to &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt;. $vars should be an associative array similar to the array that was passed to the BuildRoute method.&lt;br /&gt;
&lt;br /&gt;
The above example of the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; is a very simple way to generate sef URL&#039;s but should show how this works quite clearly.&lt;br /&gt;
&lt;br /&gt;
The generated URL in this example contains the name of the view and doesn&#039;t reflect the content hierarchy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[view]/[slug]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A More Advanced Example ===&lt;br /&gt;
&lt;br /&gt;
In the next example we will try to get rid of the need for the view and we will try to reflect the current hierarchy level in the URL.&lt;br /&gt;
&lt;br /&gt;
The goal is URL&#039;s that look like:&lt;br /&gt;
&lt;br /&gt;
* When viewing an article: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[category]/[article]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* When viewing a category: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[category]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* When viewing the categories overview: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have done step 1 and 2 also for the category.&lt;br /&gt;
&lt;br /&gt;
The link to the article would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JRoute::_( &#039;index.php?view=article&amp;amp;catid=&#039;.$row-­&amp;gt;catslug .&#039;&amp;amp;id=&#039;.$row-­&amp;gt;slug );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the Link to the category would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JRoute::_( &#039;index.php?view=category&amp;amp;id=&#039;.$row-&amp;gt;catslug );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function [&#039;&#039;Componentname&#039;&#039;]BuildRoute(&amp;amp;$query)&lt;br /&gt;
{&lt;br /&gt;
       $segments = array();&lt;br /&gt;
       if(isset( $query[&#039;catid&#039;] ))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;catid&#039;];&lt;br /&gt;
                unset( $query[&#039;catid&#039;] );&lt;br /&gt;
       };&lt;br /&gt;
       if( isset($query[&#039;id&#039;]) )&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;id&#039;];&lt;br /&gt;
                unset( $query[&#039;id&#039;] );&lt;br /&gt;
       };&lt;br /&gt;
       unset( $query[&#039;view&#039;] );&lt;br /&gt;
       return $segments;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The difference now is that we don’t add the name of the view to the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array. We still unset the view key since otherwise, &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; would add it to the URL as part of the query string. Another new thing here is the additional parameter catid that we push into the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [&#039;&#039;Componentname&#039;&#039;]ParseRoute($segments)&lt;br /&gt;
{&lt;br /&gt;
       $vars = array();&lt;br /&gt;
       $app =&amp;amp; JFactory::getApplication();&lt;br /&gt;
       $menu =&amp;amp; $app-&amp;gt;getMenu();&lt;br /&gt;
       $item =&amp;amp; $menu-&amp;gt;getActive();&lt;br /&gt;
       // Count segments&lt;br /&gt;
       $count = count( $segments );&lt;br /&gt;
       //Handle View and Identifier&lt;br /&gt;
       switch( $item-&amp;gt;query[&#039;view&#039;] )&lt;br /&gt;
       {&lt;br /&gt;
               case &#039;categories&#039;:&lt;br /&gt;
                       if($count == 1) {&lt;br /&gt;
                               $vars[&#039;view&#039;] = &#039;category&#039;;&lt;br /&gt;
                       }&lt;br /&gt;
                       if($count == 2) {&lt;br /&gt;
                               $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       }&lt;br /&gt;
                       $id = explode( &#039;:&#039;, $segments[$count-1] );&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;category&#039;:&lt;br /&gt;
                       $id   = explode( &#039;:&#039;, $segments[$count-1] );&lt;br /&gt;
                       $vars[&#039;id&#039;]   = (int) $id[0];&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       break;&lt;br /&gt;
       }&lt;br /&gt;
       return $vars;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this ParseRoute function has a lot of different code parts in comparison to the previous. The reason for this is simple. We don’t have the name of the view in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array and we need to find another way to determine it.&lt;br /&gt;
&lt;br /&gt;
We need to find out which level of hierarchy we are in by receiving the root element. We do this by looking to the view name of the active menu item:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$item-­&amp;gt;query[&#039;view&#039;]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also we need to know the number of items in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$count = count( $segments );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this information we can correctly set the view for all possible three cases:&lt;br /&gt;
&lt;br /&gt;
* The menu item is a link to the categories view and the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array has two items (&amp;lt;code&amp;gt;$catid&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt;). In this case we know that we need to parse a link to an article.&lt;br /&gt;
* The menu item is a link to the categories view and the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array has one item (&amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt;). In this case we know that we need to parse a link to a category.&lt;br /&gt;
* The menu item is a link to a category. In this case, we know that any item in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array is the identifier for an article.&lt;br /&gt;
&lt;br /&gt;
The result of all this code is clean and human-readable component URLs.&lt;br /&gt;
&lt;br /&gt;
== Routers and Menu Items ==&lt;br /&gt;
&lt;br /&gt;
A last important part of creating a router is considering what to do with menu items. As explained on [[Search Engine Friendly URLs]], the output of the component router is used &#039;&#039;after&#039;&#039; the first segment of a route, the first segment being the menu item&#039;s alias. This creates a difficult question: how is your router and/or other code to know which menu item to route through?&lt;br /&gt;
&lt;br /&gt;
Suppose, for example, that your component is currently producing output for the page &amp;lt;tt&amp;gt;/dogs&amp;lt;/tt&amp;gt;, which lists all dogs in the system. Of course, the items in the list need to be links to pages that display more details about one dog. What should the URL to the dog with ID 21 and name Fido become? Using a router that works according to the principles we&#039;ve seen so far, the route that is produced is &amp;lt;tt&amp;gt;dogs/21-fido&amp;lt;/tt&amp;gt;, or with some additional work &amp;lt;tt&amp;gt;/dogs/fido&amp;lt;/tt&amp;gt;. But perhaps the user has created a menu item with the alias &amp;lt;tt&amp;gt;mydoggy&amp;lt;/tt&amp;gt; which displays exactly that dog&#039;s details. Then it is probably the user&#039;s intention to route this URL through that menu item, and the item in the list should link to the page &amp;lt;tt&amp;gt;/mydoggy&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
More generally, whenever you are building a route, you will need to find the menu item that is most suitable as a &#039;&#039;starting point&#039;&#039; for building your route. The term &#039;&#039;starting point&#039;&#039; is emphasized because the rest of the route depends on the configuration of the menu item. In our example above, &amp;lt;tt&amp;gt;/dogs/21-fido&amp;lt;/tt&amp;gt; is an acceptable route, &amp;lt;tt&amp;gt;/mydoggy&amp;lt;/tt&amp;gt; is arguably even better, but &amp;lt;tt&amp;gt;/mydoggy/21-fido&amp;lt;/tt&amp;gt; is simply wrong, since &amp;lt;tt&amp;gt;/mydoggy&amp;lt;/tt&amp;gt; is in itself a menu item that is set up to display &amp;lt;tt&amp;gt;fido&amp;lt;/tt&amp;gt;&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Several approaches are available to tackle this problem. Joomla!&#039;s core components take a mixed approach, separating responsibilities in two units of code: the router itself and the so-called &amp;lt;code&amp;gt;[componentname]RouteHelper&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;[componentname]RouteHelper&amp;lt;/code&amp;gt; provides methods that find the most suitable menu item for a given piece of data to be displayed, while the router analyzes the menu item and puts any information that is not determined by the menu item&#039;s configuration into the route. This does mean that the &#039;&#039;calling code&#039;&#039; must explicitly call the helper&#039;s method before routing (&amp;lt;code&amp;gt;echo JRoute::_(DogsRouteHelper::getDogRoute(21));&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
There is a useful thread on this subject here: [[jtopic:148632]] (note, may be out of date)&lt;br /&gt;
&lt;br /&gt;
For details on the internals of routing, see [[Routing implementation details]].&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Tutorials]][[Category:Component Development]][[Category:Search Engine Friendly URLs]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Search_Engine_Friendly_URLs&amp;diff=77744</id>
		<title>Search Engine Friendly URLs</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Search_Engine_Friendly_URLs&amp;diff=77744"/>
		<updated>2012-11-25T17:03:57Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Improved wording&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Search engine friendly (SEF)&#039;&#039;&#039;, &#039;&#039;&#039;human-readable&#039;&#039;&#039; or  [[wikipedia:Clean_URL|clean URLs]] are URLs that make sense to both humans and search engines because they explain the path to the particular page they point to. Since version 1.5, Joomla! is capable of creating and parsing URLs in any format, including SEF URLs. This does not depend on URL rewriting executed by the web server, so it works even if Joomla! runs a server other than Apache with the mod_rewrite module. The SEF URLs follow a certain fixed pattern, but the user can define a [[Alias|short descriptive text (alias)]] for each segment of the URL.&lt;br /&gt;
&lt;br /&gt;
Internally, the local part of a SEF URL (the part after the domain name) is called a &#039;&#039;&#039;route&#039;&#039;&#039;. Creating and processing SEF URLs is therefore referred to as &#039;&#039;&#039;routing&#039;&#039;&#039;, and the relevant code is called a &#039;&#039;&#039;router&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
A good example of routing is the URL to &amp;quot;Welcome to Joomla!&amp;quot; article in the sample data.&lt;br /&gt;
&lt;br /&gt;
* Without SEF URLs turned on, the URL is &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_content&amp;amp;view=article&amp;amp;id=1:welcome-to-joomla&amp;amp;catid=1:latest-news&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* With SEF URLs on and mod_rewrite off, it&#039;s &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php/the-­news/1-­latest­-news/1­-welcome­-to­-joomla&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* With both SEF URLs and mod_rewrite on, it&#039;s &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/the-­news/1­-latest-­news/1-­welcome-­to­-joomla&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Search engine friendly URLs can be activated by turning on the &#039;&#039;&#039;Search Engine Friendly URLs&#039;&#039;&#039; option in the &#039;&#039;Global Configuration&#039;&#039;. This option is on by default since Joomla! 1.6. See [[Enabling Search Engine Friendly (SEF) URLs]] for more information.&lt;br /&gt;
&lt;br /&gt;
== Frequently Asked Questions ==&lt;br /&gt;
&lt;br /&gt;
=== What do the numbers in the URL mean? ===&lt;br /&gt;
By comparing the old and the new URL we can see numbers in the old URL,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_content&amp;amp;view=article&amp;amp;id=1:welcome-to-joomla&amp;amp;catid=1:latest-news&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but also in the new URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/the-­news/1­-latest-­news/1-­welcome-­to­-joomla&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These numbers are the parameters that are needed by Joomla! to get the internal URL and show the page you want to see. (In this case, the first numeral one is the ID of the category, the second numeral one is the ID of the article.)&lt;br /&gt;
&lt;br /&gt;
=== There is no &amp;lt;tt&amp;gt;index.php&amp;lt;/tt&amp;gt; in the URL anymore. Can I delete the file now? ===&lt;br /&gt;
No! The URL may doesn&#039;t contain the &amp;lt;tt&amp;gt;index.php&amp;lt;/tt&amp;gt; anymore, but internally the mod_rewrite will only redirect to the original path without showing it to you.&lt;br /&gt;
&lt;br /&gt;
=== What is the [[Alias]] value? And how does it get created? ===&lt;br /&gt;
Alias is listed beneath the Title field in Articles, Categories, Sections and Menu Items. Joomla! can automatically create the alias for you. An automatic alias begins with the title. All upper case letters are changed to lower case. Spaces and special characters not allowed in a URL; they are changed to dashes.&lt;br /&gt;
&lt;br /&gt;
=== I want to specify my own value for Alias. ===&lt;br /&gt;
If you do not like the alias provided by Joomla!, you can enter a value of your choosing into that field. Many believe using good keywords in your URL helps search engine optimization. You can do so by including those keywords in your title, and allowing Joomla! to create the alias, or by creating the alias yourself.&lt;br /&gt;
&lt;br /&gt;
=== How is Alias used in a URL? ===&lt;br /&gt;
For a menu item, Joomla! uses the alias as the URL plug. Assume that you use the first two SEF URL options and you create a menu item called Products. Your URL would be example.com/products.&lt;br /&gt;
&lt;br /&gt;
Joomla! also uses the primary key values of data within the URL to help the router navigate to the correct page. Continuing with the previous example, if your products menu item was for an Article­/Category Blog, the link for the Article Title and/or Read More link would have three parts:&lt;br /&gt;
&lt;br /&gt;
* The menu item URL - example.com/products;&lt;br /&gt;
&lt;br /&gt;
* Plus, the primary key for the Category and the Category alias - 32-fruit;&lt;br /&gt;
&lt;br /&gt;
* Plus, the primary key for the Article and the Article alias - 1-apple;&lt;br /&gt;
&lt;br /&gt;
The complete URL is: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://example.com/products/32-fruit/1-apple&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How can I get rid of the numbers in the SEF URLs? ===&lt;br /&gt;
The numbers in the SEF URL are needed by Joomla!&#039;s router to know how to direct site traffic. Once the router logic stabilizes, simple third party system plugins can be developed to augment the router capabilities by allowing more choice. At that time, numbers will likely be removed from the URL.&lt;br /&gt;
&lt;br /&gt;
== Route Formats and the Routing Mechanism ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This section describes Joomla!&#039;s core (built-in) routing mechanism. Routing extensions may change the way routes are created on your system.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Route Formats ===&lt;br /&gt;
&lt;br /&gt;
To describe the Joomla! routing mechanism in more detail, we first need to pin down what we refer to as a &#039;&#039;&#039;route&#039;&#039;&#039;. Suppose that Joomla! has been installed in &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://example.com/sites/first/&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;. The installation path is generally referred to as the &#039;&#039;&#039;base URL&#039;&#039;&#039;. A possible example URL is &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://example.com/sites/first/products/32-fruit/1-apple&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;. The first part of this URL is the aforementioned base URL, and neither Joomla! nor any component router can create URLs with a different first part. The second part, &amp;lt;tt&amp;gt;products/32-fruit/1-apple&amp;lt;/tt&amp;gt;, is a &#039;&#039;&#039;route&#039;&#039;&#039;, consisting of three &#039;&#039;&#039;segment&#039;&#039;&#039;s.&lt;br /&gt;
&lt;br /&gt;
The first segment of a route is, for regular URLs, the alias of a menu item. The SEF URL is said to be &#039;&#039;&#039;routed through&#039;&#039;&#039; that menu item. The other segments are determined entirely by the router of the component that provides the type of the menu item. The &#039;&#039;Category - Blog&#039;&#039; menu item type, for example, is provided by the [[Content]] component, and therefore that component&#039;s router is responsible for building and parsing the remaining segments.&lt;br /&gt;
&lt;br /&gt;
It is also possible (for extensions) to ask the system to create a route without supplying a menu item to route through. In that case, the system will usually decide to create a special route that has the word &amp;lt;tt&amp;gt;component&amp;lt;/tt&amp;gt; as the first segment. These routes are created using a fixed format: the name of the component (without the leading &amp;lt;tt&amp;gt;com_&amp;lt;/tt&amp;gt;) is selected as the second segment and any parameters as the other segments.&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
&lt;br /&gt;
It is important to note creating a menu item is the &#039;&#039;only&#039;&#039; way for a Joomla! user to define a route that leads to a specific component. It is, however, possible to create a route without showing it on the site (in a menu). An often-applied method is to create a menu item in a menu that isn&#039;t displayed anywhere. Such a menu is usually called a [[Menu|hidden menu]].&lt;br /&gt;
&lt;br /&gt;
The previous paragraph implies that it is not possible to make one component responsible for handling all routes. For example, it is not possible to specify that the URL &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://example.com/thealias&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; should display the Content item with the alias &amp;lt;tt&amp;gt;thealias&amp;lt;/tt&amp;gt;, where &amp;lt;tt&amp;gt;thealias&amp;lt;/tt&amp;gt; could be any word. If this needs to be done for a small number of articles, menu items can be created manually for these. Else a routing extension is necessary.&lt;br /&gt;
&lt;br /&gt;
This routing mechanism is therefore not as flexible as users sometimes require. On the other hand, it has one large advantage: it reduces the chance of ambiguous routes (routes that could lead to two different pages). Since the first segment of a route is always a menu item alias, the system immediately knows which component&#039;s router must be used to parse it.&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Handling Routes ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This section describes the routing implementation. If you are a component developer, see [[Supporting SEF URLs in your component]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Joomla routes are created and resolved by [[JRouter|the JRouter class]]. This class looks in the component root of the currently active component (specified in the &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; parameter in the query string) and includes the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; file in that component&#039;s root directory. It then calls one of two functions: one for creating the SEF URL and one for interpreting the SEF URL.&lt;br /&gt;
&lt;br /&gt;
The JRouter class is overridden by the Joomla CMS in &amp;lt;tt&amp;gt;/includes/router.php&amp;lt;/tt&amp;gt;. In this file the build and parse functions are overridden to properly build and parse the URLs for the Joomla CMS.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; file in each component (for example, &amp;lt;tt&amp;gt;/components/com_content/router.php&amp;lt;/tt&amp;gt;) should contain the following two functions:&lt;br /&gt;
* ContentBuildRoute - this builds the SEF URL&lt;br /&gt;
** Parameters&lt;br /&gt;
*** $query - this is a named array containing the querystring variables&lt;br /&gt;
** Returns: an array of segments where each segment is separated by a &#039;/&#039; when later combined to create the actual URL (the items in the array should not contain &#039;/&#039; characters)&lt;br /&gt;
* ContentParseRoute - this interprets an SEF URL&lt;br /&gt;
** Parameters&lt;br /&gt;
*** $segments - this is an array that contains the segments of the URL requested.&lt;br /&gt;
** Returns: a name =&amp;gt; value array of the querystring variables that the link maps to&lt;br /&gt;
&lt;br /&gt;
=== The SEF Plugin ===&lt;br /&gt;
The Joomla &#039;&#039;System - SEF&#039;&#039; plugin inherits &amp;lt;code&amp;gt;JPlugin&amp;lt;/code&amp;gt; and implements the &amp;lt;code&amp;gt;onAfterRender()&amp;lt;/code&amp;gt; function. In this function the body of the response that will be sent to the browser is retrieved using &amp;lt;code&amp;gt;JResponse::getBody()&amp;lt;/code&amp;gt;. The body of the response is then searched for links containing &amp;lt;tt&amp;gt;/index.php...&amp;lt;/tt&amp;gt; and replaces them with a correct SEF URL by calling &amp;lt;code&amp;gt;JRoute::_(&#039;&#039;url&#039;&#039;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
JRoute builds SEF URLs by instantiating a &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; object and requesting that it build the correct link from the passed in URL.&lt;br /&gt;
&lt;br /&gt;
=== Handling SEF URLs ===&lt;br /&gt;
By default the SEF URLs are handled by the &amp;lt;code&amp;gt;JRouterSite&amp;lt;/code&amp;gt; object (from &amp;lt;tt&amp;gt;/includes/router.php&amp;lt;/tt&amp;gt;) and is called by a call to &amp;lt;code&amp;gt;JApplication::route()&amp;lt;/code&amp;gt; in index.php. This call is made on the &amp;lt;code&amp;gt;$app&amp;lt;/code&amp;gt; variable which is actually an instance of &amp;lt;code&amp;gt;JSite&amp;lt;/code&amp;gt; (from &amp;lt;tt&amp;gt;/includes/application.php&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JApplication::route()&amp;lt;/code&amp;gt; has a non-destructive result on the &amp;lt;code&amp;gt;$_GET&amp;lt;/code&amp;gt; array. That is, &amp;lt;code&amp;gt;JApplication::route()&amp;lt;/code&amp;gt; sets variables in &amp;lt;code&amp;gt;$_GET&amp;lt;/code&amp;gt; by calling &amp;lt;code&amp;gt;JRequest::set()&amp;lt;/code&amp;gt; with the overwrite flag set to false. Thus if a variable name is returned from &amp;lt;code&amp;gt;JRouter::route()&amp;lt;/code&amp;gt; that is already in &amp;lt;code&amp;gt;$_GET&amp;lt;/code&amp;gt;, it will not put that value into &amp;lt;code&amp;gt;$_GET&amp;lt;/code&amp;gt;. This allows for custom routing.&lt;br /&gt;
&lt;br /&gt;
=== Custom Routing ===&lt;br /&gt;
Joomla allows you to create your own routing mechanism. In order to create this mechanism you must have a plugin that overrides the &amp;lt;code&amp;gt;JPlugin::onAfterInitialise()&amp;lt;/code&amp;gt; function. This function then parses the URL and creates the needed variables in &amp;lt;code&amp;gt;$_GET&amp;lt;/code&amp;gt; before the standard Joomla routing is done.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;See [[Creating a System Plugin to augment JRouter]] for an example.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Category:Search Engine Friendly URLs| ]]&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Search_Engine_Friendly_URLs&amp;diff=77742</id>
		<title>Search Engine Friendly URLs</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Search_Engine_Friendly_URLs&amp;diff=77742"/>
		<updated>2012-11-25T16:11:58Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Adjusted layout&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Search engine friendly (SEF)&#039;&#039;&#039;, &#039;&#039;&#039;human-readable&#039;&#039;&#039; or  [[wikipedia:Clean_URL|clean URLs]] are URLs that make sense to both humans and search engines because they explain the path to the particular page they point to. Since version 1.5, Joomla! is capable of creating and parsing URLs in any format, including SEF URLs. This does not depend on URL rewriting executed by the web server, so it works even if Joomla! runs a server other than Apache with the mod_rewrite module. The SEF URLs follow a certain fixed pattern, but the user can define a [[Alias|short descriptive text (alias)]] for each segment of the URL.&lt;br /&gt;
&lt;br /&gt;
Internally, the local part of a SEF URL (the part after the domain name) is called a &#039;&#039;&#039;route&#039;&#039;&#039;. Creating and processing SEF URLs is therefore referred to as &#039;&#039;&#039;routing&#039;&#039;&#039;, and the relevant code is called a &#039;&#039;&#039;router&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
A good example of routing is the URL to &amp;quot;Welcome to Joomla!&amp;quot; article in the sample data.&lt;br /&gt;
&lt;br /&gt;
* Without SEF URLs turned on, the URL is &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_content&amp;amp;view=article&amp;amp;id=1:welcome-to-joomla&amp;amp;catid=1:latest-news&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* With SEF URLs on and mod_rewrite off, it&#039;s &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php/the-­news/1-­latest­-news/1­-welcome­-to­-joomla&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* With both SEF URLs and mod_rewrite on, it&#039;s &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/the-­news/1­-latest-­news/1-­welcome-­to­-joomla&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Search engine friendly URLs can be activated by turning on the &#039;&#039;&#039;Search Engine Friendly URLs&#039;&#039;&#039; option in the &#039;&#039;Global Configuration&#039;&#039;. This option is on by default since Joomla! 1.6. See [[Enabling Search Engine Friendly (SEF) URLs]] for more information.&lt;br /&gt;
&lt;br /&gt;
== Frequently Asked Questions ==&lt;br /&gt;
&lt;br /&gt;
=== What do the numbers in the URL mean? ===&lt;br /&gt;
By comparing the old and the new URL we can see numbers in the old URL,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_content&amp;amp;view=article&amp;amp;id=1:welcome-to-joomla&amp;amp;catid=1:latest-news&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but also in the new URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/the-­news/1­-latest-­news/1-­welcome-­to­-joomla&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These numbers are the parameters that are needed by Joomla! to get the internal URL and show the page you want to see. (In this case, the first numeral one is the ID of the category, the second numeral one is the ID of the article.)&lt;br /&gt;
&lt;br /&gt;
=== There is no &amp;lt;tt&amp;gt;index.php&amp;lt;/tt&amp;gt; in the URL anymore. Can I delete the file now? ===&lt;br /&gt;
No! The URL may doesn&#039;t contain the &amp;lt;tt&amp;gt;index.php&amp;lt;/tt&amp;gt; anymore, but internally the mod_rewrite will only redirect to the original path without showing it to you.&lt;br /&gt;
&lt;br /&gt;
=== What is the [[Alias]] value? And how does it get created? ===&lt;br /&gt;
Alias is listed beneath the Title field in Articles, Categories, Sections and Menu Items. Joomla! can automatically create the alias for you. An automatic alias begins with the title. All upper case letters are changed to lower case. Spaces and special characters not allowed in a URL; they are changed to dashes.&lt;br /&gt;
&lt;br /&gt;
=== I want to specify my own value for Alias. ===&lt;br /&gt;
If you do not like the alias provided by Joomla!, you can enter a value of your choosing into that field. Many believe using good keywords in your URL helps search engine optimization. You can do so by including those keywords in your title, and allowing Joomla! to create the alias, or by creating the alias yourself.&lt;br /&gt;
&lt;br /&gt;
=== How is Alias used in a URL? ===&lt;br /&gt;
For a menu item, Joomla! uses the alias as the URL plug. Assume that you use the first two SEF URL options and you create a menu item called Products. Your URL would be example.com/products.&lt;br /&gt;
&lt;br /&gt;
Joomla! also uses the primary key values of data within the URL to help the router navigate to the correct page. Continuing with the previous example, if your products menu item was for an Article­/Category Blog, the link for the Article Title and/or Read More link would have three parts:&lt;br /&gt;
&lt;br /&gt;
* The menu item URL - example.com/products;&lt;br /&gt;
&lt;br /&gt;
* Plus, the primary key for the Category and the Category alias - 32-fruit;&lt;br /&gt;
&lt;br /&gt;
* Plus, the primary key for the Article and the Article alias - 1-apple;&lt;br /&gt;
&lt;br /&gt;
The complete URL is: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://example.com/products/32-fruit/1-apple&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How can I get rid of the numbers in the SEF URLs? ===&lt;br /&gt;
The numbers in the SEF URL are needed by Joomla!&#039;s router to know how to direct site traffic. Once the router logic stabilizes, simple third party system plugins can be developed to augment the router capabilities by allowing more choice. At that time, numbers will likely be removed from the URL.&lt;br /&gt;
&lt;br /&gt;
== Route Formats and the Routing Mechanism ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This section describes Joomla!&#039;s core (built-in) routing mechanism. Routing extensions may change the way routes are created on your system.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Route Formats ===&lt;br /&gt;
&lt;br /&gt;
To describe the Joomla! routing mechanism in more detail, we first need to pin down what we refer to as a &#039;&#039;&#039;route&#039;&#039;&#039;. In our example URL, &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://example.com/sites/first/products/32-fruit/1-apple&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://example.com/sites/first/&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; is the part of the URL that is the same for all URLs managed by a Joomla! installation. It is generally referred to as the &#039;&#039;&#039;base URL&#039;&#039;&#039;. Neither Joomla! nor any component router can create URLs with a different first part. The second part, &amp;lt;tt&amp;gt;products/32-fruit/1-apple&amp;lt;/tt&amp;gt;, is a &#039;&#039;&#039;route&#039;&#039;&#039;, consisting of three &#039;&#039;&#039;segment&#039;&#039;&#039;s.&lt;br /&gt;
&lt;br /&gt;
The first segment of a route is, for regular URLs, the alias of a menu item. The SEF URL is said to be &#039;&#039;&#039;routed through&#039;&#039;&#039; that menu item. The other segments are determined entirely by the router of the component that provides the type of the menu item. The &#039;&#039;Category - Blog&#039;&#039; menu item type, for example, is provided by the [[Content]] component, and therefore that component&#039;s router is responsible for building and parsing the remaining segments.&lt;br /&gt;
&lt;br /&gt;
It is also possible (for extensions) to ask the system to create a route without supplying a menu item to route through. In that case, the system will usually decide to create a special route that has the word &amp;lt;tt&amp;gt;component&amp;lt;/tt&amp;gt; as the first segment. These routes are created using a fixed format: the name of the component (without the leading &amp;lt;tt&amp;gt;com_&amp;lt;/tt&amp;gt;) is selected as the second segment and any parameters as the other segments.&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
&lt;br /&gt;
It is important to note creating a menu item is the &#039;&#039;only&#039;&#039; way for a Joomla! user to define a route that leads to a specific component. It is, however, possible to create a route without showing it on the site (in a menu). An often-applied method is to create a menu item in a menu that isn&#039;t displayed anywhere. Such a menu is usually called a [[Menu|hidden menu]].&lt;br /&gt;
&lt;br /&gt;
The previous paragraph implies that it is not possible to make one component responsible for handling all routes. For example, it is not possible to specify that the URL &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://example.com/thealias&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; should display the Content item with the alias &amp;lt;tt&amp;gt;thealias&amp;lt;/tt&amp;gt;, where &amp;lt;tt&amp;gt;thealias&amp;lt;/tt&amp;gt; could be any word. If this needs to be done for a small number of articles, menu items can be created manually for these. Else a routing extension is necessary.&lt;br /&gt;
&lt;br /&gt;
This routing mechanism is therefore not as flexible as users sometimes require. On the other hand, it has one large advantage: it reduces the chance of ambiguous routes (routes that could lead to two different pages). Since the first segment of a route is always a menu item alias, the system immediately knows which component&#039;s router must be used to parse it.&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Handling Routes ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This section describes the routing implementation. If you are a component developer, see [[Supporting SEF URLs in your component]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Joomla routes are created and resolved by [[JRouter|the JRouter class]]. This class looks in the component root of the currently active component (specified in the &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; parameter in the query string) and includes the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; file in that component&#039;s root directory. It then calls one of two functions: one for creating the SEF URL and one for interpreting the SEF URL.&lt;br /&gt;
&lt;br /&gt;
The JRouter class is overridden by the Joomla CMS in &amp;lt;tt&amp;gt;/includes/router.php&amp;lt;/tt&amp;gt;. In this file the build and parse functions are overridden to properly build and parse the URLs for the Joomla CMS.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; file in each component (for example, &amp;lt;tt&amp;gt;/components/com_content/router.php&amp;lt;/tt&amp;gt;) should contain the following two functions:&lt;br /&gt;
* ContentBuildRoute - this builds the SEF URL&lt;br /&gt;
** Parameters&lt;br /&gt;
*** $query - this is a named array containing the querystring variables&lt;br /&gt;
** Returns: an array of segments where each segment is separated by a &#039;/&#039; when later combined to create the actual URL (the items in the array should not contain &#039;/&#039; characters)&lt;br /&gt;
* ContentParseRoute - this interprets an SEF URL&lt;br /&gt;
** Parameters&lt;br /&gt;
*** $segments - this is an array that contains the segments of the URL requested.&lt;br /&gt;
** Returns: a name =&amp;gt; value array of the querystring variables that the link maps to&lt;br /&gt;
&lt;br /&gt;
=== The SEF Plugin ===&lt;br /&gt;
The Joomla &#039;&#039;System - SEF&#039;&#039; plugin inherits &amp;lt;code&amp;gt;JPlugin&amp;lt;/code&amp;gt; and implements the &amp;lt;code&amp;gt;onAfterRender()&amp;lt;/code&amp;gt; function. In this function the body of the response that will be sent to the browser is retrieved using &amp;lt;code&amp;gt;JResponse::getBody()&amp;lt;/code&amp;gt;. The body of the response is then searched for links containing &amp;lt;tt&amp;gt;/index.php...&amp;lt;/tt&amp;gt; and replaces them with a correct SEF URL by calling &amp;lt;code&amp;gt;JRoute::_(&#039;&#039;url&#039;&#039;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
JRoute builds SEF URLs by instantiating a &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; object and requesting that it build the correct link from the passed in URL.&lt;br /&gt;
&lt;br /&gt;
=== Handling SEF URLs ===&lt;br /&gt;
By default the SEF URLs are handled by the &amp;lt;code&amp;gt;JRouterSite&amp;lt;/code&amp;gt; object (from &amp;lt;tt&amp;gt;/includes/router.php&amp;lt;/tt&amp;gt;) and is called by a call to &amp;lt;code&amp;gt;JApplication::route()&amp;lt;/code&amp;gt; in index.php. This call is made on the &amp;lt;code&amp;gt;$app&amp;lt;/code&amp;gt; variable which is actually an instance of &amp;lt;code&amp;gt;JSite&amp;lt;/code&amp;gt; (from &amp;lt;tt&amp;gt;/includes/application.php&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JApplication::route()&amp;lt;/code&amp;gt; has a non-destructive result on the &amp;lt;code&amp;gt;$_GET&amp;lt;/code&amp;gt; array. That is, &amp;lt;code&amp;gt;JApplication::route()&amp;lt;/code&amp;gt; sets variables in &amp;lt;code&amp;gt;$_GET&amp;lt;/code&amp;gt; by calling &amp;lt;code&amp;gt;JRequest::set()&amp;lt;/code&amp;gt; with the overwrite flag set to false. Thus if a variable name is returned from &amp;lt;code&amp;gt;JRouter::route()&amp;lt;/code&amp;gt; that is already in &amp;lt;code&amp;gt;$_GET&amp;lt;/code&amp;gt;, it will not put that value into &amp;lt;code&amp;gt;$_GET&amp;lt;/code&amp;gt;. This allows for custom routing.&lt;br /&gt;
&lt;br /&gt;
=== Custom Routing ===&lt;br /&gt;
Joomla allows you to create your own routing mechanism. In order to create this mechanism you must have a plugin that overrides the &amp;lt;code&amp;gt;JPlugin::onAfterInitialise()&amp;lt;/code&amp;gt; function. This function then parses the URL and creates the needed variables in &amp;lt;code&amp;gt;$_GET&amp;lt;/code&amp;gt; before the standard Joomla routing is done.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;See [[Creating a System Plugin to augment JRouter]] for an example.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Category:Search Engine Friendly URLs| ]]&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Search_Engine_Friendly_URLs&amp;diff=77741</id>
		<title>Search Engine Friendly URLs</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Search_Engine_Friendly_URLs&amp;diff=77741"/>
		<updated>2012-11-25T15:43:25Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Added information - second attempt&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Search engine friendly (SEF)&#039;&#039;&#039;, &#039;&#039;&#039;human-readable&#039;&#039;&#039; or  [[wikipedia:Clean_URL|clean URLs]] are URLs that make sense to both humans and search engines because they explain the path to the particular page they point to. Since version 1.5, Joomla! is capable of creating and parsing URLs in any format, including SEF URLs. This does not depend on URL rewriting executed by the web server, so it works even if Joomla! runs a server other than Apache with the mod_rewrite module. The SEF URLs follow a certain fixed pattern, but the user can define a [[Alias|short descriptive text (alias)]] for each segment of the URL.&lt;br /&gt;
&lt;br /&gt;
Internally, the local part of a SEF URL (the part after the domain name) is called a &#039;&#039;&#039;route&#039;&#039;&#039;. Creating and processing SEF URLs is therefore referred to as &#039;&#039;&#039;routing&#039;&#039;&#039;, and the relevant code is called a &#039;&#039;&#039;router&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
A good example of routing is the URL to &amp;quot;Welcome to Joomla!&amp;quot; article in the sample data.&lt;br /&gt;
&lt;br /&gt;
* Without SEF URLs turned on, the URL is &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_content&amp;amp;view=article&amp;amp;id=1:welcome-to-joomla&amp;amp;catid=1:latest-news&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* With SEF URLs on and mod_rewrite off, it&#039;s &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php/the-­news/1-­latest­-news/1­-welcome­-to­-joomla&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* With both SEF URLs and mod_rewrite on, it&#039;s &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/the-­news/1­-latest-­news/1-­welcome-­to­-joomla&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Search engine friendly URLs can be activated by turning on the &#039;&#039;&#039;Search Engine Friendly URLs&#039;&#039;&#039; option in the &#039;&#039;Global Configuration&#039;&#039;. This option is on by default since Joomla! 1.6. See [[Enabling Search Engine Friendly (SEF) URLs]] for more information.&lt;br /&gt;
&lt;br /&gt;
== Frequently Asked Questions ==&lt;br /&gt;
&lt;br /&gt;
=== What do the numbers in the URL mean? ===&lt;br /&gt;
By comparing the old and the new URL we can see numbers in the old URL,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_content&amp;amp;view=article&amp;amp;id=1:welcome-to-joomla&amp;amp;catid=1:latest-news&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but also in the new URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/the-­news/1­-latest-­news/1-­welcome-­to­-joomla&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These numbers are the parameters that are needed by Joomla! to get the internal URL and show the page you want to see. (In this case, the first numeral one is the ID of the category, the second numeral one is the ID of the article.)&lt;br /&gt;
&lt;br /&gt;
=== There is no &amp;lt;tt&amp;gt;index.php&amp;lt;/tt&amp;gt; in the URL anymore. Can I delete the file now? ===&lt;br /&gt;
No! The URL may doesn&#039;t contain the &amp;lt;tt&amp;gt;index.php&amp;lt;/tt&amp;gt; anymore, but internally the mod_rewrite will only redirect to the original path without showing it to you.&lt;br /&gt;
&lt;br /&gt;
=== What is the [[Alias]] value? And how does it get created? ===&lt;br /&gt;
Alias is listed beneath the Title field in Articles, Categories, Sections and Menu Items. Joomla! can automatically create the alias for you. An automatic alias begins with the title. All upper case letters are changed to lower case. Spaces and special characters not allowed in a URL; they are changed to dashes.&lt;br /&gt;
&lt;br /&gt;
=== I want to specify my own value for Alias. ===&lt;br /&gt;
If you do not like the alias provided by Joomla!, you can enter a value of your choosing into that field. Many believe using good keywords in your URL helps search engine optimization. You can do so by including those keywords in your title, and allowing Joomla! to create the alias, or by creating the alias yourself.&lt;br /&gt;
&lt;br /&gt;
=== How is Alias used in a URL? ===&lt;br /&gt;
For a menu item, Joomla! uses the alias as the URL plug. Assume that you use the first two SEF URL options and you create a menu item called Products. Your URL would be example.com/products.&lt;br /&gt;
&lt;br /&gt;
Joomla! also uses the primary key values of data within the URL to help the router navigate to the correct page. Continuing with the previous example, if your products menu item was for an Article­/Category Blog, the link for the Article Title and/or Read More link would have three parts:&lt;br /&gt;
&lt;br /&gt;
* The menu item URL - example.com/products;&lt;br /&gt;
&lt;br /&gt;
* Plus, the primary key for the Category and the Category alias - 32-fruit;&lt;br /&gt;
&lt;br /&gt;
* Plus, the primary key for the Article and the Article alias - 1-apple;&lt;br /&gt;
&lt;br /&gt;
The complete URL is: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://example.com/products/32-fruit/1-apple&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How can I get rid of the numbers in the SEF URLs? ===&lt;br /&gt;
The numbers in the SEF URL are needed by Joomla!&#039;s router to know how to direct site traffic. Once the router logic stabilizes, simple third party system plugins can be developed to augment the router capabilities by allowing more choice. At that time, numbers will likely be removed from the URL.&lt;br /&gt;
&lt;br /&gt;
== Route Formats and the Routing Mechanism ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This section describes Joomla!&#039;s core (built-in) routing mechanism. Routing extensions may change the way routes are created on your system.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To describe the Joomla! routing mechanism in more detail, we first need to pin down what we refer to as a &#039;&#039;&#039;route&#039;&#039;&#039;. In our example URL, &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://example.com/sites/first/products/32-fruit/1-apple&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://example.com/sites/first/&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; is the part of the URL that is the same for all URLs managed by a Joomla! installation. It is generally referred to as the &#039;&#039;&#039;base URL&#039;&#039;&#039;. Neither Joomla! nor any component router can create URLs with a different first part. The second part, &amp;lt;tt&amp;gt;products/32-fruit/1-apple&amp;lt;/tt&amp;gt;, is a &#039;&#039;&#039;route&#039;&#039;&#039;, consisting of three &#039;&#039;&#039;segment&#039;&#039;&#039;s.&lt;br /&gt;
&lt;br /&gt;
The first segment of a route is, for regular URLs, the alias of a menu item. The SEF URL is said to be &#039;&#039;&#039;routed through&#039;&#039;&#039; that menu item. The other segments are determined entirely by the router of the component that provides the type of the menu item. The &#039;&#039;Category - Blog&#039;&#039; menu item type, for example, is provided by the [[Content]] component, and therefore that component&#039;s router is responsible for building and parsing the remaining segments.&lt;br /&gt;
&lt;br /&gt;
It is also possible (for extensions) to ask the system to create a route without supplying a menu item to route through. In that case, the system will usually decide to create a special route that has the word &amp;lt;tt&amp;gt;component&amp;lt;/tt&amp;gt; as the first segment. These routes are created using a fixed format: the name of the component (without the leading &amp;lt;tt&amp;gt;com_&amp;lt;/tt&amp;gt;) is selected as the second segment and any parameters as the other segments.&lt;br /&gt;
&lt;br /&gt;
It is important to note creating a menu item is the &#039;&#039;only&#039;&#039; way for a Joomla! user to define a route that leads to a specific component. It is, however, possible to create a route without showing it on the site (in a menu). An often-applied method is to create a menu item in a menu that isn&#039;t displayed anywhere. Such a menu is usually called a [[Menu|hidden menu]].&lt;br /&gt;
&lt;br /&gt;
The previous paragraph implies that it is not possible to make one component responsible for handling all routes. For example, it is not possible to specify that the URL &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://example.com/thealias&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; should display the Content item with the alias &amp;lt;tt&amp;gt;thealias&amp;lt;/tt&amp;gt;, where &amp;lt;tt&amp;gt;thealias&amp;lt;/tt&amp;gt; could be any word. If this needs to be done for a small number of articles, menu items can be created manually for these. Else a routing extension is necessary.&lt;br /&gt;
&lt;br /&gt;
This routing mechanism is therefore not as flexible as users sometimes require. On the other hand, it has one large advantage: it reduces the chance of ambiguous routes (routes that could lead to two different pages). Since the first segment of a route is always a menu item alias, the system immediately knows which component&#039;s router must be used to parse it.&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Joomla Routes ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This section describes the routing implementation. If you are a component developer, see [[Supporting SEF URLs in your component]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Joomla routes are created and resolved by [[JRouter|the JRouter class]]. This class looks in the component root of the currently active component (specified in the &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; parameter in the query string) and includes the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; file in that component&#039;s root directory. It then calls one of two functions: one for creating the SEF URL and one for interpreting the SEF URL.&lt;br /&gt;
&lt;br /&gt;
The JRouter class is overridden by the Joomla CMS in &amp;lt;tt&amp;gt;/includes/router.php&amp;lt;/tt&amp;gt;. In this file the build and parse functions are overridden to properly build and parse the URLs for the Joomla CMS.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; file in each component (for example, &amp;lt;tt&amp;gt;/components/com_content/router.php&amp;lt;/tt&amp;gt;) should contain the following two functions:&lt;br /&gt;
* ContentBuildRoute - this builds the SEF URL&lt;br /&gt;
** Parameters&lt;br /&gt;
*** $query - this is a named array containing the querystring variables&lt;br /&gt;
** Returns: an array of segments where each segment is separated by a &#039;/&#039; when later combined to create the actual URL (the items in the array should not contain &#039;/&#039; characters)&lt;br /&gt;
* ContentParseRoute - this interprets an SEF URL&lt;br /&gt;
** Parameters&lt;br /&gt;
*** $segments - this is an array that contains the segments of the URL requested.&lt;br /&gt;
** Returns: a name =&amp;gt; value array of the querystring variables that the link maps to&lt;br /&gt;
&lt;br /&gt;
=== The SEF Plugin ===&lt;br /&gt;
The Joomla &#039;&#039;System - SEF&#039;&#039; plugin inherits &amp;lt;code&amp;gt;JPlugin&amp;lt;/code&amp;gt; and implements the &amp;lt;code&amp;gt;onAfterRender()&amp;lt;/code&amp;gt; function. In this function the body of the response that will be sent to the browser is retrieved using &amp;lt;code&amp;gt;JResponse::getBody()&amp;lt;/code&amp;gt;. The body of the response is then searched for links containing &amp;lt;tt&amp;gt;/index.php...&amp;lt;/tt&amp;gt; and replaces them with a correct SEF URL by calling &amp;lt;code&amp;gt;JRoute::_(&#039;&#039;url&#039;&#039;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
JRoute builds SEF URLs by instantiating a &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; object and requesting that it build the correct link from the passed in URL.&lt;br /&gt;
&lt;br /&gt;
=== Handling SEF URLs ===&lt;br /&gt;
By default the SEF URLs are handled by the &amp;lt;code&amp;gt;JRouterSite&amp;lt;/code&amp;gt; object (from &amp;lt;tt&amp;gt;/includes/router.php&amp;lt;/tt&amp;gt;) and is called by a call to &amp;lt;code&amp;gt;JApplication::route()&amp;lt;/code&amp;gt; in index.php. This call is made on the &amp;lt;code&amp;gt;$app&amp;lt;/code&amp;gt; variable which is actually an instance of &amp;lt;code&amp;gt;JSite&amp;lt;/code&amp;gt; (from &amp;lt;tt&amp;gt;/includes/application.php&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JApplication::route()&amp;lt;/code&amp;gt; has a non-destructive result on the &amp;lt;code&amp;gt;$_GET&amp;lt;/code&amp;gt; array. That is, &amp;lt;code&amp;gt;JApplication::route()&amp;lt;/code&amp;gt; sets variables in &amp;lt;code&amp;gt;$_GET&amp;lt;/code&amp;gt; by calling &amp;lt;code&amp;gt;JRequest::set()&amp;lt;/code&amp;gt; with the overwrite flag set to false. Thus if a variable name is returned from &amp;lt;code&amp;gt;JRouter::route()&amp;lt;/code&amp;gt; that is already in &amp;lt;code&amp;gt;$_GET&amp;lt;/code&amp;gt;, it will not put that value into &amp;lt;code&amp;gt;$_GET&amp;lt;/code&amp;gt;. This allows for custom routing.&lt;br /&gt;
&lt;br /&gt;
=== Custom Routing ===&lt;br /&gt;
Joomla allows you to create your own routing mechanism. In order to create this mechanism you must have a plugin that overrides the &amp;lt;code&amp;gt;JPlugin::onAfterInitialise()&amp;lt;/code&amp;gt; function. This function then parses the URL and creates the needed variables in &amp;lt;code&amp;gt;$_GET&amp;lt;/code&amp;gt; before the standard Joomla routing is done.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;See [[Creating a System Plugin to augment JRouter]] for an example.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Category:Search Engine Friendly URLs| ]]&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J2.5:Supporting_SEF_URLs_in_your_component&amp;diff=77734</id>
		<title>J2.5:Supporting SEF URLs in your component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J2.5:Supporting_SEF_URLs_in_your_component&amp;diff=77734"/>
		<updated>2012-11-25T00:55:35Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Split off parts to Routing implementation details&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete}}&lt;br /&gt;
{{:Search Engine Friendly URLs}}&lt;br /&gt;
In Joomla!, each [[component]] is responsible for handling its own SEF URLs. Therefore, as the [[Developers|developer]] of a component, you will have to create your own &#039;&#039;&#039;router&#039;&#039;&#039; to allow your component to use SEF URLs.&lt;br /&gt;
&lt;br /&gt;
== The Concept ==&lt;br /&gt;
&lt;br /&gt;
Assuming you are following standard development practices, your component is probably using &amp;quot;system URLs&amp;quot; that look a lot like &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_yourcomponent&amp;amp;view=article&amp;amp;id=1&amp;amp;catid=20&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;, and your goal is to transform this into &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;. As the developer, you have two tasks: signalling the system that certain pieces of text are URLs and need to be transformed, and explaining the system how to transform URLs.&lt;br /&gt;
&lt;br /&gt;
=== Applying &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
It is difficult and inefficient for Joomla! to figure out which parts of your component&#039;s output are URLs. To support SEF URLs, you will need to change URL-generating code so that it applies &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; before outputting the URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
echo JRoute::_(&#039;index.php?view=article&amp;amp;id=1&amp;amp;catid=20&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that it is possible to leave out the parameters &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; defaults to the name of the component currently being executed, and &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt; defaults to the current menu item&#039;s ID.&lt;br /&gt;
&lt;br /&gt;
In general, you should only apply this to URLs that users and/or search engines are able to see. For example, there is no need to transform URLs used in redirects that immediately result in other redirects.&lt;br /&gt;
&lt;br /&gt;
If the user turns off SEF URLs in the site&#039;s settings, &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; will produce working non-SEF URLs without any changes to the code.&lt;br /&gt;
&lt;br /&gt;
=== Writing a router ===&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also need to write a router, which is a single file with two functions that convert system URLs to and from SEF URLs. This file needs to be placed at &amp;lt;tt&amp;gt;/components/com_yourcomponent/router.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The first function, &amp;lt;code&amp;gt;[componentname]BuildRoute(&amp;amp;$query)&amp;lt;/code&amp;gt;, must transform an array of URL parameters into an array of segments that will form the SEF URL. Schematically, the transformation works as follows:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_yourcomponent&amp;amp;view=article&amp;amp;id=1&amp;amp;catid=20&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt;, called by your component or any other extension&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$query = array(&#039;view&#039; =&amp;gt; &#039;article&#039;, &#039;id&#039; =&amp;gt; 1, &#039;catid&#039; =&amp;gt; 20)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Your router&#039;s &amp;lt;code&amp;gt;com_yourcomponentBuildRoute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$segments = array(20, 1);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Joomla&#039;s internal routing (for display)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second function, &amp;lt;code&amp;gt;[componentname]ParseRoute($segments)&amp;lt;/code&amp;gt;, must transform an array of segments back into an array of URL parameters. Schematically:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Joomla&#039;s internal routing&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$segments = array(20, 1);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Your router&#039;s &amp;lt;code&amp;gt;com_yourcomponentParseRoute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$query = array(&#039;view&#039; =&amp;gt; &#039;article&#039;, &#039;id&#039; =&amp;gt; 1, &#039;catid&#039; =&amp;gt; 20)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two functions must cooperate in such a way that the original URL can be reconstructed. You can think of &amp;lt;code&amp;gt;BuildRoute&amp;lt;/code&amp;gt; as a form of [[wikipedia:Encoding|encoding]] and &amp;lt;code&amp;gt;ParseRoute&amp;lt;/code&amp;gt; as the corresponding decoding. When the original URL isn&#039;t properly reproduced, your component will stop working.&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Data for Routing ==&lt;br /&gt;
&lt;br /&gt;
=== The Alias ===&lt;br /&gt;
&lt;br /&gt;
The first step is the generation of the so called alias. The alias is used in the URL instead of the title (the alias is the text you want to have in the URL). The alias has to be URI safe, which means accented UTF­8 characters are replaced by their ASCII­7 equivalents, white spaces by hyphens, etc.&lt;br /&gt;
&lt;br /&gt;
The alias can be defined by the user, but you should ensure that the above requirements for a URL safe alias are met. A good way to do so is to use the JTable::check() method during the save process. Have a look at this example code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function check()&lt;br /&gt;
{&lt;br /&gt;
    jimport( &#039;joomla.filter.output&#039; );&lt;br /&gt;
    if(empty($this-&amp;gt;alias)) {&lt;br /&gt;
	    $this-&amp;gt;alias = $this-&amp;gt;title;&lt;br /&gt;
    }&lt;br /&gt;
    $this-&amp;gt;alias = JFilterOutput::stringURLSafe($this-&amp;gt;alias);&lt;br /&gt;
&lt;br /&gt;
    /* All your other checks */&lt;br /&gt;
    return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the alias field is empty the title will be used as alias. Then the alias will be made URLSafe using the &amp;lt;code&amp;gt;JFilterOutput::stringURLSafe()&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
=== The Slug ===&lt;br /&gt;
&lt;br /&gt;
Continuing with the same example, the &amp;quot;slug&amp;quot; - &amp;quot;1­:welcome­-to­-joomla&amp;quot; has two parts. The first part is the article identifier (id) and the second is the alias. They are separated by a colon. These two elements were combined during the database query in the model:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$query = &#039;SELECT a.*, &#039;.&lt;br /&gt;
         &#039;CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(&amp;quot;:&amp;quot;, a.id, a.alias) ELSE a.id END as slug,&#039;&lt;br /&gt;
         /*...*/;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this step the slug is used instead of the id.&lt;br /&gt;
&lt;br /&gt;
== Routing URLs ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; method translates the internal Joomla! URL to a custom URL. &amp;lt;tt&amp;gt;JRoute&amp;lt;/tt&amp;gt; has three parameters and its prototype is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;JRoute::_( $url, $xhtml = true, $ssl=null );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;$url&amp;lt;/code&amp;gt; is a string containing the absolute or relative internal Joomla! URL.&lt;br /&gt;
* &amp;lt;code&amp;gt;$xhtml&amp;lt;/code&amp;gt; is a boolean value that specifies whether or not the output should be in XHTML. This parameter is optional and if omitted defaults to true.&lt;br /&gt;
* &amp;lt;code&amp;gt;$ssl&amp;lt;/code&amp;gt; is an integer value that specifies whether the URI should be secure. It should be set to 1 to force the URI to be secure using the global secure site URI, 0 to leave it in the same state as when it was passed, and -1 to force the URI to be unsecure using the global unsecure site URI.&lt;br /&gt;
&lt;br /&gt;
The most important parameter is &amp;lt;code&amp;gt;$url&amp;lt;/code&amp;gt;. A call to this method might look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;JRoute::_( &#039;index.php?view=article&amp;amp;id=&#039;.$row-&amp;gt;slug );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$row-­&amp;gt;slug&amp;lt;/code&amp;gt; is the value that was generated in step 2 from a combination of id and title alias.&lt;br /&gt;
&lt;br /&gt;
Another advantage of using JRoute is that the router now handles $option (the component name) and the $Itemid (the menu item ID). The component itself doesn’t have to know its name ($option) or the active menu item ($Itemid) like it did in previous version of Joomla!.&lt;br /&gt;
&lt;br /&gt;
It is important that you think about the sequence of the URL parameter in this stage. This will be more clear when we have a deeper look at the router.php in the next section.&lt;br /&gt;
&lt;br /&gt;
The building process of JRouter is divided into two steps:&lt;br /&gt;
&lt;br /&gt;
* Create the application route. The application route is fully handled by JRouter and the component developer doesn’t have to do anything to make it work.&lt;br /&gt;
* Create the component route. To create the component route, JRouter looks for the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; in the component directory which is responsible for building the route for the component.&lt;br /&gt;
&lt;br /&gt;
== The Component Router ==&lt;br /&gt;
&lt;br /&gt;
We will have two functions in the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt;. One is responsible for building the URL and the other is responsible for parsing it. In the next examples, a very basic and a more advanced one, we assume that we have three views that links can point to. The first is a categories overview (&amp;lt;code&amp;gt;view=categories&amp;lt;/code&amp;gt;), the second is a single category (&amp;lt;code&amp;gt;view=category&amp;lt;/code&amp;gt;) and the third is a single article (&amp;lt;code&amp;gt;view=article&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The file &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; should be in the site area of your component. It is not used on admin/backend pages. Don&#039;t forget to add it to your XML [[Manifest files|manifest file]] in the site folder.&lt;br /&gt;
&lt;br /&gt;
=== A Simple Example ===&lt;br /&gt;
&lt;br /&gt;
This simple example will illustrate the basics of implementing a router for your component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]BuildRoute( &amp;amp;$query )&lt;br /&gt;
{&lt;br /&gt;
       $segments = array();&lt;br /&gt;
       if(isset($query[&#039;view&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;view&#039;];&lt;br /&gt;
                unset( $query[&#039;view&#039;] );&lt;br /&gt;
       }&lt;br /&gt;
       if(isset($query[&#039;id&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;id&#039;];&lt;br /&gt;
                unset( $query[&#039;id&#039;] );&lt;br /&gt;
       };&lt;br /&gt;
       return $segments;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; passes a $query array to the &amp;lt;code&amp;gt;[&#039;&#039;componentname&#039;&#039;]BuildRoute&amp;lt;/code&amp;gt; function. This function will add the relevant parts of the array to the $segments array in the right order and will return the properly ordered array. The content of the &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array needs to be unset, otherwise &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; will add it to the URL in the form of a query string (i.e. any variables that are not handled by the router will be passed in the query string).&lt;br /&gt;
&lt;br /&gt;
The prefix &#039;&#039;componentname&#039;&#039; is the name for your component, as found in the directory holding the component&#039;s files. For instance, a component &amp;quot;Magic&amp;quot; in directory &amp;lt;tt&amp;gt;/components/com_magic/...&amp;lt;/tt&amp;gt; would use a prefix &amp;lt;code&amp;gt;magic&amp;lt;/code&amp;gt; (all lower case).&lt;br /&gt;
&lt;br /&gt;
The next function in the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; parses the URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]ParseRoute( $segments )&lt;br /&gt;
{&lt;br /&gt;
       $vars = array();&lt;br /&gt;
       switch($segments[0])&lt;br /&gt;
       {&lt;br /&gt;
               case &#039;categories&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;categories&#039;;&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;category&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;category&#039;;&lt;br /&gt;
                       $id = explode( &#039;:&#039;, $segments[1] );&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;article&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       $id = explode( &#039;:&#039;, $segments[1] );&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
       }&lt;br /&gt;
       return $vars;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What happens here? In the function &amp;lt;code&amp;gt;[&#039;&#039;componentname&#039;&#039;]BuildRoute&amp;lt;/code&amp;gt; we arranged the items in the &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array in a specific sequence. This means that in this example the view is first and the id is second in the array.&lt;br /&gt;
&lt;br /&gt;
By reading &amp;lt;code&amp;gt;$segments[0]&amp;lt;/code&amp;gt;, we access the name of the view. We set the right view and/or identifier depending on its value and we return the &amp;lt;code&amp;gt;$vars&amp;lt;/code&amp;gt; array to &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt;. $vars should be an associative array similar to the array that was passed to the BuildRoute method.&lt;br /&gt;
&lt;br /&gt;
The above example of the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; is a very simple way to generate sef URL&#039;s but should show how this works quite clearly.&lt;br /&gt;
&lt;br /&gt;
The generated URL in this example contains the name of the view and doesn&#039;t reflect the content hierarchy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[view]/[slug]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A More Advanced Example ===&lt;br /&gt;
&lt;br /&gt;
In the next example we will try to get rid of the need for the view and we will try to reflect the current hierarchy level in the URL.&lt;br /&gt;
&lt;br /&gt;
The goal is URL&#039;s that look like:&lt;br /&gt;
&lt;br /&gt;
* When viewing an article: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[category]/[article]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* When viewing a category: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[category]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* When viewing the categories overview: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have done step 1 and 2 also for the category.&lt;br /&gt;
&lt;br /&gt;
The link to the article would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JRoute::_( &#039;index.php?view=article&amp;amp;catid=&#039;.$row-­&amp;gt;catslug .&#039;&amp;amp;id=&#039;.$row-­&amp;gt;slug );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the Link to the category would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JRoute::_( &#039;index.php?view=category&amp;amp;id=&#039;.$row-&amp;gt;catslug );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function [&#039;&#039;Componentname&#039;&#039;]BuildRoute(&amp;amp;$query)&lt;br /&gt;
{&lt;br /&gt;
       $segments = array();&lt;br /&gt;
       if(isset( $query[&#039;catid&#039;] ))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;catid&#039;];&lt;br /&gt;
                unset( $query[&#039;catid&#039;] );&lt;br /&gt;
       };&lt;br /&gt;
       if( isset($query[&#039;id&#039;]) )&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;id&#039;];&lt;br /&gt;
                unset( $query[&#039;id&#039;] );&lt;br /&gt;
       };&lt;br /&gt;
       unset( $query[&#039;view&#039;] );&lt;br /&gt;
       return $segments;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The difference now is that we don’t add the name of the view to the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array. We still unset the view key since otherwise, &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; would add it to the URL as part of the query string. Another new thing here is the additional parameter catid that we push into the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [&#039;&#039;Componentname&#039;&#039;]ParseRoute($segments)&lt;br /&gt;
{&lt;br /&gt;
       $vars = array();&lt;br /&gt;
       $app =&amp;amp; JFactory::getApplication();&lt;br /&gt;
       $menu =&amp;amp; $app-&amp;gt;getMenu();&lt;br /&gt;
       $item =&amp;amp; $menu-&amp;gt;getActive();&lt;br /&gt;
       // Count segments&lt;br /&gt;
       $count = count( $segments );&lt;br /&gt;
       //Handle View and Identifier&lt;br /&gt;
       switch( $item-&amp;gt;query[&#039;view&#039;] )&lt;br /&gt;
       {&lt;br /&gt;
               case &#039;categories&#039;:&lt;br /&gt;
                       if($count == 1) {&lt;br /&gt;
                               $vars[&#039;view&#039;] = &#039;category&#039;;&lt;br /&gt;
                       }&lt;br /&gt;
                       if($count == 2) {&lt;br /&gt;
                               $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       }&lt;br /&gt;
                       $id = explode( &#039;:&#039;, $segments[$count-1] );&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;category&#039;:&lt;br /&gt;
                       $id   = explode( &#039;:&#039;, $segments[$count-1] );&lt;br /&gt;
                       $vars[&#039;id&#039;]   = (int) $id[0];&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       break;&lt;br /&gt;
       }&lt;br /&gt;
       return $vars;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this ParseRoute function has a lot of different code parts in comparison to the previous. The reason for this is simple. We don’t have the name of the view in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array and we need to find another way to determine it.&lt;br /&gt;
&lt;br /&gt;
We need to find out which level of hierarchy we are in by receiving the root element. We do this by looking to the view name of the active menu item:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$item-­&amp;gt;query[&#039;view&#039;]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also we need to know the number of items in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$count = count( $segments );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this information we can correctly set the view for all possible three cases:&lt;br /&gt;
&lt;br /&gt;
* The menu item is a link to the categories view and the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array has two items (&amp;lt;code&amp;gt;$catid&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt;). In this case we know that we need to parse a link to an article.&lt;br /&gt;
* The menu item is a link to the categories view and the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array has one item (&amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt;). In this case we know that we need to parse a link to a category.&lt;br /&gt;
* The menu item is a link to a category. In this case, we know that any item in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array is the identifier for an article.&lt;br /&gt;
&lt;br /&gt;
The result of all this code is clean and human-readable component URLs.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
There is a useful thread on this subject here: [[jtopic:148632]] (note, may be out of date)&lt;br /&gt;
&lt;br /&gt;
For details on the internals of routing, see [[Routing implementation details]].&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Tutorials]][[Category:Component Development]][[Category:Search Engine Friendly URLs]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J2.5:Routing_implementation_details&amp;diff=77733</id>
		<title>J2.5:Routing implementation details</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J2.5:Routing_implementation_details&amp;diff=77733"/>
		<updated>2012-11-25T00:53:43Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Split off page from http://docs.joomla.org/index.php?title=Supporting_SEF_URLs_in_your_component&amp;amp;oldid=9893 (5 August 2008)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete}}&lt;br /&gt;
&lt;br /&gt;
== Application Route Parsing ==&lt;br /&gt;
&lt;br /&gt;
The [[Application execution order]] outlines that the route (URL) is parsed immediately after initialisation is complete.  Since fancy URL&#039;s are not treated (yet) in the Administrator, we will follow the route parsing process in detail when &amp;lt;code&amp;gt;JSite::route&amp;lt;/code&amp;gt; in the &amp;lt;tt&amp;gt;index.php&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
* Call to &amp;lt;code&amp;gt;JApplication::route&amp;lt;/code&amp;gt;&lt;br /&gt;
** Clone the URI&lt;br /&gt;
** Call to &amp;lt;code&amp;gt;JApplication::getRouter&amp;lt;/code&amp;gt;&lt;br /&gt;
*** Call to &amp;lt;code&amp;gt;JRouter::getInstance&amp;lt;/code&amp;gt; passing the type (&amp;quot;site&amp;quot;)&lt;br /&gt;
** Call to &amp;lt;code&amp;gt;JRouterSite::parse&amp;lt;/code&amp;gt; passing the URI&lt;br /&gt;
*** Strip the suffix if applicable (added to $vars[&#039;format&#039;])&lt;br /&gt;
*** Re-set the route (URI)&lt;br /&gt;
*** Call to &amp;lt;code&amp;gt;JRouter::parse&amp;lt;/code&amp;gt; passing the URI&lt;br /&gt;
**** Call to &amp;lt;code&amp;gt;JRouterSite::_processParseRules&amp;lt;/code&amp;gt; passing the URI (this will call custom route rules)&lt;br /&gt;
***** Call to &amp;lt;code&amp;gt;JRouter::_processParseRules&amp;lt;/code&amp;gt; passing the URI&lt;br /&gt;
****** Call any custom routing rules (probably added via a system plugin using the &amp;lt;code&amp;gt;onAfterInitialise&amp;lt;/code&amp;gt; event trigger) passing the URI&lt;br /&gt;
****** Returns an array of vars&lt;br /&gt;
***** If SEF mode, replace &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt; variable with &amp;lt;/code&amp;gt;limitstart&amp;lt;/code&amp;gt;&lt;br /&gt;
**** If raw mode, call to &amp;lt;code&amp;gt;JRouterSite::_parseRawRoute&amp;lt;/code&amp;gt; passing the URI&lt;br /&gt;
**** If SEF mode, call to &amp;lt;code&amp;gt;JRouterSite::_parseSefRoute&amp;lt;/code&amp;gt; passing the URI&lt;br /&gt;
***** If the route (the URI path) is empty, load it from the default menu item; set the active menu item as the default&lt;br /&gt;
***** If first part is &amp;lt;code&amp;gt;/component/com_content&amp;lt;/code&amp;gt;, set the &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; as the second segement.  Null the &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt;.&lt;br /&gt;
***** Else, loop through menu alias values and take off segments that match as the menu tree is traversed.  Set &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt; based on the last menu item found.&lt;br /&gt;
***** If the &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt; is set in the URL, set the active menu item based on this value.&lt;br /&gt;
***** Push the vars collected so far (eg, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt;, etc) into the router object (&amp;lt;code&amp;gt;$this&amp;lt;/code&amp;gt;).&lt;br /&gt;
***** If the route and &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; is set, load the component router;&lt;br /&gt;
***** Else, get the active menu item and get the route vars from it&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Application Route Building ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Custom Router Rules ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J2.5:Supporting_SEF_URLs_in_your_component&amp;diff=77731</id>
		<title>J2.5:Supporting SEF URLs in your component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J2.5:Supporting_SEF_URLs_in_your_component&amp;diff=77731"/>
		<updated>2012-11-24T17:51:30Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Adjusted layout&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete}}&lt;br /&gt;
{{:Search Engine Friendly URLs}}&lt;br /&gt;
In Joomla!, each [[component]] is responsible for handling its own SEF URLs. Therefore, as the [[Developers|developer]] of a component, you will have to create your own &#039;&#039;&#039;router&#039;&#039;&#039; to allow your component to use SEF URLs.&lt;br /&gt;
&lt;br /&gt;
== The Concept ==&lt;br /&gt;
&lt;br /&gt;
Assuming you are following standard development practices, your component is probably using &amp;quot;system URLs&amp;quot; that look a lot like &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_yourcomponent&amp;amp;view=article&amp;amp;id=1&amp;amp;catid=20&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;, and your goal is to transform this into &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;. As the developer, you have two tasks: signalling the system that certain pieces of text are URLs and need to be transformed, and explaining the system how to transform URLs.&lt;br /&gt;
&lt;br /&gt;
=== Applying &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
It is difficult and inefficient for Joomla! to figure out which parts of your component&#039;s output are URLs. To support SEF URLs, you will need to change URL-generating code so that it applies &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; before outputting the URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
echo JRoute::_(&#039;index.php?view=article&amp;amp;id=1&amp;amp;catid=20&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that it is possible to leave out the parameters &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; defaults to the name of the component currently being executed, and &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt; defaults to the current menu item&#039;s ID.&lt;br /&gt;
&lt;br /&gt;
In general, you should only apply this to URLs that users and/or search engines are able to see. For example, there is no need to transform URLs used in redirects that immediately result in other redirects.&lt;br /&gt;
&lt;br /&gt;
If the user turns off SEF URLs in the site&#039;s settings, &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; will produce working non-SEF URLs without any changes to the code.&lt;br /&gt;
&lt;br /&gt;
=== Writing a router ===&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also need to write a router, which is a single file with two functions that convert system URLs to and from SEF URLs. This file needs to be placed at &amp;lt;tt&amp;gt;/components/com_yourcomponent/router.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The first function, &amp;lt;code&amp;gt;[componentname]BuildRoute(&amp;amp;$query)&amp;lt;/code&amp;gt;, must transform an array of URL parameters into an array of segments that will form the SEF URL. Schematically, the transformation works as follows:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_yourcomponent&amp;amp;view=article&amp;amp;id=1&amp;amp;catid=20&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt;, called by your component or any other extension&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$query = array(&#039;view&#039; =&amp;gt; &#039;article&#039;, &#039;id&#039; =&amp;gt; 1, &#039;catid&#039; =&amp;gt; 20)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Your router&#039;s &amp;lt;code&amp;gt;com_yourcomponentBuildRoute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$segments = array(20, 1);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Joomla&#039;s internal routing (for display)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second function, &amp;lt;code&amp;gt;[componentname]ParseRoute($segments)&amp;lt;/code&amp;gt;, must transform an array of segments back into an array of URL parameters. Schematically:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Joomla&#039;s internal routing&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$segments = array(20, 1);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Your router&#039;s &amp;lt;code&amp;gt;com_yourcomponentParseRoute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$query = array(&#039;view&#039; =&amp;gt; &#039;article&#039;, &#039;id&#039; =&amp;gt; 1, &#039;catid&#039; =&amp;gt; 20)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two functions must cooperate in such a way that the original URL can be reconstructed. You can think of &amp;lt;code&amp;gt;BuildRoute&amp;lt;/code&amp;gt; as a form of [[wikipedia:Encoding|encoding]] and &amp;lt;code&amp;gt;ParseRoute&amp;lt;/code&amp;gt; as the corresponding decoding. When the original URL isn&#039;t properly reproduced, your component will stop working.&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Data for Routing ==&lt;br /&gt;
&lt;br /&gt;
=== The Alias ===&lt;br /&gt;
&lt;br /&gt;
The first step is the generation of the so called alias. The alias is used in the URL instead of the title (the alias is the text you want to have in the URL). The alias has to be URI safe, which means accented UTF­8 characters are replaced by their ASCII­7 equivalents, white spaces by hyphens, etc.&lt;br /&gt;
&lt;br /&gt;
The alias can be defined by the user, but you should ensure that the above requirements for a URL safe alias are met. A good way to do so is to use the JTable::check() method during the save process. Have a look at this example code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function check()&lt;br /&gt;
{&lt;br /&gt;
    jimport( &#039;joomla.filter.output&#039; );&lt;br /&gt;
    if(empty($this-&amp;gt;alias)) {&lt;br /&gt;
	    $this-&amp;gt;alias = $this-&amp;gt;title;&lt;br /&gt;
    }&lt;br /&gt;
    $this-&amp;gt;alias = JFilterOutput::stringURLSafe($this-&amp;gt;alias);&lt;br /&gt;
&lt;br /&gt;
    /* All your other checks */&lt;br /&gt;
    return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the alias field is empty the title will be used as alias. Then the alias will be made URLSafe using the &amp;lt;code&amp;gt;JFilterOutput::stringURLSafe()&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
=== The Slug ===&lt;br /&gt;
&lt;br /&gt;
Continuing with the same example, the &amp;quot;slug&amp;quot; - &amp;quot;1­:welcome­-to­-joomla&amp;quot; has two parts. The first part is the article identifier (id) and the second is the alias. They are separated by a colon. These two elements were combined during the database query in the model:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$query = &#039;SELECT a.*, &#039;.&lt;br /&gt;
         &#039;CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(&amp;quot;:&amp;quot;, a.id, a.alias) ELSE a.id END as slug,&#039;&lt;br /&gt;
         /*...*/;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this step the slug is used instead of the id.&lt;br /&gt;
&lt;br /&gt;
== Routing URLs ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; method translates the internal Joomla! URL to a custom URL. &amp;lt;tt&amp;gt;JRoute&amp;lt;/tt&amp;gt; has three parameters and its prototype is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;JRoute::_( $url, $xhtml = true, $ssl=null );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;$url&amp;lt;/code&amp;gt; is a string containing the absolute or relative internal Joomla! URL.&lt;br /&gt;
* &amp;lt;code&amp;gt;$xhtml&amp;lt;/code&amp;gt; is a boolean value that specifies whether or not the output should be in XHTML. This parameter is optional and if omitted defaults to true.&lt;br /&gt;
* &amp;lt;code&amp;gt;$ssl&amp;lt;/code&amp;gt; is an integer value that specifies whether the URI should be secure. It should be set to 1 to force the URI to be secure using the global secure site URI, 0 to leave it in the same state as when it was passed, and -1 to force the URI to be unsecure using the global unsecure site URI.&lt;br /&gt;
&lt;br /&gt;
The most important parameter is &amp;lt;code&amp;gt;$url&amp;lt;/code&amp;gt;. A call to this method might look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;JRoute::_( &#039;index.php?view=article&amp;amp;id=&#039;.$row-&amp;gt;slug );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$row-­&amp;gt;slug&amp;lt;/code&amp;gt; is the value that was generated in step 2 from a combination of id and title alias.&lt;br /&gt;
&lt;br /&gt;
Another advantage of using JRoute is that the router now handles $option (the component name) and the $Itemid (the menu item ID). The component itself doesn’t have to know its name ($option) or the active menu item ($Itemid) like it did in previous version of Joomla!.&lt;br /&gt;
&lt;br /&gt;
It is important that you think about the sequence of the URL parameter in this stage. This will be more clear when we have a deeper look at the router.php in the next section.&lt;br /&gt;
&lt;br /&gt;
The building process of JRouter is divided into two steps:&lt;br /&gt;
&lt;br /&gt;
* Create the application route. The application route is fully handled by JRouter and the component developer doesn’t have to do anything to make it work.&lt;br /&gt;
* Create the component route. To create the component route, JRouter looks for the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; in the component directory which is responsible for building the route for the component.&lt;br /&gt;
&lt;br /&gt;
== The Component Router ==&lt;br /&gt;
&lt;br /&gt;
We will have two functions in the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt;. One is responsible for building the URL and the other is responsible for parsing it. In the next examples, a very basic and a more advanced one, we assume that we have three views that links can point to. The first is a categories overview (&amp;lt;code&amp;gt;view=categories&amp;lt;/code&amp;gt;), the second is a single category (&amp;lt;code&amp;gt;view=category&amp;lt;/code&amp;gt;) and the third is a single article (&amp;lt;code&amp;gt;view=article&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The file &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; should be in the site area of your component. It is not used on admin/backend pages. Don&#039;t forget to add it to your XML [[Manifest files|manifest file]] in the site folder.&lt;br /&gt;
&lt;br /&gt;
=== A Simple Example ===&lt;br /&gt;
&lt;br /&gt;
This simple example will illustrate the basics of implementing a router for your component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]BuildRoute( &amp;amp;$query )&lt;br /&gt;
{&lt;br /&gt;
       $segments = array();&lt;br /&gt;
       if(isset($query[&#039;view&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;view&#039;];&lt;br /&gt;
                unset( $query[&#039;view&#039;] );&lt;br /&gt;
       }&lt;br /&gt;
       if(isset($query[&#039;id&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;id&#039;];&lt;br /&gt;
                unset( $query[&#039;id&#039;] );&lt;br /&gt;
       };&lt;br /&gt;
       return $segments;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; passes a $query array to the &amp;lt;code&amp;gt;[&#039;&#039;componentname&#039;&#039;]BuildRoute&amp;lt;/code&amp;gt; function. This function will add the relevant parts of the array to the $segments array in the right order and will return the properly ordered array. The content of the &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array needs to be unset, otherwise &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; will add it to the URL in the form of a query string (i.e. any variables that are not handled by the router will be passed in the query string).&lt;br /&gt;
&lt;br /&gt;
The prefix &#039;&#039;componentname&#039;&#039; is the name for your component, as found in the directory holding the component&#039;s files. For instance, a component &amp;quot;Magic&amp;quot; in directory &amp;lt;tt&amp;gt;/components/com_magic/...&amp;lt;/tt&amp;gt; would use a prefix &amp;lt;code&amp;gt;magic&amp;lt;/code&amp;gt; (all lower case).&lt;br /&gt;
&lt;br /&gt;
The next function in the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; parses the URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]ParseRoute( $segments )&lt;br /&gt;
{&lt;br /&gt;
       $vars = array();&lt;br /&gt;
       switch($segments[0])&lt;br /&gt;
       {&lt;br /&gt;
               case &#039;categories&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;categories&#039;;&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;category&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;category&#039;;&lt;br /&gt;
                       $id = explode( &#039;:&#039;, $segments[1] );&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;article&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       $id = explode( &#039;:&#039;, $segments[1] );&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
       }&lt;br /&gt;
       return $vars;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What happens here? In the function &amp;lt;code&amp;gt;[&#039;&#039;componentname&#039;&#039;]BuildRoute&amp;lt;/code&amp;gt; we arranged the items in the &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array in a specific sequence. This means that in this example the view is first and the id is second in the array.&lt;br /&gt;
&lt;br /&gt;
By reading &amp;lt;code&amp;gt;$segments[0]&amp;lt;/code&amp;gt;, we access the name of the view. We set the right view and/or identifier depending on its value and we return the &amp;lt;code&amp;gt;$vars&amp;lt;/code&amp;gt; array to &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt;. $vars should be an associative array similar to the array that was passed to the BuildRoute method.&lt;br /&gt;
&lt;br /&gt;
The above example of the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; is a very simple way to generate sef URL&#039;s but should show how this works quite clearly.&lt;br /&gt;
&lt;br /&gt;
The generated URL in this example contains the name of the view and doesn&#039;t reflect the content hierarchy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[view]/[slug]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A More Advanced Example ===&lt;br /&gt;
&lt;br /&gt;
In the next example we will try to get rid of the need for the view and we will try to reflect the current hierarchy level in the URL.&lt;br /&gt;
&lt;br /&gt;
The goal is URL&#039;s that look like:&lt;br /&gt;
&lt;br /&gt;
* When viewing an article: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[category]/[article]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* When viewing a category: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[category]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* When viewing the categories overview: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have done step 1 and 2 also for the category.&lt;br /&gt;
&lt;br /&gt;
The link to the article would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JRoute::_( &#039;index.php?view=article&amp;amp;catid=&#039;.$row-­&amp;gt;catslug .&#039;&amp;amp;id=&#039;.$row-­&amp;gt;slug );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the Link to the category would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JRoute::_( &#039;index.php?view=category&amp;amp;id=&#039;.$row-&amp;gt;catslug );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function [&#039;&#039;Componentname&#039;&#039;]BuildRoute(&amp;amp;$query)&lt;br /&gt;
{&lt;br /&gt;
       $segments = array();&lt;br /&gt;
       if(isset( $query[&#039;catid&#039;] ))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;catid&#039;];&lt;br /&gt;
                unset( $query[&#039;catid&#039;] );&lt;br /&gt;
       };&lt;br /&gt;
       if( isset($query[&#039;id&#039;]) )&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;id&#039;];&lt;br /&gt;
                unset( $query[&#039;id&#039;] );&lt;br /&gt;
       };&lt;br /&gt;
       unset( $query[&#039;view&#039;] );&lt;br /&gt;
       return $segments;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The difference now is that we don’t add the name of the view to the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array. We still unset the view key since otherwise, &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; would add it to the URL as part of the query string. Another new thing here is the additional parameter catid that we push into the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [&#039;&#039;Componentname&#039;&#039;]ParseRoute($segments)&lt;br /&gt;
{&lt;br /&gt;
       $vars = array();&lt;br /&gt;
       $app =&amp;amp; JFactory::getApplication();&lt;br /&gt;
       $menu =&amp;amp; $app-&amp;gt;getMenu();&lt;br /&gt;
       $item =&amp;amp; $menu-&amp;gt;getActive();&lt;br /&gt;
       // Count segments&lt;br /&gt;
       $count = count( $segments );&lt;br /&gt;
       //Handle View and Identifier&lt;br /&gt;
       switch( $item-&amp;gt;query[&#039;view&#039;] )&lt;br /&gt;
       {&lt;br /&gt;
               case &#039;categories&#039;:&lt;br /&gt;
                       if($count == 1) {&lt;br /&gt;
                               $vars[&#039;view&#039;] = &#039;category&#039;;&lt;br /&gt;
                       }&lt;br /&gt;
                       if($count == 2) {&lt;br /&gt;
                               $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       }&lt;br /&gt;
                       $id = explode( &#039;:&#039;, $segments[$count-1] );&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;category&#039;:&lt;br /&gt;
                       $id   = explode( &#039;:&#039;, $segments[$count-1] );&lt;br /&gt;
                       $vars[&#039;id&#039;]   = (int) $id[0];&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       break;&lt;br /&gt;
       }&lt;br /&gt;
       return $vars;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this ParseRoute function has a lot of different code parts in comparison to the previous. The reason for this is simple. We don’t have the name of the view in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array and we need to find another way to determine it.&lt;br /&gt;
&lt;br /&gt;
We need to find out which level of hierarchy we are in by receiving the root element. We do this by looking to the view name of the active menu item:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$item-­&amp;gt;query[&#039;view&#039;]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also we need to know the number of items in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$count = count( $segments );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this information we can correctly set the view for all possible three cases:&lt;br /&gt;
&lt;br /&gt;
* The menu item is a link to the categories view and the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array has two items (&amp;lt;code&amp;gt;$catid&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt;). In this case we know that we need to parse a link to an article.&lt;br /&gt;
* The menu item is a link to the categories view and the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array has one item (&amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt;). In this case we know that we need to parse a link to a category.&lt;br /&gt;
* The menu item is a link to a category. In this case, we know that any item in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array is the identifier for an article.&lt;br /&gt;
&lt;br /&gt;
The result of all this code is clean and human-readable component URLs.&lt;br /&gt;
&lt;br /&gt;
== Application Route Parsing ==&lt;br /&gt;
&lt;br /&gt;
The [[Application execution order]] outlines that the route (URL) is parsed immediately after initialisation is complete.  Since fancy URL&#039;s are not treated (yet) in the Administrator, we will follow the route parsing process in detail when &amp;lt;code&amp;gt;JSite::route&amp;lt;/code&amp;gt; in the &amp;lt;tt&amp;gt;index.php&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
* Call to &amp;lt;code&amp;gt;JApplication::route&amp;lt;/code&amp;gt;&lt;br /&gt;
** Clone the URI&lt;br /&gt;
** Call to &amp;lt;code&amp;gt;JApplication::getRouter&amp;lt;/code&amp;gt;&lt;br /&gt;
*** Call to &amp;lt;code&amp;gt;JRouter::getInstance&amp;lt;/code&amp;gt; passing the type (&amp;quot;site&amp;quot;)&lt;br /&gt;
** Call to &amp;lt;code&amp;gt;JRouterSite::parse&amp;lt;/code&amp;gt; passing the URI&lt;br /&gt;
*** Strip the suffix if applicable (added to $vars[&#039;format&#039;])&lt;br /&gt;
*** Re-set the route (URI)&lt;br /&gt;
*** Call to &amp;lt;code&amp;gt;JRouter::parse&amp;lt;/code&amp;gt; passing the URI&lt;br /&gt;
**** Call to &amp;lt;code&amp;gt;JRouterSite::_processParseRules&amp;lt;/code&amp;gt; passing the URI (this will call custom route rules)&lt;br /&gt;
***** Call to &amp;lt;code&amp;gt;JRouter::_processParseRules&amp;lt;/code&amp;gt; passing the URI&lt;br /&gt;
****** Call any custom routing rules (probably added via a system plugin using the &amp;lt;code&amp;gt;onAfterInitialise&amp;lt;/code&amp;gt; event trigger) passing the URI&lt;br /&gt;
****** Returns an array of vars&lt;br /&gt;
***** If SEF mode, replace &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt; variable with &amp;lt;/code&amp;gt;limitstart&amp;lt;/code&amp;gt;&lt;br /&gt;
**** If raw mode, call to &amp;lt;code&amp;gt;JRouterSite::_parseRawRoute&amp;lt;/code&amp;gt; passing the URI&lt;br /&gt;
**** If SEF mode, call to &amp;lt;code&amp;gt;JRouterSite::_parseSefRoute&amp;lt;/code&amp;gt; passing the URI&lt;br /&gt;
***** If the route (the URI path) is empty, load it from the default menu item; set the active menu item as the default&lt;br /&gt;
***** If first part is &amp;lt;code&amp;gt;/component/com_content&amp;lt;/code&amp;gt;, set the &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; as the second segement.  Null the &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt;.&lt;br /&gt;
***** Else, loop through menu alias values and take off segments that match as the menu tree is traversed.  Set &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt; based on the last menu item found.&lt;br /&gt;
***** If the &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt; is set in the URL, set the active menu item based on this value.&lt;br /&gt;
***** Push the vars collected so far (eg, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt;, etc) into the router object (&amp;lt;code&amp;gt;$this&amp;lt;/code&amp;gt;).&lt;br /&gt;
***** If the route and &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; is set, load the component router;&lt;br /&gt;
***** Else, get the active menu item and get the route vars from it&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Application Route Building ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Custom Router Rules ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Additional References ==&lt;br /&gt;
&lt;br /&gt;
There is a useful thread on this subject here: [[jtopic:148632]] (note, may be out of date)&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Tutorials]][[Category:Component Development]][[Category:Search Engine Friendly URLs]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J2.5:Supporting_SEF_URLs_in_your_component&amp;diff=77729</id>
		<title>J2.5:Supporting SEF URLs in your component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J2.5:Supporting_SEF_URLs_in_your_component&amp;diff=77729"/>
		<updated>2012-11-24T17:33:38Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Added information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete}}&lt;br /&gt;
{{:Search Engine Friendly URLs}}&lt;br /&gt;
In Joomla!, each [[component]] is responsible for handling its own SEF URLs. Therefore, as the [[Developers|developer]] of a component, you will have to create your own &#039;&#039;&#039;router&#039;&#039;&#039; to allow your component to use SEF URLs.&lt;br /&gt;
&lt;br /&gt;
== The Concept ==&lt;br /&gt;
&lt;br /&gt;
Assuming you are following standard development practices, your component is probably using &amp;quot;system URLs&amp;quot; that look a lot like &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_yourcomponent&amp;amp;view=article&amp;amp;id=1&amp;amp;catid=20&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;, and your goal is to transform this into &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;. As the developer, you have two tasks: signalling the system that certain pieces of text are URLs and need to be transformed, and explaining the system how to transform URLs.&lt;br /&gt;
&lt;br /&gt;
=== Applying &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
It is difficult and inefficient for Joomla! to figure out which parts of your component&#039;s output are URLs. To support SEF URLs, you will need to change URL-generating code so that it applies &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; before outputting the URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
echo JRoute::_(&#039;index.php?view=article&amp;amp;id=1&amp;amp;catid=20&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that it is possible to leave out the parameters &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; defaults to the name of the component currently being executed, and &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt; defaults to the current menu item&#039;s ID.&lt;br /&gt;
&lt;br /&gt;
In general, you should only apply this to URLs that users and/or search engines are able to see. For example, there is no need to transform URLs used in redirects that immediately result in other redirects.&lt;br /&gt;
&lt;br /&gt;
If the user turns off SEF URLs in the site&#039;s settings, &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; will produce working non-SEF URLs without any changes to the code.&lt;br /&gt;
&lt;br /&gt;
=== Writing a router ===&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also need to write a router, which is a single file with two functions that convert system URLs to and from SEF URLs. This file needs to be placed at &amp;lt;tt&amp;gt;/components/com_yourcomponent/router.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The first function, &amp;lt;code&amp;gt;[componentname]BuildRoute(&amp;amp;$query)&amp;lt;/code&amp;gt;, must transform an array of URL parameters into an array of segments that will form the SEF URL. Schematically, the transformation works as follows:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_yourcomponent&amp;amp;view=article&amp;amp;id=1&amp;amp;catid=20&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt;, called by your component or any other extension&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$query = array(&#039;view&#039; =&amp;gt; &#039;article&#039;, &#039;id&#039; =&amp;gt; 1, &#039;catid&#039; =&amp;gt; 20)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Your router&#039;s &amp;lt;code&amp;gt;com_yourcomponentBuildRoute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$segments = array(20, 1);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Joomla&#039;s internal routing (for display)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second function, &amp;lt;code&amp;gt;[componentname]ParseRoute($segments)&amp;lt;/code&amp;gt;, must transform an array of segments back into an array of URL parameters. Schematically:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/example-menu-item/20/1&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Joomla&#039;s internal routing&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$segments = array(20, 1);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;span style=&amp;quot;font-size: xx-large&amp;quot;&amp;gt;&amp;amp;darr;&amp;lt;/span&amp;gt; Your router&#039;s &amp;lt;code&amp;gt;com_yourcomponentParseRoute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;$query = array(&#039;view&#039; =&amp;gt; &#039;article&#039;, &#039;id&#039; =&amp;gt; 1, &#039;catid&#039; =&amp;gt; 20)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two functions must cooperate in such a way that the original URL can be reconstructed. You can think of &amp;lt;code&amp;gt;BuildRoute&amp;lt;/code&amp;gt; as a form of [[wikipedia:Encoding|encoding]] and &amp;lt;code&amp;gt;ParseRoute&amp;lt;/code&amp;gt; as the corresponding decoding. When the original URL isn&#039;t properly reproduced, your component will stop working.&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Data for Routing ==&lt;br /&gt;
&lt;br /&gt;
=== The Alias ===&lt;br /&gt;
&lt;br /&gt;
The first step is the generation of the so called alias. The alias is used in the URL instead of the title (the alias is the text you want to have in the URL). The alias has to be URI safe, which means accented UTF­8 characters are replaced by their ASCII­7 equivalents, white spaces by hyphens, etc.&lt;br /&gt;
&lt;br /&gt;
The alias can be defined by the user, but you should ensure that the above requirements for a URL safe alias are met. A good way to do so is to use the JTable::check() method during the save process. Have a look at this example code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function check()&lt;br /&gt;
{&lt;br /&gt;
    jimport( &#039;joomla.filter.output&#039; );&lt;br /&gt;
    if(empty($this-&amp;gt;alias)) {&lt;br /&gt;
	    $this-&amp;gt;alias = $this-&amp;gt;title;&lt;br /&gt;
    }&lt;br /&gt;
    $this-&amp;gt;alias = JFilterOutput::stringURLSafe($this-&amp;gt;alias);&lt;br /&gt;
&lt;br /&gt;
    /* All your other checks */&lt;br /&gt;
    return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the alias field is empty the title will be used as alias. Then the alias will be made URLSafe using the JFilterOutput::stringURLSafe() method.&lt;br /&gt;
&lt;br /&gt;
=== The Slug ===&lt;br /&gt;
&lt;br /&gt;
Continuing with the same example, the &amp;quot;slug&amp;quot; - &amp;quot;1­:welcome­-to­-joomla&amp;quot; has two parts. The first part is the article identifier (id) and the second is the alias. They are separated by a colon. These two elements were combined during the database query in the model:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$query = &#039;SELECT a.*, &#039;.&lt;br /&gt;
         &#039;CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(&amp;quot;:&amp;quot;, a.id, a.alias) ELSE a.id END as slug,&#039;&lt;br /&gt;
         /*...*/;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this step the slug is used instead of the id.&lt;br /&gt;
&lt;br /&gt;
== Routing URLs ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;JRoute::_&amp;lt;/code&amp;gt; method translates the internal Joomla! URL to a custom URL. &amp;lt;code&amp;gt;JRoute&amp;lt;/code&amp;gt; has three parameters and its prototype is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;JRoute::_( $url, $xhtml = true, $ssl=null );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;$url&amp;lt;/code&amp;gt; is a string containing the absolute or relative internal Joomla! URL.&lt;br /&gt;
* &amp;lt;code&amp;gt;$xhtml&amp;lt;/code&amp;gt; is a boolean value that specifies whether or not the output should be in XHTML. This parameter is optional and if omitted defaults to true.&lt;br /&gt;
* &amp;lt;code&amp;gt;$ssl&amp;lt;/code&amp;gt; is an integer value that specifies whether the URI should be secure. It should be set to 1 to force the URI to be secure using the global secure site URI, 0 to leave it in the same state as when it was passed, and -1 to force the URI to be unsecure using the global unsecure site URI.&lt;br /&gt;
&lt;br /&gt;
The most important parameter is &amp;lt;code&amp;gt;$url&amp;lt;/code&amp;gt;. A call to this method might look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;JRoute::_( &#039;index.php?view=article&amp;amp;id=&#039;.$row-&amp;gt;slug );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$row-­&amp;gt;slug&amp;lt;/code&amp;gt; is the value that was generated in step 2 from a combination of id and title alias.&lt;br /&gt;
&lt;br /&gt;
Another advantage of using JRoute is that the router now handles $option (the component name) and the $Itemid (the menu item ID). The component itself doesn’t have to know its name ($option) or the active menu item ($Itemid) like it did in previous version of Joomla!.&lt;br /&gt;
&lt;br /&gt;
It is important that you think about the sequence of the URL parameter in this stage. This will be more clear when we have a deeper look at the router.php in the next section.&lt;br /&gt;
&lt;br /&gt;
The building process of JRouter is divided into two steps:&lt;br /&gt;
&lt;br /&gt;
* Create the application route. The application route is fully handled by JRouter and the component developer doesn’t have to do anything to make it work.&lt;br /&gt;
* Create the component route. To create the component route, JRouter looks for the router.php in the component directory which is responsible for building the route for the component.&lt;br /&gt;
&lt;br /&gt;
== The Component Router ==&lt;br /&gt;
&lt;br /&gt;
We will have two functions in the router.php. One is responsible for building the URL and the other is responsible for parsing it. In the next examples, a very basic and a more advanced one, we assume that we have three views that links can point to. The first is a categories overview (view=categories), the second is a single category (view=category) and the third is a single article (view=article).&lt;br /&gt;
&lt;br /&gt;
The file router.php should be in the site area of your component. It is not used on admin/backend pages. Don&#039;t forget to add it to your installation XML in the site folder.&lt;br /&gt;
&lt;br /&gt;
=== A Simple Example ===&lt;br /&gt;
&lt;br /&gt;
This simple example will illustrate the basics of implementing a router for your component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]BuildRoute( &amp;amp;$query )&lt;br /&gt;
{&lt;br /&gt;
       $segments = array();&lt;br /&gt;
       if(isset($query[&#039;view&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;view&#039;];&lt;br /&gt;
                unset( $query[&#039;view&#039;] );&lt;br /&gt;
       }&lt;br /&gt;
       if(isset($query[&#039;id&#039;]))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;id&#039;];&lt;br /&gt;
                unset( $query[&#039;id&#039;] );&lt;br /&gt;
       };&lt;br /&gt;
       return $segments;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; passes a $query array to the &amp;lt;code&amp;gt;[&#039;&#039;componentname&#039;&#039;]BuildRoute&amp;lt;/code&amp;gt; function. This function will add the relevant parts of the array to the $segments array in the right order and will return the properly ordered array. The content of the &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array needs to be unset, otherwise &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; will add it to the URL in the form of a query string (i.e. any variables that are not handled by the router will be passed in the query string).&lt;br /&gt;
&lt;br /&gt;
The prefix &#039;&#039;componentname&#039;&#039; is the name for your component, as found in the directory holding the component&#039;s files. For instance, a component &amp;quot;Magic&amp;quot; in directory &amp;lt;code&amp;gt;/components/com_magic/...&amp;lt;/code&amp;gt; would use a prefix &amp;lt;code&amp;gt;magic&amp;lt;/code&amp;gt; (all lower case).&lt;br /&gt;
&lt;br /&gt;
The next function in the &amp;lt;code&amp;gt;router.php&amp;lt;/code&amp;gt; parses the URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [componentname]ParseRoute( $segments )&lt;br /&gt;
{&lt;br /&gt;
       $vars = array();&lt;br /&gt;
       switch($segments[0])&lt;br /&gt;
       {&lt;br /&gt;
               case &#039;categories&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;categories&#039;;&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;category&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;category&#039;;&lt;br /&gt;
                       $id = explode( &#039;:&#039;, $segments[1] );&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;article&#039;:&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       $id = explode( &#039;:&#039;, $segments[1] );&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
       }&lt;br /&gt;
       return $vars;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What happens here? In the function &amp;lt;code&amp;gt;[&#039;&#039;componentname&#039;&#039;]BuildRoute&amp;lt;/code&amp;gt; we arranged the items in the &amp;lt;code&amp;gt;$query&amp;lt;/code&amp;gt; array in a specific sequence. This means that in this example the view is first and the id is second in the array.&lt;br /&gt;
&lt;br /&gt;
By reading &amp;lt;code&amp;gt;$segments[0]&amp;lt;/code&amp;gt;, we access the name of the view. We set the right view and/or identifier depending on its value and we return the &amp;lt;code&amp;gt;$vars&amp;lt;/code&amp;gt; array to &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt;. $vars should be an associative array similar to the array that was passed to the BuildRoute method.&lt;br /&gt;
&lt;br /&gt;
The above example of the &amp;lt;code&amp;gt;router.php&amp;lt;/code&amp;gt; is a very simple way to generate sef URL&#039;s but should show how this works quite clearly.&lt;br /&gt;
&lt;br /&gt;
The generated URL in this example contains the name of the view and doesn&#039;t reflect the content hierarchy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[view]/[slug]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A More Advanced Example ===&lt;br /&gt;
&lt;br /&gt;
In the next example we will try to get rid of the need for the view and we will try to reflect the current hierarchy level in the URL.&lt;br /&gt;
&lt;br /&gt;
The goal is URL&#039;s that look like:&lt;br /&gt;
&lt;br /&gt;
* When viewing an article: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[category]/[article]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
* When viewing a category: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]/[category]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
* When viewing the categories overview: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/[menualias]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have done step 1 and 2 also for the category.&lt;br /&gt;
&lt;br /&gt;
The link to the article would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JRoute::_( &#039;index.php?view=article&amp;amp;catid=&#039;.$row-­&amp;gt;catslug .&#039;&amp;amp;id=&#039;.$row-­&amp;gt;slug );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the Link to the category would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JRoute::_( &#039;index.php?view=category&amp;amp;id=&#039;.$row-&amp;gt;catslug );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding &amp;lt;code&amp;gt;router.php&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function [&#039;&#039;Componentname&#039;&#039;]BuildRoute(&amp;amp;$query)&lt;br /&gt;
{&lt;br /&gt;
       $segments = array();&lt;br /&gt;
       if(isset( $query[&#039;catid&#039;] ))&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;catid&#039;];&lt;br /&gt;
                unset( $query[&#039;catid&#039;] );&lt;br /&gt;
       };&lt;br /&gt;
       if( isset($query[&#039;id&#039;]) )&lt;br /&gt;
       {&lt;br /&gt;
                $segments[] = $query[&#039;id&#039;];&lt;br /&gt;
                unset( $query[&#039;id&#039;] );&lt;br /&gt;
       };&lt;br /&gt;
       unset( $query[&#039;view&#039;] );&lt;br /&gt;
       return $segments;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The difference now is that we don’t add the name of the view to the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array. We still unset the view key since otherwise, &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; would add it to the URL as part of the query string. Another new thing here is the additional parameter catid that we push into the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function [&#039;&#039;Componentname&#039;&#039;]ParseRoute($segments)&lt;br /&gt;
{&lt;br /&gt;
       $vars = array();&lt;br /&gt;
       $app =&amp;amp; JFactory::getApplication();&lt;br /&gt;
       $menu =&amp;amp; $app-&amp;gt;getMenu();&lt;br /&gt;
       $item =&amp;amp; $menu-&amp;gt;getActive();&lt;br /&gt;
       // Count segments&lt;br /&gt;
       $count = count( $segments );&lt;br /&gt;
       //Handle View and Identifier&lt;br /&gt;
       switch( $item-&amp;gt;query[&#039;view&#039;] )&lt;br /&gt;
       {&lt;br /&gt;
               case &#039;categories&#039;:&lt;br /&gt;
                       if($count == 1) {&lt;br /&gt;
                               $vars[&#039;view&#039;] = &#039;category&#039;;&lt;br /&gt;
                       }&lt;br /&gt;
                       if($count == 2) {&lt;br /&gt;
                               $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       }&lt;br /&gt;
                       $id = explode( &#039;:&#039;, $segments[$count-1] );&lt;br /&gt;
                       $vars[&#039;id&#039;] = (int) $id[0];&lt;br /&gt;
                       break;&lt;br /&gt;
               case &#039;category&#039;:&lt;br /&gt;
                       $id   = explode( &#039;:&#039;, $segments[$count-1] );&lt;br /&gt;
                       $vars[&#039;id&#039;]   = (int) $id[0];&lt;br /&gt;
                       $vars[&#039;view&#039;] = &#039;article&#039;;&lt;br /&gt;
                       break;&lt;br /&gt;
       }&lt;br /&gt;
       return $vars;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this ParseRoute function has a lot of different code parts in comparison to the previous. The reason for this is simple. We don’t have the name of the view in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array and we need to find another way to determine it.&lt;br /&gt;
&lt;br /&gt;
We need to find out which level of hierarchy we are in by receiving the root element. We do this by looking to the view name of the active menu item:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$item-­&amp;gt;query[&#039;view&#039;]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also we need to know the number of items in the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$count = count( $segments );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this information we can correctly set the view for all possible three cases:&lt;br /&gt;
&lt;br /&gt;
* The menu item is a link to the categories view and the &amp;lt;code&amp;gt;$segments&amp;lt;/code&amp;gt; array has two items (&amp;lt;code&amp;gt;$catid&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt;). In this case we know that we need to parse a link to an article.&lt;br /&gt;
* The menu item is a link to the categories view and the $segments array has one item ($id). In this case we know that we need to parse a link to a category.&lt;br /&gt;
* The menu item is a link to a category. In this case, we know that any item in the $segments array is the identifier for an article.&lt;br /&gt;
&lt;br /&gt;
The result of all this code is clean and human-readable component URLs.&lt;br /&gt;
&lt;br /&gt;
== Application Route Parsing ==&lt;br /&gt;
&lt;br /&gt;
The [[Application execution order]] outlines that the route (URL) is parsed immediately after initialisation is complete.  Since fancy URL&#039;s are not treated (yet) in the Administrator, we will follow the route parsing process in detail when &amp;lt;code&amp;gt;JSite::route&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;index.php&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
* Call to &amp;lt;code&amp;gt;JApplication::route&amp;lt;/code&amp;gt;&lt;br /&gt;
** Clone the URI&lt;br /&gt;
** Call to &amp;lt;code&amp;gt;JApplication::getRouter&amp;lt;/code&amp;gt;&lt;br /&gt;
*** Call to &amp;lt;code&amp;gt;JRouter::getInstance&amp;lt;/code&amp;gt; passing the type (&amp;quot;site&amp;quot;)&lt;br /&gt;
** Call to &amp;lt;code&amp;gt;JRouterSite::parse&amp;lt;/code&amp;gt; passing the URI&lt;br /&gt;
*** Strip the suffix if applicable (added to $vars[&#039;format&#039;])&lt;br /&gt;
*** Re-set the route (URI)&lt;br /&gt;
*** Call to &amp;lt;code&amp;gt;JRouter::parse&amp;lt;/code&amp;gt; passing the URI&lt;br /&gt;
**** Call to &amp;lt;code&amp;gt;JRouterSite::_processParseRules&amp;lt;/code&amp;gt; passing the URI (this will call custom route rules)&lt;br /&gt;
***** Call to &amp;lt;code&amp;gt;JRouter::_processParseRules&amp;lt;/code&amp;gt; passing the URI&lt;br /&gt;
****** Call any custom routing rules (probably added via a system plugin using the &amp;lt;code&amp;gt;onAfterInitialise&amp;lt;/code&amp;gt; event trigger) passing the URI&lt;br /&gt;
****** Returns an array of vars&lt;br /&gt;
***** If SEF mode, replace &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt; variable with &amp;lt;/code&amp;gt;limitstart&amp;lt;/code&amp;gt;&lt;br /&gt;
**** If raw mode, call to &amp;lt;code&amp;gt;JRouterSite::_parseRawRoute&amp;lt;/code&amp;gt; passing the URI&lt;br /&gt;
**** If SEF mode, call to &amp;lt;code&amp;gt;JRouterSite::_parseSefRoute&amp;lt;/code&amp;gt; passing the URI&lt;br /&gt;
***** If the route (the URI path) is empty, load it from the default menu item; set the active menu item as the default&lt;br /&gt;
***** If first part is &amp;lt;code&amp;gt;/component/com_content&amp;lt;/code&amp;gt;, set the &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; as the second segement.  Null the &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt;.&lt;br /&gt;
***** Else, loop through menu alias values and take off segments that match as the menu tree is traversed.  Set &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt; based on the last menu item found.&lt;br /&gt;
***** If the &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt; is set in the URL, set the active menu item based on this value.&lt;br /&gt;
***** Push the vars collected so far (eg, &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Itemid&amp;lt;/code&amp;gt;, etc) into the router object (&amp;lt;code&amp;gt;$this&amp;lt;/code&amp;gt;).&lt;br /&gt;
***** If the route and &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; is set, load the component router;&lt;br /&gt;
***** Else, get the active menu item and get the route vars from it&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Application Route Building ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Custom Router Rules ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== Additional References ==&lt;br /&gt;
&lt;br /&gt;
There is a useful thread on this subject here: [[jtopic:148632]] (note, may be out of date)&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Tutorials]][[Category:Component Development]][[Category:Search Engine Friendly URLs]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Search_Engine_Friendly_URLs&amp;diff=77664</id>
		<title>Search Engine Friendly URLs</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Search_Engine_Friendly_URLs&amp;diff=77664"/>
		<updated>2012-11-21T01:26:05Z</updated>

		<summary type="html">&lt;p&gt;Mvangeest: Added information - first attempt&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Search engine friendly (SEF)&#039;&#039;&#039;, &#039;&#039;&#039;human-readable&#039;&#039;&#039; or  [[wikipedia:Clean_URL|clean URLs]] are URLs that make sense to both humans and search engines because they explain the path to the particular page they point to. Since version 1.5, Joomla! is capable of creating and parsing URLs in any format, including SEF URLs. This does not depend on URL rewriting executed by the web server, so it works even if Joomla! runs a server other than Apache with the mod_rewrite module. The SEF URLs follow a certain fixed pattern, but the user can define a [[Alias|short descriptive text (alias)]] for each segment of the URL.&lt;br /&gt;
&lt;br /&gt;
Internally, the local part of a SEF URL (the part after the domain name) is called a &#039;&#039;&#039;route&#039;&#039;&#039;. Creating and processing SEF URLs is therefore referred to as &#039;&#039;&#039;routing&#039;&#039;&#039;, and the relevant code is called a &#039;&#039;&#039;router&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
A good example of routing is the URL to &amp;quot;Welcome to Joomla!&amp;quot; article in the sample data.&lt;br /&gt;
&lt;br /&gt;
* Without SEF URLs turned on, the URL is &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_content&amp;amp;view=article&amp;amp;id=1:welcome-to-joomla&amp;amp;catid=1:latest-news&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* With SEF URLs on and mod_rewrite off, it&#039;s &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php/the-­news/1-­latest­-news/1­-welcome­-to­-joomla&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* With both SEF URLs and mod_rewrite on, it&#039;s &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/the-­news/1­-latest-­news/1-­welcome-­to­-joomla&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Search engine friendly URLs can be activated by turning on the &#039;&#039;&#039;Search Engine Friendly URLs&#039;&#039;&#039; option in the &#039;&#039;Global Configuration&#039;&#039;. This option is on by default since Joomla! 1.6. See [[Enabling Search Engine Friendly (SEF) URLs]] for more information.&lt;br /&gt;
&lt;br /&gt;
== Frequently Asked Questions ==&lt;br /&gt;
&lt;br /&gt;
=== What do the numbers in the URL mean? ===&lt;br /&gt;
By comparing the old and the new URL we can see numbers in the old URL,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/index.php?option=com_content&amp;amp;view=article&amp;amp;id=1:welcome-to-joomla&amp;amp;catid=1:latest-news&amp;amp;Itemid=50&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but also in the new URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/the-­news/1­-latest-­news/1-­welcome-­to­-joomla&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These numbers are the parameters that are needed by Joomla! to get the internal URL and show the page you want to see. (In this case, the first numeral one is the ID of the category, the second numeral one is the ID of the article.)&lt;br /&gt;
&lt;br /&gt;
=== There is no &amp;lt;tt&amp;gt;index.php&amp;lt;/tt&amp;gt; in the URL anymore. Can I delete the file now? ===&lt;br /&gt;
No! The URL may doesn&#039;t contain the &amp;lt;tt&amp;gt;index.php&amp;lt;/tt&amp;gt; anymore, but internally the mod_rewrite will only redirect to the original path without showing it to you.&lt;br /&gt;
&lt;br /&gt;
=== What is the [[Alias]] value? And how does it get created? ===&lt;br /&gt;
Alias is listed beneath the Title field in Articles, Categories, Sections and Menu Items. Joomla! can automatically create the alias for you. An automatic alias begins with the title. All upper case letters are changed to lower case. Spaces and special characters not allowed in a URL; they are changed to dashes.&lt;br /&gt;
&lt;br /&gt;
=== I want to specify my own value for Alias. ===&lt;br /&gt;
If you do not like the alias provided by Joomla!, you can enter a value of your choosing into that field. Many believe using good keywords in your URL helps search engine optimization. You can do so by including those keywords in your title, and allowing Joomla! to create the alias, or by creating the alias yourself.&lt;br /&gt;
&lt;br /&gt;
=== How is Alias used in a URL? ===&lt;br /&gt;
For a menu item, Joomla! uses the alias as the URL plug. Assume that you use the first two SEF URL options and you create a menu item called Products. Your URL would be example.com/products.&lt;br /&gt;
&lt;br /&gt;
Joomla! also uses the primary key values of data within the URL to help the router navigate to the correct page. Continuing with the previous example, if your products menu item was for an Article­/Category Blog, the link for the Article Title and/or Read More link would have three parts:&lt;br /&gt;
&lt;br /&gt;
* The menu item URL - example.com/products;&lt;br /&gt;
&lt;br /&gt;
* Plus, the primary key for the Category and the Category alias - 32-fruit;&lt;br /&gt;
&lt;br /&gt;
* Plus, the primary key for the Article and the Article alias - 1-apple;&lt;br /&gt;
&lt;br /&gt;
The complete URL is: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://example.com/products/32-fruit/1-apple&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How can I get rid of the numbers in the SEF URLs? ===&lt;br /&gt;
The numbers in the SEF URL are needed by Joomla!&#039;s router to know how to direct site traffic. Once the router logic stabilizes, simple third party system plugins can be developed to augment the router capabilities by allowing more choice. At that time, numbers will likely be removed from the URL.&lt;br /&gt;
&lt;br /&gt;
== Route Formats and Routing Mechanism ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This section describes Joomla!&#039;s core (built-in) routing mechanism. Routing extensions may change the way routes are created on your system.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To describe the Joomla! routing mechanism in more detail, we first need to pin down what we refer to as a &#039;&#039;&#039;route&#039;&#039;&#039;. In our example URL, &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://example.com/sites/first/products/32-fruit/1-apple&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://example.com/sites/first/&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; is the part of the URL that is the same for all URLs managed by a Joomla! installation. It is generally referred to as the &#039;&#039;&#039;base URL&#039;&#039;&#039;. Neither Joomla! nor any component router can create URLs with a different first part. The second part, &amp;lt;tt&amp;gt;products/32-fruit/1-apple&amp;lt;/tt&amp;gt;, is a &#039;&#039;&#039;route&#039;&#039;&#039;, consisting of three &#039;&#039;&#039;segment&#039;&#039;&#039;s.&lt;br /&gt;
&lt;br /&gt;
The first segment of a route is, for regular URLs, the alias of a menu item. This means that only routes that use menu items will function entirely correctly. The SEF URL is said to be &#039;&#039;&#039;routed through&#039;&#039;&#039; that menu item. The other segments are determined entirely by the router of the component that provides the type of the menu item. The &#039;&#039;Category - Blog&#039;&#039; menu item type, for example, is provided by the [[Content]] component, and therefore that component&#039;s router is responsible for building and parsing the remaining segements.&lt;br /&gt;
&lt;br /&gt;
It is also possible (for extensions) to ask the system to create a route without supplying a menu item to route through. In that case, the system will usually decide to create a &#039;&#039;component route&#039;&#039;, meaning the first segment of the route will be the word &amp;lt;tt&amp;gt;component&amp;lt;/tt&amp;gt;. The component router follows a fixed format, choosing the name of the component (without the leading &amp;lt;tt&amp;gt;com_&amp;lt;/tt&amp;gt;) as the second segment and any parameters as the other segments.&lt;br /&gt;
&lt;br /&gt;
It is important to note that it is not possible for a Joomla! user to define a route that leads to a specific component without making a menu item. (Systems that do have this possibility usually call it a &#039;&#039;global route&#039;&#039;.) This reduces the chance of ambiguous routes, i.e. routes that could lead to two different pages, since the menu item alias directly specifies which component&#039;s router is allowed to parse a certain route. Also, creating a route that behaves as a global route is not difficult. An often-applied method is to create a menu item in a menu that isn&#039;t displayed anywhere. Such a menu is usually called a [[Menu|hidden menu]].&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Joomla Routes ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This section describes the routing implementation. If you are a component developer, see [[Supporting SEF URLs in your component]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Joomla routes are created and resolved by [[JRouter|the JRouter class]]. This class looks in the component root of the currently active component (specified in the &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; parameter in the query string) and includes the &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; file in that component&#039;s root directory. It then calls one of two functions: one for creating the SEF URL and one for interpreting the SEF URL.&lt;br /&gt;
&lt;br /&gt;
The JRouter class is overridden by the Joomla CMS in &amp;lt;tt&amp;gt;/includes/router.php&amp;lt;/tt&amp;gt;. In this file the build and parse functions are overridden to properly build and parse the URLs for the Joomla CMS.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;router.php&amp;lt;/tt&amp;gt; file in each component (for example, &amp;lt;tt&amp;gt;/components/com_content/router.php&amp;lt;/tt&amp;gt;) should contain the following two functions:&lt;br /&gt;
* ContentBuildRoute - this builds the SEF URL&lt;br /&gt;
** Parameters&lt;br /&gt;
*** $query - this is a named array containing the querystring variables&lt;br /&gt;
** Returns: an array of segments where each segment is separated by a &#039;/&#039; when later combined to create the actual URL (the items in the array should not contain &#039;/&#039; characters)&lt;br /&gt;
* ContentParseRoute - this interprets an SEF URL&lt;br /&gt;
** Parameters&lt;br /&gt;
*** $segments - this is an array that contains the segments of the URL requested.&lt;br /&gt;
** Returns: a name =&amp;gt; value array of the querystring variables that the link maps to&lt;br /&gt;
&lt;br /&gt;
=== The SEF Plugin ===&lt;br /&gt;
The Joomla &#039;&#039;System - SEF&#039;&#039; plugin inherits &amp;lt;code&amp;gt;JPlugin&amp;lt;/code&amp;gt; and implements the &amp;lt;code&amp;gt;onAfterRender()&amp;lt;/code&amp;gt; function. In this function the body of the response that will be sent to the browser is retrieved using &amp;lt;code&amp;gt;JResponse::getBody()&amp;lt;/code&amp;gt;. The body of the response is then searched for links containing &amp;lt;tt&amp;gt;/index.php...&amp;lt;/tt&amp;gt; and replaces them with a correct SEF URL by calling &amp;lt;code&amp;gt;JRoute::_(&#039;&#039;url&#039;&#039;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
JRoute builds SEF URLs by instantiating a &amp;lt;code&amp;gt;JRouter&amp;lt;/code&amp;gt; object and requesting that it build the correct link from the passed in URL.&lt;br /&gt;
&lt;br /&gt;
=== Handling SEF URLs ===&lt;br /&gt;
By default the SEF URLs are handled by the &amp;lt;code&amp;gt;JRouterSite&amp;lt;/code&amp;gt; object (from &amp;lt;tt&amp;gt;/includes/router.php&amp;lt;/tt&amp;gt;) and is called by a call to &amp;lt;code&amp;gt;JApplication::route()&amp;lt;/code&amp;gt; in index.php. This call is made on the &amp;lt;code&amp;gt;$app&amp;lt;/code&amp;gt; variable which is actually an instance of &amp;lt;code&amp;gt;JSite&amp;lt;/code&amp;gt; (from &amp;lt;tt&amp;gt;/includes/application.php&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;JApplication::route()&amp;lt;/code&amp;gt; has a non-destructive result on the &amp;lt;code&amp;gt;$_GET&amp;lt;/code&amp;gt; array. That is, &amp;lt;code&amp;gt;JApplication::route()&amp;lt;/code&amp;gt; sets variables in &amp;lt;code&amp;gt;$_GET&amp;lt;/code&amp;gt; by calling &amp;lt;code&amp;gt;JRequest::set()&amp;lt;/code&amp;gt; with the overwrite flag set to false. Thus if a variable name is returned from &amp;lt;code&amp;gt;JRouter::route()&amp;lt;/code&amp;gt; that is already in &amp;lt;code&amp;gt;$_GET&amp;lt;/code&amp;gt;, it will not put that value into &amp;lt;code&amp;gt;$_GET&amp;lt;/code&amp;gt;. This allows for custom routing.&lt;br /&gt;
&lt;br /&gt;
=== Custom Routing ===&lt;br /&gt;
Joomla allows you to create your own routing mechanism. In order to create this mechanism you must have a plugin that overrides the &amp;lt;code&amp;gt;JPlugin::onAfterInitialise()&amp;lt;/code&amp;gt; function. This function then parses the URL and creates the needed variables in &amp;lt;code&amp;gt;$_GET&amp;lt;/code&amp;gt; before the standard Joomla routing is done.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;See [[Creating a System Plugin to augment JRouter]] for an example.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Category:Search Engine Friendly URLs| ]]&lt;/div&gt;</summary>
		<author><name>Mvangeest</name></author>
	</entry>
</feed>