<?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=Garkell</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=Garkell"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Garkell"/>
	<updated>2026-05-15T17:05:56Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Calendar_form_field_type&amp;diff=997332</id>
		<title>Calendar form field type</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Calendar_form_field_type&amp;diff=997332"/>
		<updated>2022-12-15T01:51:32Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Minor tweek to the format&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;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
The &#039;&#039;&#039;calendar&#039;&#039;&#039; form field type provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value. If the field has a saved value this is shown in the text box. Otherwise the default value, if any, is displayed.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:DatePicker1.calendar-&amp;lt;translate&amp;gt;&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
en&amp;lt;/translate&amp;gt;.png|right]]&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;type&#039;&#039;&#039; (mandatory) must be &#039;&#039;calendar&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; (mandatory) is the unique name of the field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;label&#039;&#039;&#039; (mandatory) (translatable) is the descriptive title of the field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;default&#039;&#039;&#039; (optional) is the default date.  This must be given in the same format as specified by the format argument. You can put &amp;quot;NOW&amp;quot; to have current date or time information in the given format. You can also used any [[https://docs.joomla.org/How_to_use_JDate#Arguments JDate arguments]] (&#039;now +1 month&#039;, &#039;now +2 months +7 days +12 hours&#039;, ...)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039; (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the text box.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;readonly&#039;&#039;&#039; (optional) is whether the text box is read-only (&#039;&#039;true&#039;&#039; or &#039;&#039;false&#039;&#039;). If the text box is read-only, the date cannot be changed, but can be selected and copied. No calendar icon will be shown.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;disabled&#039;&#039;&#039; (optional) is whether the text box is disabled (&#039;&#039;true&#039;&#039; or &#039;&#039;false&#039;&#039;). If the text box is disabled, the date cannot be changed, selected or copied.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;class&#039;&#039;&#039; (optional) is a CSS class name for the HTML form field. It is recommended to use the &amp;quot;Bootstrap2 Relatives sizing&amp;quot; (see code examples below).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;format&#039;&#039;&#039; (optional) is the date format to be used.  This is in the format used by PHP to specify date string formats (see below).  If no format argument is given, &#039;%Y-%m-%d&#039; is assumed (giving dates like &#039;2017-05-15&#039;).  If &amp;lt;code&amp;gt;showtime&amp;lt;/code&amp;gt; is true then you will need to include some time fields, for example, &#039;%Y-%m-%d %H:%i:%s&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;filter&#039;&#039;&#039; (optional) is time zone to be used. There are two main values: &#039;&#039;server_utc&#039;&#039; and &#039;&#039;user_utc&#039;&#039;. The first one is server time zone and the later is user time zone as configured in global configuration and user information respectively. There is also a value of &#039;&#039;none&#039;&#039; which must be used if the server time zone is set to something other than UTC and &#039;&#039;showtime&#039;&#039; is false.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;translateformat&#039;&#039;&#039; (optional): If set to true, the calendar will use the &amp;lt;code&amp;gt;DATE_FORMAT_CALENDAR_DATE&amp;lt;/code&amp;gt; language key (if &amp;lt;code&amp;gt;showtime&amp;lt;/code&amp;gt; is true) or &amp;lt;code&amp;gt;DATE_FORMAT_CALENDAR_DATETIME&amp;lt;/code&amp;gt; (if &amp;lt;code&amp;gt;showtime&amp;lt;/code&amp;gt; is false) to determine the format. The &amp;lt;code&amp;gt;format&amp;lt;/code&amp;gt; attribute is ignored. If false, the &amp;lt;code&amp;gt;format&amp;lt;/code&amp;gt; attribute is used (same behaviour as prior to 3.7.0) but note that the &amp;lt;code&amp;gt;format&amp;lt;/code&amp;gt; string must include time fields for the time to be recorded.  Defaults to false.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;showtime&#039;&#039;&#039; (optional): If set to true and &amp;lt;code&amp;gt;translateformat&amp;lt;/code&amp;gt; is true, the language key &amp;lt;code&amp;gt;DATE_FORMAT_CALENDAR_DATETIME&amp;lt;/code&amp;gt; is used, otherwise &amp;lt;code&amp;gt;DATE_FORMAT_CALENDAR_DATE&amp;lt;/code&amp;gt;. (starting with 3.7.0).  Defaults to false.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;timeformat&#039;&#039;&#039; (optional): can be set to 12 or 24 (starting with 3.7.0).  If set to 12, an additional selection is available to the user to choose between AM and PM.  This attribute does not affect how the date/time is saved.  Defaults to 24.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;singleheader&#039;&#039;&#039; (optional): if set to false, the year and the month selection will be set on two separates lines, with independent selection (starting with 3.7.0).  Defaults to false.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;todaybutton&#039;&#039;&#039; (optional): if set to true, a button is added at the bottom of the date picker to select the date of the current day (starting with 3.7.0).  Defaults to true.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;weeknumbers&#039;&#039;&#039; (optional): if set to true, a column is added at the left of the date picker to display the number of the week in the current year (starting with 3.7.0).  Defaults to true.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;filltable&#039;&#039;&#039; (optional): if set to true, dates of the previous and next month are added at the top and bottom of the current month to fill the grid (starting with 3.7.0).  Defaults to true.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;minyear&#039;&#039;&#039; (optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative lower limit for the year selection. The user cannot select a year before this limit (starting with 3.7.0).  If zero, which is the default, there is no limit.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;maxyear&#039;&#039;&#039; (optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative upper limit for the year selection. The user cannot select a year after this limit (starting with 3.7.0).  If zero, which is the default, there is no limit.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Example for a light DatePicker XML field definition:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;field name=&amp;quot;&amp;lt;translate&amp;gt;&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
mycalendar&amp;lt;/translate&amp;gt;&amp;quot; type=&amp;quot;calendar&amp;quot; default=&amp;quot;&amp;lt;translate&amp;gt;&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
2017-05-15&amp;lt;/translate&amp;gt;&amp;quot; label=&amp;quot;&amp;lt;translate&amp;gt;&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
Select a date&amp;lt;/translate&amp;gt;&amp;quot; description=&amp;quot;&amp;quot;&lt;br /&gt;
	class=&amp;quot;input-small&amp;quot; required=&amp;quot;true&amp;quot; filter=&amp;quot;user_utc&amp;quot;&lt;br /&gt;
	showtime=&amp;quot;false&amp;quot; todaybutton=&amp;quot;false&amp;quot; filltable=&amp;quot;false&amp;quot; translateformat=&amp;quot;true&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
[[Image:DatePicker1.calendar-&amp;lt;translate&amp;gt;&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
en&amp;lt;/translate&amp;gt;.png|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Example for an advanced DatePicker XML field definition:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;field name=&amp;quot;&amp;lt;translate&amp;gt;&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
mycalendar&amp;lt;/translate&amp;gt;&amp;quot; type=&amp;quot;calendar&amp;quot; default=&amp;quot;&amp;lt;translate&amp;gt;&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
2017-05-15&amp;lt;/translate&amp;gt;&amp;quot; label=&amp;quot;&amp;lt;translate&amp;gt;&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Select a date&amp;lt;/translate&amp;gt;&amp;quot; description=&amp;quot;&amp;quot;&lt;br /&gt;
	class=&amp;quot;input-medium&amp;quot; required=&amp;quot;true&amp;quot; filter=&amp;quot;user_utc&amp;quot; format=&amp;quot;&amp;lt;translate&amp;gt;&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
%Y-%m-%d %H:%i:%s&amp;lt;/translate&amp;gt;&amp;quot;&lt;br /&gt;
	singleheader=&amp;quot;true&amp;quot; showtime=&amp;quot;true&amp;quot; timeformat=&amp;quot;12&amp;quot; todaybutton=&amp;quot;true&amp;quot; weeknumbers=&amp;quot;true&amp;quot;&lt;br /&gt;
	filltable=&amp;quot;true&amp;quot; minyear=&amp;quot;-3&amp;quot; maxyear=&amp;quot;5&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
[[Image:DatePicker2.calendar-&amp;lt;translate&amp;gt;&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
en&amp;lt;/translate&amp;gt;.png|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
The format attribute specifies the format that the date string will be saved in. It is also the format that manually entered dates need to be enterered in; except that the punctuation character is ignored. The coding scheme used to specify date formats is a custom one defined for the javascript library used in the datepicker, full details of which can be found for example on [https://github.com/joomla/joomla-cms/blob/staging/media/system/js/calendar-uncompressed.js#L1741-L1774 Joomla&#039;s Github].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
The following are some of the most frequently used date string codes:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
Character&amp;lt;/translate&amp;gt;&lt;br /&gt;
!&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
Description&amp;lt;/translate&amp;gt;&lt;br /&gt;
!&amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
Example&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|d&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
Day of the month, 2 digits with leading zeros&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
01 to 31&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|a&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
A textual representation of a day, three letters&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
Mon through Sun&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|e&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
Day of the month without leading zeros&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
1 to 31&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|A&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A full textual representation of the day of the week&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Monday through Sunday&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|w&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
Numeric representation of the day of the week&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
0 (for Sunday) through 6 (for Saturday)&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|j&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The day of the year (starting from 0)&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
001 through 366&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|B&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
A full textual representation of a month&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
January through December&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|m&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Numeric representation of a month, with leading zeros&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
01 through 12&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|b&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
A short textual representation of a month, three letters&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Jan through Dec&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Y&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
A full numeric representation of a year, 4 digits&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
1999 or 2003&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|y&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
A two-digit representation of a year&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
99 or 03&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|P&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Lowercase Ante Meridiem or Post Meridiem&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
am or pm&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|p&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Uppercase Ante Meridiem or Post Meridiem&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
AM or PM&amp;lt;/translate&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
Note: The format in which dates are stored in the params.ini file is that specified by the format argument.  Since there can be language-dependent elements to this format (for example, the &#039;%A&#039; specifier), you need to be careful not to use such elements if there is a possibility that the front-end and back-end languages may be different.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Note: The calendar form field type does not support non-Gregorian calendars.  If you need to support non-Gregorian calendars then you will need to create a custom form field type to support your calendar.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Standard associated filters === &amp;lt;!--T:46--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;user_utc&#039;&#039;&#039; - Calculates the specified value to the time of Greenwich, according to the user time zone settings.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== See also === &amp;lt;!--T:48--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
* [[S:MyLanguage/Standard form field types|List of standard form field types]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
[[Category:Standard form field types]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Calendar_form_field_type&amp;diff=997331</id>
		<title>Calendar form field type</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Calendar_form_field_type&amp;diff=997331"/>
		<updated>2022-12-15T01:50:05Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Minor tweek to the format&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;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
The &#039;&#039;&#039;calendar&#039;&#039;&#039; form field type provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value. If the field has a saved value this is shown in the text box. Otherwise the default value, if any, is displayed.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:DatePicker1.calendar-&amp;lt;translate&amp;gt;&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
en&amp;lt;/translate&amp;gt;.png|right]]&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;type&#039;&#039;&#039; (mandatory) must be &#039;&#039;calendar&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; (mandatory) is the unique name of the field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;label&#039;&#039;&#039; (mandatory) (translatable) is the descriptive title of the field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;default&#039;&#039;&#039; (optional) is the default date.  This must be given in the same format as specified by the format argument. You can put &amp;quot;NOW&amp;quot; to have current date or time information in the given format. You can also used any [[https://docs.joomla.org/How_to_use_JDate#Arguments JDate arguments]] (&#039;now +1 month&#039;, &#039;now +2 months +7 days +12 hours&#039;, ...)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039; (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the text box.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;readonly&#039;&#039;&#039; (optional) is whether the text box is read-only (&#039;&#039;true&#039;&#039; or &#039;&#039;false&#039;&#039;). If the text box is read-only, the date cannot be changed, but can be selected and copied. No calendar icon will be shown.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;disabled&#039;&#039;&#039; (optional) is whether the text box is disabled (&#039;&#039;true&#039;&#039; or &#039;&#039;false&#039;&#039;). If the text box is disabled, the date cannot be changed, selected or copied.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;class&#039;&#039;&#039; (optional) is a CSS class name for the HTML form field. It is recommended to use the &amp;quot;Bootstrap2 Relatives sizing&amp;quot; (see code examples below).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;format&#039;&#039;&#039; (optional) is the date format to be used.  This is in the format used by PHP to specify date string formats (see below).  If no format argument is given, &#039;%Y-%m-%d&#039; is assumed (giving dates like &#039;2017-05-15&#039;).  If &amp;lt;code&amp;gt;showtime&amp;lt;/code&amp;gt; is true then you will need to include some time fields, for example, &#039;%Y-%m-%d %H:%i:%s&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;filter&#039;&#039;&#039; (optional) is time zone to be used. There are two main values: &#039;&#039;server_utc&#039;&#039; and &#039;&#039;user_utc&#039;&#039;. The first one is server time zone and the later is user time zone as configured in global configuration and user information respectively. There is also a value of &#039;&#039;none&#039;&#039; which must be used if the server time zone is set to something other than UTC and &#039;&#039;showtime&#039;&#039; is false.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;translateformat&#039;&#039;&#039; (optional): If set to true, the calendar will use the &amp;lt;code&amp;gt;DATE_FORMAT_CALENDAR_DATE&amp;lt;/code&amp;gt; language key (if &amp;lt;code&amp;gt;showtime&amp;lt;/code&amp;gt; is true) or &amp;lt;code&amp;gt;DATE_FORMAT_CALENDAR_DATETIME&amp;lt;/code&amp;gt; (if &amp;lt;code&amp;gt;showtime&amp;lt;/code&amp;gt; is false) to determine the format. The &amp;lt;code&amp;gt;format&amp;lt;/code&amp;gt; attribute is ignored. If false, the &amp;lt;code&amp;gt;format&amp;lt;/code&amp;gt; attribute is used (same behaviour as prior to 3.7.0) but note that the &amp;lt;code&amp;gt;format&amp;lt;/code&amp;gt; string must include time fields for the time to be recorded.  Defaults to false.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;showtime&#039;&#039;&#039; (optional): If set to true and &amp;lt;code&amp;gt;translateformat&amp;lt;/code&amp;gt; is true, the language key &amp;lt;code&amp;gt;DATE_FORMAT_CALENDAR_DATETIME&amp;lt;/code&amp;gt; is used, otherwise &amp;lt;code&amp;gt;DATE_FORMAT_CALENDAR_DATE&amp;lt;/code&amp;gt;. (starting with 3.7.0).  Defaults to false.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;timeformat&#039;&#039;&#039; (optional): can be set to 12 or 24 (starting with 3.7.0).  If set to 12, an additional selection is available to the user to choose between AM and PM.  This attribute does not affect how the date/time is saved.  Defaults to 24.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;singleheader&#039;&#039;&#039; (optional): if set to false, the year and the month selection will be set on two separates lines, with independent selection (starting with 3.7.0).  Defaults to false.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;todaybutton&#039;&#039;&#039; (optional): if set to true, a button is added at the bottom of the date picker to select the date of the current day (starting with 3.7.0).  Defaults to true.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;weeknumbers&#039;&#039;&#039; (optional): if set to true, a column is added at the left of the date picker to display the number of the week in the current year (starting with 3.7.0).  Defaults to true.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;filltable&#039;&#039;&#039; (optional): if set to true, dates of the previous and next month are added at the top and bottom of the current month to fill the grid (starting with 3.7.0).  Defaults to true.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;minyear&#039;&#039;&#039; (optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative lower limit for the year selection. The user cannot select a year before this limit (starting with 3.7.0).  If zero, which is the default, there is no limit.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;maxyear&#039;&#039;&#039; (optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative upper limit for the year selection. The user cannot select a year after this limit (starting with 3.7.0).  If zero, which is the default, there is no limit.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Example for a light DatePicker XML field definition:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;field name=&amp;quot;&amp;lt;translate&amp;gt;&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
mycalendar&amp;lt;/translate&amp;gt;&amp;quot; type=&amp;quot;calendar&amp;quot; default=&amp;quot;&amp;lt;translate&amp;gt;&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
2017-05-15&amp;lt;/translate&amp;gt;&amp;quot; label=&amp;quot;&amp;lt;translate&amp;gt;&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
Select a date&amp;lt;/translate&amp;gt;&amp;quot; description=&amp;quot;&amp;quot;&lt;br /&gt;
	class=&amp;quot;input-small&amp;quot; required=&amp;quot;true&amp;quot; filter=&amp;quot;user_utc&amp;quot;&lt;br /&gt;
	showtime=&amp;quot;false&amp;quot; todaybutton=&amp;quot;false&amp;quot; filltable=&amp;quot;false&amp;quot; translateformat=&amp;quot;true&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
[[Image:DatePicker1.calendar-&amp;lt;translate&amp;gt;&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
en&amp;lt;/translate&amp;gt;.png|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Example for an advanced DatePicker XML field definition:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;field name=&amp;quot;&amp;lt;translate&amp;gt;&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
mycalendar&amp;lt;/translate&amp;gt;&amp;quot; type=&amp;quot;calendar&amp;quot; default=&amp;quot;&amp;lt;translate&amp;gt;&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
2017-05-15&amp;lt;/translate&amp;gt;&amp;quot; label=&amp;quot;&amp;lt;translate&amp;gt;&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Select a date&amp;lt;/translate&amp;gt;&amp;quot; description=&amp;quot;&amp;quot;&lt;br /&gt;
	class=&amp;quot;input-medium&amp;quot; required=&amp;quot;true&amp;quot; filter=&amp;quot;user_utc&amp;quot; format=&amp;quot;&amp;lt;translate&amp;gt;&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
%Y-%m-%d %H:%M:%S&amp;lt;/translate&amp;gt;&amp;quot;&lt;br /&gt;
	singleheader=&amp;quot;true&amp;quot; showtime=&amp;quot;true&amp;quot; timeformat=&amp;quot;12&amp;quot; todaybutton=&amp;quot;true&amp;quot; weeknumbers=&amp;quot;true&amp;quot;&lt;br /&gt;
	filltable=&amp;quot;true&amp;quot; minyear=&amp;quot;-3&amp;quot; maxyear=&amp;quot;5&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
[[Image:DatePicker2.calendar-&amp;lt;translate&amp;gt;&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
en&amp;lt;/translate&amp;gt;.png|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
The format attribute specifies the format that the date string will be saved in. It is also the format that manually entered dates need to be enterered in; except that the punctuation character is ignored. The coding scheme used to specify date formats is a custom one defined for the javascript library used in the datepicker, full details of which can be found for example on [https://github.com/joomla/joomla-cms/blob/staging/media/system/js/calendar-uncompressed.js#L1741-L1774 Joomla&#039;s Github].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
The following are some of the most frequently used date string codes:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
Character&amp;lt;/translate&amp;gt;&lt;br /&gt;
!&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
Description&amp;lt;/translate&amp;gt;&lt;br /&gt;
!&amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
Example&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|d&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
Day of the month, 2 digits with leading zeros&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
01 to 31&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|a&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
A textual representation of a day, three letters&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
Mon through Sun&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|e&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
Day of the month without leading zeros&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
1 to 31&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|A&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
A full textual representation of the day of the week&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Monday through Sunday&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|w&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
Numeric representation of the day of the week&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
0 (for Sunday) through 6 (for Saturday)&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|j&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The day of the year (starting from 0)&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
001 through 366&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|B&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
A full textual representation of a month&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
January through December&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|m&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Numeric representation of a month, with leading zeros&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
01 through 12&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|b&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
A short textual representation of a month, three letters&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Jan through Dec&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Y&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
A full numeric representation of a year, 4 digits&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
1999 or 2003&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|y&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
A two-digit representation of a year&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
99 or 03&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|P&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Lowercase Ante Meridiem or Post Meridiem&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
am or pm&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|p&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
Uppercase Ante Meridiem or Post Meridiem&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
AM or PM&amp;lt;/translate&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
Note: The format in which dates are stored in the params.ini file is that specified by the format argument.  Since there can be language-dependent elements to this format (for example, the &#039;%A&#039; specifier), you need to be careful not to use such elements if there is a possibility that the front-end and back-end languages may be different.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Note: The calendar form field type does not support non-Gregorian calendars.  If you need to support non-Gregorian calendars then you will need to create a custom form field type to support your calendar.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Standard associated filters === &amp;lt;!--T:46--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;user_utc&#039;&#039;&#039; - Calculates the specified value to the time of Greenwich, according to the user time zone settings.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== See also === &amp;lt;!--T:48--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
* [[S:MyLanguage/Standard form field types|List of standard form field types]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
[[Category:Standard form field types]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:Garkell&amp;diff=782663</id>
		<title>User:Garkell</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:Garkell&amp;diff=782663"/>
		<updated>2021-02-13T23:29:18Z</updated>

		<summary type="html">&lt;p&gt;Garkell: &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;
{{Top portal heading|color=white-bkgd|icon=joomla|icon-color=#5091cd|size=5x|text-color=#333|title=&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt; Joomla 4 Custom FormFields&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt; This will help with creating your own custom formfield for your component ready for Joomla 4.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== An Example Custom Field Type == &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
Suppose you&#039;re working on your component named &#039;&#039;com_phonebook&#039;&#039; and you want to define a field that contains cities. Create the file &amp;lt;code&amp;gt;administrator/components/com_phonebook/src/Field/CityField.php&amp;lt;/code&amp;gt; and write something similar to the following:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
namespace yourname\Component\Phonebook\Administrator\Field;&lt;br /&gt;
&lt;br /&gt;
// Check to ensure this file is included in Joomla!&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
use \Joomla\CMS\Factory;&lt;br /&gt;
use \Joomla\CMS\Form\FormField;&lt;br /&gt;
use \yourname\Component\Phonebook\Administrator\Helper\PhonebookHelper;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class CityField extends FormField &lt;br /&gt;
{&lt;br /&gt;
	protected $type = &#039;City&#039;;&lt;br /&gt;
&lt;br /&gt;
	// getLabel() left out&lt;br /&gt;
&lt;br /&gt;
	public function getInput() {&lt;br /&gt;
		return &#039;&amp;lt;select id=&amp;quot;&#039;.$this-&amp;gt;id.&#039;&amp;quot; name=&amp;quot;&#039;.$this-&amp;gt;name.&#039;&amp;quot;&amp;gt;&#039;.&lt;br /&gt;
		       &#039;&amp;lt;option value=&amp;quot;1&amp;quot; &amp;gt;New York&amp;lt;/option&amp;gt;&#039;.&lt;br /&gt;
		       &#039;&amp;lt;option value=&amp;quot;2&amp;quot; &amp;gt;Chicago&amp;lt;/option&amp;gt;&#039;.&lt;br /&gt;
		       &#039;&amp;lt;option value=&amp;quot;3&amp;quot; &amp;gt;San Francisco&amp;lt;/option&amp;gt;&#039;.&lt;br /&gt;
		       &#039;&amp;lt;/select&amp;gt;&#039;;&lt;br /&gt;
	}&lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:JDOC Projects{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla!_4.x{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:Garkell&amp;diff=782662</id>
		<title>User:Garkell</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:Garkell&amp;diff=782662"/>
		<updated>2021-02-13T23:28:01Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Initial creation - just learning&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;
{{Top portal heading|color=white-bkgd|icon=joomla|icon-color=#5091cd|size=5x|text-color=#333|title=&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt; Joomla 4 Custom FormFields&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt; This will help with creating your own custom formfield for your component ready for Joomla 4.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== An Example Custom Field Type == &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
Suppose you&#039;re working on your component named &#039;&#039;com_phonebook&#039;&#039; and you want to define a field that contains cities. Create the file &amp;lt;code&amp;gt;administrator/components/com_phonebook/src/Field/CityField.php&amp;lt;/code&amp;gt; and write something similar to the following:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
namespace yourname\Component\Phonebook\Administrator\Field;&lt;br /&gt;
&lt;br /&gt;
// Check to ensure this file is included in Joomla!&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
use \Joomla\CMS\Factory;&lt;br /&gt;
use \Joomla\CMS\Form\FormField;&lt;br /&gt;
use \yourname\Component\Phonebook\Administrator\Helper\PhonebookHelper;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class CityField extends FormField {&lt;br /&gt;
	&lt;br /&gt;
	protected $type = &#039;City&#039;;&lt;br /&gt;
&lt;br /&gt;
	// getLabel() left out&lt;br /&gt;
&lt;br /&gt;
	public function getInput() {&lt;br /&gt;
		return &#039;&amp;lt;select id=&amp;quot;&#039;.$this-&amp;gt;id.&#039;&amp;quot; name=&amp;quot;&#039;.$this-&amp;gt;name.&#039;&amp;quot;&amp;gt;&#039;.&lt;br /&gt;
		       &#039;&amp;lt;option value=&amp;quot;1&amp;quot; &amp;gt;New York&amp;lt;/option&amp;gt;&#039;.&lt;br /&gt;
		       &#039;&amp;lt;option value=&amp;quot;2&amp;quot; &amp;gt;Chicago&amp;lt;/option&amp;gt;&#039;.&lt;br /&gt;
		       &#039;&amp;lt;option value=&amp;quot;3&amp;quot; &amp;gt;San Francisco&amp;lt;/option&amp;gt;&#039;.&lt;br /&gt;
		       &#039;&amp;lt;/select&amp;gt;&#039;;&lt;br /&gt;
	}&lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:JDOC Projects{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla!_4.x{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Web_Assets&amp;diff=771828</id>
		<title>J4.x:Web Assets</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Web_Assets&amp;diff=771828"/>
		<updated>2020-12-22T00:11:09Z</updated>

		<summary type="html">&lt;p&gt;Garkell: readability&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;translate&amp;gt;&lt;br /&gt;
== Concept == &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt; In the frontend world many assets are related. For example our keepalive script depends on the core.js file for options management. In Joomla there never was an easy way to specify this, you just had to include multiple files. Joomla 4 changes this with the concept of web assets.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Definition == &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt; Related assets are defined in a JSON file such as [https://github.com/joomla/joomla-cms/blob/7b72c565b610e02c1b01f8958d622879631fa6a2/build/media_source/system/joomla.asset.json#L14-L21 system/joomla.asset.json#L14-L21] &amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt; This has a structure of having a schema definition (for validation), name, version, license and then one or more asset definitions. Assets are comprised of a list of js files and css files related to the assets and any dependencies. The dependencies section is just a list of asset names that are required for the asset to function. Example:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;$schema&amp;quot;: &amp;quot;https://developer.joomla.org/schemas/json-schema/web_assets.json&amp;quot;,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;com_example&amp;quot;,&lt;br /&gt;
  &amp;quot;version&amp;quot;: &amp;quot;4.0.0&amp;quot;,&lt;br /&gt;
  &amp;quot;description&amp;quot;: &amp;quot;Joomla CMS&amp;quot;,&lt;br /&gt;
  &amp;quot;license&amp;quot;: &amp;quot;GPL-2.0+&amp;quot;,&lt;br /&gt;
  &amp;quot;assets&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;bar&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;style&amp;quot;,&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/bar.css&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;bar&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/bar.js&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;beer&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;style&amp;quot;,&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/beer.css&amp;quot;,&lt;br /&gt;
      &amp;quot;dependencies&amp;quot;: [&lt;br /&gt;
        &amp;quot;bar&amp;quot;&lt;br /&gt;
      ],&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;beer&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
      &amp;quot;dependencies&amp;quot;: [&lt;br /&gt;
        &amp;quot;core&amp;quot;,&lt;br /&gt;
        &amp;quot;bar&amp;quot;&lt;br /&gt;
      ],&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/beer.js&amp;quot;,&lt;br /&gt;
      &amp;quot;attributes&amp;quot;: {&lt;br /&gt;
        &amp;quot;defer&amp;quot;: true,&lt;br /&gt;
        &amp;quot;data-foo&amp;quot;: &amp;quot;bar&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;source lang=&amp;quot;json&amp;quot; inline&amp;gt;$schema&amp;lt;/source&amp;gt; attribute is a schema definition file that allows you to validate your file using JSON Schema. Read [https://json-schema.org/understanding-json-schema/index.html the official website] for more information on json schema validation works.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Having joomla.asset.json for your extension or template are recommend but not required to WebAssset to work (see next section).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; It is not recommended to add an inline asset to a json file, prefer to use a file.&lt;br /&gt;
&lt;br /&gt;
== Explaining asset stages ==&lt;br /&gt;
&lt;br /&gt;
Each asset has 2 stages: registered and used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Registered&#039;&#039;&#039; is where an asset is loaded into &#039;&#039;&#039;WebAssetRegistry&#039;&#039;&#039;. That means &#039;&#039;&#039;WebAssetManager&#039;&#039;&#039; knows about the existence of these assets, but will not attach them to a document while rendering.&lt;br /&gt;
All assets loaded from joomla.asset.json is at &#039;&#039;&#039;registered&#039;&#039;&#039; stage.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Used&#039;&#039;&#039; is where an asset is enabled via &amp;quot;$wa-&amp;gt;useAsset()&amp;quot; (-&amp;gt;useScript(), -&amp;gt;useStyle(), -&amp;gt;registerAndUseX() etc). That means &#039;&#039;&#039;WebAssetManager&#039;&#039;&#039; will attach these assets and their dependencies to a document while rendering.&lt;br /&gt;
&lt;br /&gt;
An asset cannot be used if it was not registered before, this will cause an unknown asset exception.&lt;br /&gt;
&lt;br /&gt;
== Register an asset ==&lt;br /&gt;
&lt;br /&gt;
All known assets loaded and then stored in &#039;&#039;&#039;WebAssetRegistry&#039;&#039;&#039; (to enable/disable an asset item you have to use &#039;&#039;&#039;WebAssetManager&#039;&#039;&#039;, see next section).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt; Joomla! will look for next assets definition automatically at runtime (in following order):&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
media/vendor/joomla.asset.json (on first access to WebAssetRegistry)&lt;br /&gt;
media/system/joomla.asset.json&lt;br /&gt;
media/legacy/joomla.asset.json&lt;br /&gt;
media/{com_active_component}/joomla.asset.json (on dispatch the application)&lt;br /&gt;
templates/{active_template}/joomla.asset.json&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And load them to registry of known assets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt; &#039;&#039;&#039;Note:&#039;&#039;&#039; Each following assets definition will override asset items from previous assets definition, by item name.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt; You can register your own assets definition via &#039;&#039;&#039;WebAssetRegistry&#039;&#039;&#039;:&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;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
$wr = $wa-&amp;gt;getRegistry();&lt;br /&gt;
$wr-&amp;gt;addRegistryFile(&#039;relative/path/to/your/joomla.asset.json&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt; To add a custom asset item at runtime:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wr-&amp;gt;add(&#039;script&#039;, new Joomla\CMS\WebAsset\WebAssetItem(&#039;foobar&#039;, &#039;com_foobar/file.js&#039;, [&#039;type&#039; =&amp;gt; &#039;script&#039;]));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or more simply, using &#039;&#039;&#039;WebAssetManager&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wa-&amp;gt;registerScript(&#039;foobar&#039;, &#039;com_foobar/file.js&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new asset item &#039;&#039;&#039;foobar&#039;&#039;&#039; will be added to the registry of know assets, but will not be attached to a document until your code (a layout, template etc) will request it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt; To check whether an asset exists:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
if ($wa-&amp;gt;assetExists(&#039;script&#039;, &#039;foobar&#039;))&lt;br /&gt;
{&lt;br /&gt;
    var_dump(&#039;Script &amp;quot;foobar&amp;quot; exists!&#039;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enabling an asset == &amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt; All asset management in the current Document handled by &#039;&#039;&#039;WebAssetManager&#039;&#039;&#039;, which is accessible with &#039;&#039;&#039;$doc-&amp;gt;getWebAssetManager();&#039;&#039;&#039;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt; By using AssetManager you can enable or disable needed asset easily in Joomla! through a standard methods.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt; To enable an asset in the page use the useAsset function, for example:&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;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
$wa-&amp;gt;useScript(&#039;keepalive&#039;);&lt;br /&gt;
&lt;br /&gt;
// Or multiple&lt;br /&gt;
$wa-&amp;gt;useScript(&#039;keepalive&#039;)&lt;br /&gt;
    -&amp;gt;useScript(&#039;fields.validate&#039;)&lt;br /&gt;
    -&amp;gt;useStyle(&#039;foobar&#039;)&lt;br /&gt;
    -&amp;gt;useScript(&#039;foobar&#039;);&lt;br /&gt;
&lt;br /&gt;
// Add new asset item with dependency and use it&lt;br /&gt;
$wa-&amp;gt;registerAndUseScript(&#039;bar&#039;, &#039;com_foobar/bar.js&#039;, [], [], [&#039;core&#039;, &#039;foobar&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt; &#039;&#039;&#039;WebAssetManager&#039;&#039;&#039; will look to &#039;&#039;&#039;WebAssetRegistry&#039;&#039;&#039; whether the requested asset exists, and will enable it for current Document instance. Otherwise it will throw an UnknownAssetException.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt; To disable an asset in the page use the disableAsset function. The example below will disable the jquery-noconflict asset from being loaded.&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;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
$wa-&amp;gt;disableScript(&#039;jquery-noconflict&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt; &#039;&#039;&#039;Note:&#039;&#039;&#039; If there are any dependencies to the disabled asset, then this asset will be re-enabled automatically, no matter what.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt; To check whether asset enabled, and the asset state:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Checking whether an asset are active (enabled manually or automatically as dependency)&lt;br /&gt;
if ($wa-&amp;gt;isAssetActive(&#039;script&#039;, &#039;foobar&#039;))&lt;br /&gt;
{&lt;br /&gt;
    var_dump(&#039;Script &amp;quot;foobar&amp;quot; are active!&#039;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Checking state&lt;br /&gt;
switch($wa-&amp;gt;getAssetState(&#039;script&#039;, &#039;foobar&#039;)){&lt;br /&gt;
	case Joomla\CMS\WebAsset\WebAssetManager::ASSET_STATE_ACTIVE:&lt;br /&gt;
		var_dump(&#039;Active! Was enabled manually&#039;);&lt;br /&gt;
		break;&lt;br /&gt;
	case Joomla\CMS\WebAsset\WebAssetManager::ASSET_STATE_DEPENDENCY:&lt;br /&gt;
		var_dump(&#039;Active! Was enabled automatically while resolving dependencies&#039;);&lt;br /&gt;
		break;&lt;br /&gt;
	default:&lt;br /&gt;
		var_dump(&#039;not active!&#039;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Overriding an asset == &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Overriding may be useful when you need to redefine the URI of asset item or its dependencies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
As already was noted, each of the following assets definition from joomla.asset.json will override asset items from previous assets definitions, by item name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
That means if you provide joomla.asset.json which contain already loaded asset items, they will be replaced with your items.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Another way to override in the code is to register an item with the same name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Example, we have &amp;quot;foobar&amp;quot; script, that load com_example/foobar.js library, and we want to use CDN for this exact library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
How it defined in the system initially:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
  &amp;quot;uri&amp;quot;: &amp;quot;com_example/foobar.js&amp;quot;,&lt;br /&gt;
  &amp;quot;dependencies&amp;quot;: [&amp;quot;core&amp;quot;]&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
To override the URI we define the asset item with &amp;quot;foobar&amp;quot; name in our joomla.asset.json:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
  &amp;quot;uri&amp;quot;: &amp;quot;http://foobar.cdn.blabla/foobar.js&amp;quot;,&lt;br /&gt;
  &amp;quot;dependencies&amp;quot;: [&amp;quot;core&amp;quot;]&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Or, register new asset item with AssetManager:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wa-&amp;gt;registerScript(&#039;foobar&#039;, &#039;http://fobar.cdn.blabla/foobar.js&#039;, [], [], [&#039;core&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working with a styles == &amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
AssetManager allow to manage Stylesheet files. Stylesheet asset item have a type &amp;quot;style&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
Example json defination of item in joomla.asset.json:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;style&amp;quot;,&lt;br /&gt;
  &amp;quot;uri&amp;quot;: &amp;quot;com_example/foobar.css&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Methods to work with styles === &amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
AssetManager offers the following methods to work with style files:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
// Attach foobar to the document&lt;br /&gt;
$wa-&amp;gt;useStyle(&#039;foobar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
// Disable foobar from being attached&lt;br /&gt;
$wa-&amp;gt;disableStyle(&#039;foobar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
// Register custom item without json defination&lt;br /&gt;
$wa-&amp;gt;registerStyle(&#039;bar&#039;, &#039;com_example/bar.css&#039;, [], [&#039;data-foo&#039; =&amp;gt; &#039;some attribute&#039;], [&#039;some.dependency&#039;]);&lt;br /&gt;
// And use it later&lt;br /&gt;
$wa-&amp;gt;useStyle(&#039;bar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
// Register and attach a custom item in one run&lt;br /&gt;
$wa-&amp;gt;registerAndUseStyle(&#039;bar&#039;, &#039;com_example/bar.css&#039;, [], [&#039;data-foo&#039; =&amp;gt; &#039;some attribute&#039;], [&#039;some.dependency&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add inline style === &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Additionaly to style files, WebAssetManager allows you to add an inline style, and maintain their relation to the file asset.&lt;br /&gt;
Inline styles may be placed directly before the dependency, after the dependency, or as usual after all styles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Inline asset may have a name as well as other assets (but not required), the name can be used to retrieve the asset item from a registry, or as a dependency to another inline asset. If the name is not specified then a generated name based on a content hash will be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
// Add an inline content as usual, will be rendered in flow after all assets&lt;br /&gt;
$wa-&amp;gt;addInlineStyle(&#039;content of inline1&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
// Add an inline content that will be placed after &amp;quot;foobar&amp;quot; asset&lt;br /&gt;
$wa-&amp;gt;addInlineStyle(&#039;content of inline2&#039;, [&#039;position&#039; =&amp;gt; &#039;after&#039;], [&#039;data-foo&#039; =&amp;gt; &#039;bar&#039;], [&#039;foobar&#039;]);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
// Add an inline content that will be placed before &amp;quot;foobar&amp;quot; asset&lt;br /&gt;
$wa-&amp;gt;addInlineStyle(&#039;content of inline3&#039;, [&#039;position&#039; =&amp;gt; &#039;before&#039;], [], [&#039;foobar&#039;]);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
// Named inline asset&lt;br /&gt;
$wa-&amp;gt;addInlineStyle(&#039;content of inline4&#039;, [&#039;name&#039; =&amp;gt; &#039;my.inline.asset&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; &amp;quot;foobar&amp;quot; asset should exist in the asset registry, otherwise you will get an unsatisfied dependency exception.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
Example above will produce:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html5&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;style&amp;gt;content of inline3&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;foobar.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;style data-foo=&amp;quot;bar&amp;quot;&amp;gt;content of inline2&amp;lt;/style&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;style&amp;gt;content of inline1&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt;content of inline4&amp;lt;/style&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
If inline asset has multiple dependencies, then will be used last one for positioning. Example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wa-&amp;gt;addInlineStyle(&#039;content of inline1&#039;, [&#039;position&#039; =&amp;gt; &#039;before&#039;], [], [&#039;foo&#039;, &#039;bar&#039;]);&lt;br /&gt;
$wa-&amp;gt;addInlineStyle(&#039;content of inline2&#039;, [&#039;position&#039; =&amp;gt; &#039;after&#039;], [], [&#039;foo&#039;, &#039;bar&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Will produce:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html5&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;foo.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt;content of inline1&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;bar.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt;content of inline2&amp;lt;/style&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Named inline assets may be a dependency to another inline asset, however it is not recommended to use an inline asset as dependency to non-inline asset. This will work, but this behavior may change in the future. Prefer to use &amp;quot;position&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
== Working with a scripts == &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
AssetManager allow to manage Script files. Script asset item have a type &amp;quot;script&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
Example json defination of item in joomla.asset.json:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
  &amp;quot;uri&amp;quot;: &amp;quot;com_example/foobar.js&amp;quot;,&lt;br /&gt;
  &amp;quot;dependencies&amp;quot;: [&amp;quot;core&amp;quot;]&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Methods to work with scripts === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
AssetManager offer next methods to work with script files:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
// Attach foobar to the document&lt;br /&gt;
$wa-&amp;gt;useScript(&#039;foobar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
// Disable foobar from being attached&lt;br /&gt;
$wa-&amp;gt;disableScript(&#039;foobar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
// Register custom item without json defination&lt;br /&gt;
$wa-&amp;gt;registerScript(&#039;bar&#039;, &#039;com_example/bar.js&#039;, [], [&#039;defer&#039; =&amp;gt; true], [&#039;core&#039;]);&lt;br /&gt;
// And use it later&lt;br /&gt;
$wa-&amp;gt;useScript(&#039;bar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
// Register and attach a custom item in one run&lt;br /&gt;
$wa-&amp;gt;registerAndUseScript(&#039;bar&#039;,&#039;com_example/bar.js&#039;, [], [&#039;defer&#039; =&amp;gt; true], [&#039;core&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add inline script === &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
Addittionaly to script files WebAssetManager allow to add an inline script, and maintain their relation to the file asset.&lt;br /&gt;
Inline script may be placed directly before the dependency, after the dependency, or as usual after all scripts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
Inline asset may have a name as well as other assets (but not required), the name can be used to retrive the asset item form a registry, or as dependecy to another inline asset. If name not specified then will be used generated name based on a content hash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
// Add an inline content as usual, will be rendered in flow after all assets&lt;br /&gt;
$wa-&amp;gt;addInlineScript(&#039;content of inline1&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
// Add an inline content that will be placed after &amp;quot;foobar&amp;quot; asset&lt;br /&gt;
$wa-&amp;gt;addInlineScript(&#039;content of inline2&#039;, [&#039;position&#039; =&amp;gt; &#039;after&#039;], [&#039;data-foo&#039; =&amp;gt; &#039;bar&#039;], [&#039;foobar&#039;]);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
// Add an inline content that will be placed before &amp;quot;foobar&amp;quot; asset&lt;br /&gt;
$wa-&amp;gt;addInlineScript(&#039;content of inline3&#039;, [&#039;position&#039; =&amp;gt; &#039;before&#039;], [], [&#039;foobar&#039;]);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
// Named inline asset&lt;br /&gt;
$wa-&amp;gt;addInlineScript(&#039;content of inline4&#039;, [&#039;name&#039; =&amp;gt; &#039;my.inline.asset&#039;]);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
// Specify script type&lt;br /&gt;
$wa-&amp;gt;addInlineScript(&#039;content of inline5&#039;, [], [&#039;type&#039; =&amp;gt; &#039;module&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; &amp;quot;foobar&amp;quot; asset should exist in the asset registry, otherwise you will get an unsatisfied dependency exception.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
Example above will produce:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html5&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;script&amp;gt;content of inline3&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script src=&amp;quot;foobar.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script data-foo=&amp;quot;bar&amp;quot;&amp;gt;content of inline2&amp;lt;/script&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;script&amp;gt;content of inline1&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;content of inline4&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;module&amp;quot;&amp;gt;content of inline5&amp;lt;/script&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
If inline asset have a multiple dependencies, then will be used last one for positioning. Example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wa-&amp;gt;addInlineScript(&#039;content of inline1&#039;, [&#039;position&#039; =&amp;gt; &#039;before&#039;], [], [&#039;foo&#039;, &#039;bar&#039;]);&lt;br /&gt;
$wa-&amp;gt;addInlineScript(&#039;content of inline2&#039;, [&#039;position&#039; =&amp;gt; &#039;after&#039;], [], [&#039;foo&#039;, &#039;bar&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Will produce:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html5&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;script src=&amp;quot;foo.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;content of inline1&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script src=&amp;quot;bar.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;content of inline2&amp;lt;/script&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Named inline asset may be as dependency to another inline asset, hovewer it is not recomended to use an inline asset as dependency to non-inline asset. This will work, but this behavior may changes in future. Prefer to use &amp;quot;position&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
== Working with a web component == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
Joomla! allows you to use Web Components (https://developer.mozilla.org/en-US/docs/Web/Web_Components) for your needs. In Joomla! web components are not loaded as regular script, but loaded via Web Component loader so that they are loaded asynchronously. Therefore, a web component asset item must have a flag &amp;quot;webcomponent&amp;quot; set to the boolean &amp;quot;true&amp;quot;.&lt;br /&gt;
In all other aspects, working with web components in AssetManager is the same as working with a &amp;quot;script&amp;quot; asset item.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Example json definition of some web components in joomla.asset.json:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;webcomponent.foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;style&amp;quot;,&lt;br /&gt;
  &amp;quot;uri&amp;quot;: &amp;quot;com_example/foobar-custom-element.css&amp;quot;,&lt;br /&gt;
  &amp;quot;webcomponent&amp;quot;: true&lt;br /&gt;
},&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;webcomponent.foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
  &amp;quot;uri&amp;quot;: &amp;quot;com_example/foobar-custom-element.js&amp;quot;,&lt;br /&gt;
  &amp;quot;webcomponent&amp;quot;: true&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
Alternatively you can register them in PHP:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wa-&amp;gt;registerStyle(&#039;webcomponent.foobar&#039;, &#039;com_example/foobar-custom-element.css&#039;, [&#039;webcomponent&#039; =&amp;gt; true])&lt;br /&gt;
    -&amp;gt;registerScript(&#039;webcomponent.foobar&#039;, &#039;com_example/foobar-custom-element.js&#039;, [&#039;webcomponent&#039; =&amp;gt; true]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Attach to document:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wa-&amp;gt;useStyle(&#039;webcomponent.foobar&#039;)&lt;br /&gt;
    -&amp;gt;useScript(&#039;webcomponent.foobar&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; It is preferred to prefix the asset name with &amp;quot;webcomponent.&amp;quot; to make it easily to spot, and distinct it from regular scripts in a layout.&lt;br /&gt;
&lt;br /&gt;
=== Methods to work with web component === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
All methods to work with a web component are the same as methods to work with script asset item.&lt;br /&gt;
&lt;br /&gt;
== Working with a presets == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;quot;Preset&amp;quot; is a special kind of asset item that hold a list of items that has to be enabled, in same way as direct call of useAsset() to each of item in the list.&lt;br /&gt;
Preset can hold mixed types of assets (script, style, another preset, etc), the type should be provided after # symbol and follows after an asset name, example: foo#style, bar#script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Example json defination of item in joomla.asset.json:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;preset&amp;quot;,&lt;br /&gt;
  &amp;quot;uri&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
  &amp;quot;dependencies&amp;quot;: [&lt;br /&gt;
    &amp;quot;core#script&amp;quot;,&lt;br /&gt;
    &amp;quot;foobar#style&amp;quot;,&lt;br /&gt;
    &amp;quot;foobar#script&amp;quot;,&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Methods to work with preset === &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
AssetManager offer next methods to work with preset items:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
// Attach all items from foobar preset to the document&lt;br /&gt;
$wa-&amp;gt;usePreset(&#039;foobar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
// Disable all items from foobar preset from being attached&lt;br /&gt;
$wa-&amp;gt;disablePreset(&#039;foobar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
// Register custom item without json defination&lt;br /&gt;
$wa-&amp;gt;registerPreset(&#039;bar&#039;, &#039;&#039;, [], [], [&#039;core#script&#039;, &#039;bar#script&#039;]);&lt;br /&gt;
// And use it later&lt;br /&gt;
$wa-&amp;gt;usePreset(&#039;bar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
// Register and attach a custom item in one run&lt;br /&gt;
$wa-&amp;gt;registerAndUsePreset(&#039;bar&#039;,&#039;&#039;, [], [], [&#039;core#script&#039;, &#039;bar#script&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Advanced: Custom WebAssetItem class == &amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt; The default class for all WebAsset items is &#039;&#039;&#039;Joomla\CMS\WebAsset\WebAssetItem&#039;&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:21--&amp;gt; You are also allowed to use a custom class, which must implement &#039;&#039;&#039;Joomla\CMS\WebAsset\WebAssetItemInterface&#039;&#039;&#039; or extend &#039;&#039;&#039;Joomla\CMS\WebAsset\WebAssetItem&#039;&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt; A custom class can allow you to do advanced actions, for example, including a script file depending on an active language:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class MyComExampleAssetItem extends WebAssetItem&lt;br /&gt;
{&lt;br /&gt;
	public function getUri($resolvePath = true): string&lt;br /&gt;
	{&lt;br /&gt;
		$langTag = Factory::getApplication()-&amp;gt;getLanguage()-&amp;gt;getTag();&lt;br /&gt;
		// For script asset use &amp;quot;.js&amp;quot;, for style we would use &amp;quot;.css&amp;quot;&lt;br /&gt;
		$path    = &#039;com_example/bar-&#039; . $langTag . &#039;.js&#039;;&lt;br /&gt;
&lt;br /&gt;
		if ($resolvePath)&lt;br /&gt;
		{&lt;br /&gt;
			// For script asset use &amp;quot;script&amp;quot;, for style we would use &amp;quot;stylesheet&amp;quot;&lt;br /&gt;
			$path = $this-&amp;gt;resolvePath($path, &#039;script&#039;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $path;&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;&amp;lt;!--T:23--&amp;gt; Additionally, implementing &#039;&#039;&#039;Joomla\CMS\WebAsset\WebAssetAttachBehaviorInterface&#039;&#039;&#039; allows you to add a script options (which may depend on the environment) when your asset is enabled and attached to the Document.&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;
class MyFancyFoobarAssetItem extends WebAssetItem implements WebAssetAttachBehaviorInterface&lt;br /&gt;
{&lt;br /&gt;
	public function onAttachCallback(Document $doc): void&lt;br /&gt;
	{&lt;br /&gt;
		$user = Factory::getApplication()-&amp;gt;getIdentity();&lt;br /&gt;
		$doc-&amp;gt;addScriptOptions(&#039;com_example.fancyfoobar&#039;, [&#039;userName&#039; =&amp;gt; $user-&amp;gt;username]);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important note:&#039;&#039;&#039; An asset item that implements &#039;&#039;&#039;WebAssetAttachBehaviorInterface&#039;&#039;&#039; should be enabled before [https://docs.joomla.org/Plugin/Events/System#onBeforeCompileHead onBeforeCompileHead] event, otherwise &#039;onAttachCallback&#039; will be ignored.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Defining a custom WebAssetItem class in joomla.asset.json === &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:25--&amp;gt; In joomla.asset.json you can define which Class should be used with specific AssetItem.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt; For this you can use 2 properties &#039;&#039;&#039;namespace&#039;&#039;&#039; and &#039;&#039;&#039;class&#039;&#039;&#039;. &#039;&#039;&#039;namespace&#039;&#039;&#039; can be defined at Root level (then it will be used as default namespace for all Asset items in joomla.asset.json) or in the Item level. For example:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;$schema&amp;quot;: &amp;quot;https://developer.joomla.org/schemas/json-schema/web_assets.json&amp;quot;,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;com_example&amp;quot;,&lt;br /&gt;
  &amp;quot;version&amp;quot;: &amp;quot;4.0.0&amp;quot;,&lt;br /&gt;
  &amp;quot;namespace&amp;quot;: &amp;quot;Joomla\Component\Example\WebAsset&amp;quot;,&lt;br /&gt;
  &amp;quot;assets&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;foo&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
      &amp;quot;class&amp;quot;: &amp;quot;FooAssetItem&amp;quot;,&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/foo.js&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;bar&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
      &amp;quot;namespace&amp;quot;: &amp;quot;MyFooBar\Library\Example\WebAsset&amp;quot;,&lt;br /&gt;
      &amp;quot;class&amp;quot;: &amp;quot;BarAssetItem&amp;quot;,&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/bar.js&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt; Here the asset &#039;&#039;&#039;foo&#039;&#039;&#039; will be associated with class &#039;&#039;&#039;Joomla\Component\Example\WebAsset\FooAssetItem&#039;&#039;&#039;, and &#039;&#039;&#039;bar&#039;&#039;&#039; with class &#039;&#039;&#039;MyFooBar\Library\Example\WebAsset\BarAssetItem&#039;&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt; &#039;&#039;&#039;Note:&#039;&#039;&#039; If &#039;&#039;&#039;namespace&#039;&#039;&#039; are not defined then by default will be used &#039;&#039;&#039;Joomla\CMS\WebAsset&#039;&#039;&#039;. When &#039;&#039;&#039;namespace&#039;&#039;&#039; is defined but empty, then no namespace will be used, only &#039;&#039;&#039;class&#039;&#039;&#039;. Example:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;$schema&amp;quot;: &amp;quot;https://developer.joomla.org/schemas/json-schema/web_assets.json&amp;quot;,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;com_example&amp;quot;,&lt;br /&gt;
  &amp;quot;assets&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;foo&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
      &amp;quot;class&amp;quot;: &amp;quot;FooAssetItem&amp;quot;,&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/foo.js&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;bar&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
      &amp;quot;namespace&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
      &amp;quot;class&amp;quot;: &amp;quot;BarAssetItem&amp;quot;,&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/bar.js&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt; Here the asset &#039;&#039;&#039;foo&#039;&#039;&#039; will be associated with class &#039;&#039;&#039;Joomla\CMS\WebAsset\FooAssetItem&#039;&#039;&#039;, and &#039;&#039;&#039;bar&#039;&#039;&#039; with class &#039;&#039;&#039;BarAssetItem&#039;&#039;&#039; (without namespace).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Joomla! 4.x{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla! 4.0{{#translation:}}]]&lt;br /&gt;
[[Category:Tutorials{{#translation:}}]]&lt;br /&gt;
[[Category:Development{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Web_Assets&amp;diff=771827</id>
		<title>J4.x:Web Assets</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Web_Assets&amp;diff=771827"/>
		<updated>2020-12-22T00:03:10Z</updated>

		<summary type="html">&lt;p&gt;Garkell: readability&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;translate&amp;gt;&lt;br /&gt;
== Concept == &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt; In the frontend world many assets are related. For example our keepalive script depends on the core.js file for options management. In Joomla there never was an easy way to specify this, you just had to include multiple files. Joomla 4 changes this with the concept of web assets.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Definition == &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt; Related assets are defined in a JSON file such as [https://github.com/joomla/joomla-cms/blob/7b72c565b610e02c1b01f8958d622879631fa6a2/build/media_source/system/joomla.asset.json#L14-L21 system/joomla.asset.json#L14-L21] &amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt; This has a structure of having a schema definition (for validation), name, version, license and then one or more asset definitions. Assets are comprised of a list of js files and css files related to the assets and any dependencies. The dependencies section is just a list of asset names that are required for the asset to function. Example:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;$schema&amp;quot;: &amp;quot;https://developer.joomla.org/schemas/json-schema/web_assets.json&amp;quot;,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;com_example&amp;quot;,&lt;br /&gt;
  &amp;quot;version&amp;quot;: &amp;quot;4.0.0&amp;quot;,&lt;br /&gt;
  &amp;quot;description&amp;quot;: &amp;quot;Joomla CMS&amp;quot;,&lt;br /&gt;
  &amp;quot;license&amp;quot;: &amp;quot;GPL-2.0+&amp;quot;,&lt;br /&gt;
  &amp;quot;assets&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;bar&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;style&amp;quot;,&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/bar.css&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;bar&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/bar.js&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;beer&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;style&amp;quot;,&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/beer.css&amp;quot;,&lt;br /&gt;
      &amp;quot;dependencies&amp;quot;: [&lt;br /&gt;
        &amp;quot;bar&amp;quot;&lt;br /&gt;
      ],&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;beer&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
      &amp;quot;dependencies&amp;quot;: [&lt;br /&gt;
        &amp;quot;core&amp;quot;,&lt;br /&gt;
        &amp;quot;bar&amp;quot;&lt;br /&gt;
      ],&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/beer.js&amp;quot;,&lt;br /&gt;
      &amp;quot;attributes&amp;quot;: {&lt;br /&gt;
        &amp;quot;defer&amp;quot;: true,&lt;br /&gt;
        &amp;quot;data-foo&amp;quot;: &amp;quot;bar&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;source lang=&amp;quot;json&amp;quot; inline&amp;gt;$schema&amp;lt;/source&amp;gt; attribute is a schema definition file that allows you to validate your file using JSON Schema. Read [https://json-schema.org/understanding-json-schema/index.html the official website] for more information on json schema validation works.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Having joomla.asset.json for your extension or template are recommend but not required to WebAssset to work (see next section).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; It is not recommended to add an inline asset to a json file, prefer to use a file.&lt;br /&gt;
&lt;br /&gt;
== Explaining asset stages ==&lt;br /&gt;
&lt;br /&gt;
Each asset has 2 stages: registered and used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Registered&#039;&#039;&#039; is where an asset is loaded into &#039;&#039;&#039;WebAssetRegistry&#039;&#039;&#039;. That means &#039;&#039;&#039;WebAssetManager&#039;&#039;&#039; knows about the existence of these assets, but will not attach them to a document while rendering.&lt;br /&gt;
All assets loaded from joomla.asset.json is at &#039;&#039;&#039;registered&#039;&#039;&#039; stage.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Used&#039;&#039;&#039; is where an asset is enabled via &amp;quot;$wa-&amp;gt;useAsset()&amp;quot; (-&amp;gt;useScript(), -&amp;gt;useStyle(), -&amp;gt;registerAndUseX() etc). That means &#039;&#039;&#039;WebAssetManager&#039;&#039;&#039; will attach these assets and their dependencies to a document while rendering.&lt;br /&gt;
&lt;br /&gt;
An asset cannot be used if it was not registered before, this will cause an unknown asset exception.&lt;br /&gt;
&lt;br /&gt;
== Register an asset ==&lt;br /&gt;
&lt;br /&gt;
All known assets loaded and then stored in &#039;&#039;&#039;WebAssetRegistry&#039;&#039;&#039; (to enable/disable an asset item you have to use &#039;&#039;&#039;WebAssetManager&#039;&#039;&#039;, see next section).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt; Joomla! will look for next assets definition automatically at runtime (in following order):&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
media/vendor/joomla.asset.json (on first access to WebAssetRegistry)&lt;br /&gt;
media/system/joomla.asset.json&lt;br /&gt;
media/legacy/joomla.asset.json&lt;br /&gt;
media/{com_active_component}/joomla.asset.json (on dispatch the application)&lt;br /&gt;
templates/{active_template}/joomla.asset.json&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And load them to registry of known assets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt; &#039;&#039;&#039;Note:&#039;&#039;&#039; Each following assets definition will override asset items from previous assets definition, by item name.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt; You can register your own assets definition via &#039;&#039;&#039;WebAssetRegistry&#039;&#039;&#039;:&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;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
$wr = $wa-&amp;gt;getRegistry();&lt;br /&gt;
$wr-&amp;gt;addRegistryFile(&#039;relative/path/to/your/joomla.asset.json&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt; To add a custom asset item at runtime:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wr-&amp;gt;add(&#039;script&#039;, new Joomla\CMS\WebAsset\WebAssetItem(&#039;foobar&#039;, &#039;com_foobar/file.js&#039;, [&#039;type&#039; =&amp;gt; &#039;script&#039;]));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or more simply, using &#039;&#039;&#039;WebAssetManager&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wa-&amp;gt;registerScript(&#039;foobar&#039;, &#039;com_foobar/file.js&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new asset item &#039;&#039;&#039;foobar&#039;&#039;&#039; will be added to the registry of know assets, but will not be attached to a document until your code (a layout, template etc) will request it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt; To check whether an asset exists:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
if ($wa-&amp;gt;assetExists(&#039;script&#039;, &#039;foobar&#039;))&lt;br /&gt;
{&lt;br /&gt;
    var_dump(&#039;Script &amp;quot;foobar&amp;quot; exists!&#039;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enabling an asset == &amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt; All asset management in the current Document handled by &#039;&#039;&#039;WebAssetManager&#039;&#039;&#039;, which is accessible with &#039;&#039;&#039;$doc-&amp;gt;getWebAssetManager();&#039;&#039;&#039;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt; By using AssetManager you can enable or disable needed asset easily in Joomla! through a standard methods.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt; To enable an asset in the page use the useAsset function, for example:&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;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
$wa-&amp;gt;useScript(&#039;keepalive&#039;);&lt;br /&gt;
&lt;br /&gt;
// Or multiple&lt;br /&gt;
$wa-&amp;gt;useScript(&#039;keepalive&#039;)&lt;br /&gt;
    -&amp;gt;useScript(&#039;fields.validate&#039;)&lt;br /&gt;
    -&amp;gt;useStyle(&#039;foobar&#039;)&lt;br /&gt;
    -&amp;gt;useScript(&#039;foobar&#039;);&lt;br /&gt;
&lt;br /&gt;
// Add new asset item with dependency and use it&lt;br /&gt;
$wa-&amp;gt;registerAndUseScript(&#039;bar&#039;, &#039;com_foobar/bar.js&#039;, [], [], [&#039;core&#039;, &#039;foobar&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt; &#039;&#039;&#039;WebAssetManager&#039;&#039;&#039; will look to &#039;&#039;&#039;WebAssetRegistry&#039;&#039;&#039; whether the requested asset exists, and will enable it for current Document instance. Otherwise it will throw an UnknownAssetException.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt; To disable an asset in the page use the disableAsset function. The example below will disable the jquery-noconflict asset from being loaded.&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;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
$wa-&amp;gt;disableScript(&#039;jquery-noconflict&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt; &#039;&#039;&#039;Note:&#039;&#039;&#039; If there are any dependencies to the disabled asset, then this asset will be re-enabled automatically, no matter what.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt; To check whether asset enabled, and the asset state:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Checking whether an asset are active (enabled manually or automatically as dependency)&lt;br /&gt;
if ($wa-&amp;gt;isAssetActive(&#039;script&#039;, &#039;foobar&#039;))&lt;br /&gt;
{&lt;br /&gt;
    var_dump(&#039;Script &amp;quot;foobar&amp;quot; are active!&#039;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Checking state&lt;br /&gt;
switch($wa-&amp;gt;getAssetState(&#039;script&#039;, &#039;foobar&#039;)){&lt;br /&gt;
	case Joomla\CMS\WebAsset\WebAssetManager::ASSET_STATE_ACTIVE:&lt;br /&gt;
		var_dump(&#039;Active! Was enabled manually&#039;);&lt;br /&gt;
		break;&lt;br /&gt;
	case Joomla\CMS\WebAsset\WebAssetManager::ASSET_STATE_DEPENDENCY:&lt;br /&gt;
		var_dump(&#039;Active! Was enabled automatically while resolving dependencies&#039;);&lt;br /&gt;
		break;&lt;br /&gt;
	default:&lt;br /&gt;
		var_dump(&#039;not active!&#039;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Overriding an asset == &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Overriding may be useful when you need to redefine the URI of asset item or its dependencies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
As already was noted, each of the following assets definition from joomla.asset.json will override asset items from previous assets definitions, by item name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
That means if you provide joomla.asset.json which contain already loaded asset items, they will be replaced with your items.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Another way to override in the code is to register an item with the same name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Example, we have &amp;quot;foobar&amp;quot; script, that load com_example/foobar.js library, and we want to use CDN for this exact library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
How it defined in the system initially:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
  &amp;quot;uri&amp;quot;: &amp;quot;com_example/foobar.js&amp;quot;,&lt;br /&gt;
  &amp;quot;dependencies&amp;quot;: [&amp;quot;core&amp;quot;]&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
To override the URI we define the asset item with &amp;quot;foobar&amp;quot; name in our joomla.asset.json:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
  &amp;quot;uri&amp;quot;: &amp;quot;http://foobar.cdn.blabla/foobar.js&amp;quot;,&lt;br /&gt;
  &amp;quot;dependencies&amp;quot;: [&amp;quot;core&amp;quot;]&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Or, register new asset item with AssetManager:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wa-&amp;gt;registerScript(&#039;foobar&#039;, &#039;http://fobar.cdn.blabla/foobar.js&#039;, [], [], [&#039;core&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working with a styles == &amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
AssetManager allow to manage Stylesheet files. Stylesheet asset item have a type &amp;quot;style&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
Example json defination of item in joomla.asset.json:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;style&amp;quot;,&lt;br /&gt;
  &amp;quot;uri&amp;quot;: &amp;quot;com_example/foobar.css&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Methods to work with styles === &amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
AssetManager offers the following methods to work with style files:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
// Attach foobar to the document&lt;br /&gt;
$wa-&amp;gt;useStyle(&#039;foobar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
// Disable foobar from being attached&lt;br /&gt;
$wa-&amp;gt;disableStyle(&#039;foobar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
// Register custom item without json defination&lt;br /&gt;
$wa-&amp;gt;registerStyle(&#039;bar&#039;, &#039;com_example/bar.css&#039;, [], [&#039;data-foo&#039; =&amp;gt; &#039;some attribute&#039;], [&#039;some.dependency&#039;]);&lt;br /&gt;
// And use it later&lt;br /&gt;
$wa-&amp;gt;useStyle(&#039;bar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
// Register and attach a custom item in one run&lt;br /&gt;
$wa-&amp;gt;registerAndUseStyle(&#039;bar&#039;, &#039;com_example/bar.css&#039;, [], [&#039;data-foo&#039; =&amp;gt; &#039;some attribute&#039;], [&#039;some.dependency&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add inline style === &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Addittionaly to style files WebAssetManager allow to add an inline style, and maintain their relation to the file asset.&lt;br /&gt;
Inline style may be placed directly before the dependency, after the dependency, or as usual after all styles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Inline asset may have a name as well as other assets (but not required), the name can be used to retrive the asset item form a registry, or as dependecy to another inline asset. If name not specified then will be used generated name based on a content hash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
// Add an inline content as usual, will be rendered in flow after all assets&lt;br /&gt;
$wa-&amp;gt;addInlineStyle(&#039;content of inline1&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
// Add an inline content that will be placed after &amp;quot;foobar&amp;quot; asset&lt;br /&gt;
$wa-&amp;gt;addInlineStyle(&#039;content of inline2&#039;, [&#039;position&#039; =&amp;gt; &#039;after&#039;], [&#039;data-foo&#039; =&amp;gt; &#039;bar&#039;], [&#039;foobar&#039;]);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
// Add an inline content that will be placed before &amp;quot;foobar&amp;quot; asset&lt;br /&gt;
$wa-&amp;gt;addInlineStyle(&#039;content of inline3&#039;, [&#039;position&#039; =&amp;gt; &#039;before&#039;], [], [&#039;foobar&#039;]);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
// Named inline asset&lt;br /&gt;
$wa-&amp;gt;addInlineStyle(&#039;content of inline4&#039;, [&#039;name&#039; =&amp;gt; &#039;my.inline.asset&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; &amp;quot;foobar&amp;quot; asset should exist in the asset registry, otherwise you will get an unsatisfied dependency exception.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
Example above will produce:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html5&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;style&amp;gt;content of inline3&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;foobar.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;style data-foo=&amp;quot;bar&amp;quot;&amp;gt;content of inline2&amp;lt;/style&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;style&amp;gt;content of inline1&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt;content of inline4&amp;lt;/style&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
If inline asset have a multiple dependencies, then will be used last one for positioning. Example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wa-&amp;gt;addInlineStyle(&#039;content of inline1&#039;, [&#039;position&#039; =&amp;gt; &#039;before&#039;], [], [&#039;foo&#039;, &#039;bar&#039;]);&lt;br /&gt;
$wa-&amp;gt;addInlineStyle(&#039;content of inline2&#039;, [&#039;position&#039; =&amp;gt; &#039;after&#039;], [], [&#039;foo&#039;, &#039;bar&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Will produce:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html5&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;foo.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt;content of inline1&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;bar.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt;content of inline2&amp;lt;/style&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Named inline asset may be as dependency to another inline asset, hovewer it is not recomended to use an inline asset as dependency to non-inline asset. This will work, but this behavior may changes in future. Prefer to use &amp;quot;position&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
== Working with a scripts == &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
AssetManager allow to manage Script files. Script asset item have a type &amp;quot;script&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
Example json defination of item in joomla.asset.json:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
  &amp;quot;uri&amp;quot;: &amp;quot;com_example/foobar.js&amp;quot;,&lt;br /&gt;
  &amp;quot;dependencies&amp;quot;: [&amp;quot;core&amp;quot;]&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Methods to work with scripts === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
AssetManager offer next methods to work with script files:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
// Attach foobar to the document&lt;br /&gt;
$wa-&amp;gt;useScript(&#039;foobar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
// Disable foobar from being attached&lt;br /&gt;
$wa-&amp;gt;disableScript(&#039;foobar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
// Register custom item without json defination&lt;br /&gt;
$wa-&amp;gt;registerScript(&#039;bar&#039;, &#039;com_example/bar.js&#039;, [], [&#039;defer&#039; =&amp;gt; true], [&#039;core&#039;]);&lt;br /&gt;
// And use it later&lt;br /&gt;
$wa-&amp;gt;useScript(&#039;bar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
// Register and attach a custom item in one run&lt;br /&gt;
$wa-&amp;gt;registerAndUseScript(&#039;bar&#039;,&#039;com_example/bar.js&#039;, [], [&#039;defer&#039; =&amp;gt; true], [&#039;core&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add inline script === &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
Addittionaly to script files WebAssetManager allow to add an inline script, and maintain their relation to the file asset.&lt;br /&gt;
Inline script may be placed directly before the dependency, after the dependency, or as usual after all scripts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
Inline asset may have a name as well as other assets (but not required), the name can be used to retrive the asset item form a registry, or as dependecy to another inline asset. If name not specified then will be used generated name based on a content hash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
// Add an inline content as usual, will be rendered in flow after all assets&lt;br /&gt;
$wa-&amp;gt;addInlineScript(&#039;content of inline1&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
// Add an inline content that will be placed after &amp;quot;foobar&amp;quot; asset&lt;br /&gt;
$wa-&amp;gt;addInlineScript(&#039;content of inline2&#039;, [&#039;position&#039; =&amp;gt; &#039;after&#039;], [&#039;data-foo&#039; =&amp;gt; &#039;bar&#039;], [&#039;foobar&#039;]);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
// Add an inline content that will be placed before &amp;quot;foobar&amp;quot; asset&lt;br /&gt;
$wa-&amp;gt;addInlineScript(&#039;content of inline3&#039;, [&#039;position&#039; =&amp;gt; &#039;before&#039;], [], [&#039;foobar&#039;]);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
// Named inline asset&lt;br /&gt;
$wa-&amp;gt;addInlineScript(&#039;content of inline4&#039;, [&#039;name&#039; =&amp;gt; &#039;my.inline.asset&#039;]);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
// Specify script type&lt;br /&gt;
$wa-&amp;gt;addInlineScript(&#039;content of inline5&#039;, [], [&#039;type&#039; =&amp;gt; &#039;module&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; &amp;quot;foobar&amp;quot; asset should exist in the asset registry, otherwise you will get an unsatisfied dependency exception.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
Example above will produce:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html5&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;script&amp;gt;content of inline3&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script src=&amp;quot;foobar.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script data-foo=&amp;quot;bar&amp;quot;&amp;gt;content of inline2&amp;lt;/script&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;script&amp;gt;content of inline1&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;content of inline4&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;module&amp;quot;&amp;gt;content of inline5&amp;lt;/script&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
If inline asset have a multiple dependencies, then will be used last one for positioning. Example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wa-&amp;gt;addInlineScript(&#039;content of inline1&#039;, [&#039;position&#039; =&amp;gt; &#039;before&#039;], [], [&#039;foo&#039;, &#039;bar&#039;]);&lt;br /&gt;
$wa-&amp;gt;addInlineScript(&#039;content of inline2&#039;, [&#039;position&#039; =&amp;gt; &#039;after&#039;], [], [&#039;foo&#039;, &#039;bar&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Will produce:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html5&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;script src=&amp;quot;foo.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;content of inline1&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script src=&amp;quot;bar.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;content of inline2&amp;lt;/script&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Named inline asset may be as dependency to another inline asset, hovewer it is not recomended to use an inline asset as dependency to non-inline asset. This will work, but this behavior may changes in future. Prefer to use &amp;quot;position&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
== Working with a web component == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
Joomla! allows you to use Web Components (https://developer.mozilla.org/en-US/docs/Web/Web_Components) for your needs. In Joomla! web components are not loaded as regular script, but loaded via Web Component loader so that they are loaded asynchronously. Therefore, a web component asset item must have a flag &amp;quot;webcomponent&amp;quot; set to the boolean &amp;quot;true&amp;quot;.&lt;br /&gt;
In all other aspects, working with web components in AssetManager is the same as working with a &amp;quot;script&amp;quot; asset item.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Example json definition of some web components in joomla.asset.json:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;webcomponent.foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;style&amp;quot;,&lt;br /&gt;
  &amp;quot;uri&amp;quot;: &amp;quot;com_example/foobar-custom-element.css&amp;quot;,&lt;br /&gt;
  &amp;quot;webcomponent&amp;quot;: true&lt;br /&gt;
},&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;webcomponent.foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
  &amp;quot;uri&amp;quot;: &amp;quot;com_example/foobar-custom-element.js&amp;quot;,&lt;br /&gt;
  &amp;quot;webcomponent&amp;quot;: true&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
Alternatively you can register them in PHP:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wa-&amp;gt;registerStyle(&#039;webcomponent.foobar&#039;, &#039;com_example/foobar-custom-element.css&#039;, [&#039;webcomponent&#039; =&amp;gt; true])&lt;br /&gt;
    -&amp;gt;registerScript(&#039;webcomponent.foobar&#039;, &#039;com_example/foobar-custom-element.js&#039;, [&#039;webcomponent&#039; =&amp;gt; true]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Attach to document:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wa-&amp;gt;useStyle(&#039;webcomponent.foobar&#039;)&lt;br /&gt;
    -&amp;gt;useScript(&#039;webcomponent.foobar&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; It is preferred to prefix the asset name with &amp;quot;webcomponent.&amp;quot; to make it easily to spot, and distinct it from regular scripts in a layout.&lt;br /&gt;
&lt;br /&gt;
=== Methods to work with web component === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
All methods to work with a web component are the same as methods to work with script asset item.&lt;br /&gt;
&lt;br /&gt;
== Working with a presets == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;quot;Preset&amp;quot; is a special kind of asset item that hold a list of items that has to be enabled, in same way as direct call of useAsset() to each of item in the list.&lt;br /&gt;
Preset can hold mixed types of assets (script, style, another preset, etc), the type should be provided after # symbol and follows after an asset name, example: foo#style, bar#script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Example json defination of item in joomla.asset.json:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;preset&amp;quot;,&lt;br /&gt;
  &amp;quot;uri&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
  &amp;quot;dependencies&amp;quot;: [&lt;br /&gt;
    &amp;quot;core#script&amp;quot;,&lt;br /&gt;
    &amp;quot;foobar#style&amp;quot;,&lt;br /&gt;
    &amp;quot;foobar#script&amp;quot;,&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Methods to work with preset === &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
AssetManager offer next methods to work with preset items:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
// Attach all items from foobar preset to the document&lt;br /&gt;
$wa-&amp;gt;usePreset(&#039;foobar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
// Disable all items from foobar preset from being attached&lt;br /&gt;
$wa-&amp;gt;disablePreset(&#039;foobar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
// Register custom item without json defination&lt;br /&gt;
$wa-&amp;gt;registerPreset(&#039;bar&#039;, &#039;&#039;, [], [], [&#039;core#script&#039;, &#039;bar#script&#039;]);&lt;br /&gt;
// And use it later&lt;br /&gt;
$wa-&amp;gt;usePreset(&#039;bar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
// Register and attach a custom item in one run&lt;br /&gt;
$wa-&amp;gt;registerAndUsePreset(&#039;bar&#039;,&#039;&#039;, [], [], [&#039;core#script&#039;, &#039;bar#script&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Advanced: Custom WebAssetItem class == &amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt; The default class for all WebAsset items is &#039;&#039;&#039;Joomla\CMS\WebAsset\WebAssetItem&#039;&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:21--&amp;gt; You are also allowed to use a custom class, which must implement &#039;&#039;&#039;Joomla\CMS\WebAsset\WebAssetItemInterface&#039;&#039;&#039; or extend &#039;&#039;&#039;Joomla\CMS\WebAsset\WebAssetItem&#039;&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt; A custom class can allow you to do advanced actions, for example, including a script file depending on an active language:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class MyComExampleAssetItem extends WebAssetItem&lt;br /&gt;
{&lt;br /&gt;
	public function getUri($resolvePath = true): string&lt;br /&gt;
	{&lt;br /&gt;
		$langTag = Factory::getApplication()-&amp;gt;getLanguage()-&amp;gt;getTag();&lt;br /&gt;
		// For script asset use &amp;quot;.js&amp;quot;, for style we would use &amp;quot;.css&amp;quot;&lt;br /&gt;
		$path    = &#039;com_example/bar-&#039; . $langTag . &#039;.js&#039;;&lt;br /&gt;
&lt;br /&gt;
		if ($resolvePath)&lt;br /&gt;
		{&lt;br /&gt;
			// For script asset use &amp;quot;script&amp;quot;, for style we would use &amp;quot;stylesheet&amp;quot;&lt;br /&gt;
			$path = $this-&amp;gt;resolvePath($path, &#039;script&#039;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $path;&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;&amp;lt;!--T:23--&amp;gt; Additionally, implementing &#039;&#039;&#039;Joomla\CMS\WebAsset\WebAssetAttachBehaviorInterface&#039;&#039;&#039; allows you to add a script options (which may depend on the environment) when your asset is enabled and attached to the Document.&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;
class MyFancyFoobarAssetItem extends WebAssetItem implements WebAssetAttachBehaviorInterface&lt;br /&gt;
{&lt;br /&gt;
	public function onAttachCallback(Document $doc): void&lt;br /&gt;
	{&lt;br /&gt;
		$user = Factory::getApplication()-&amp;gt;getIdentity();&lt;br /&gt;
		$doc-&amp;gt;addScriptOptions(&#039;com_example.fancyfoobar&#039;, [&#039;userName&#039; =&amp;gt; $user-&amp;gt;username]);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important note:&#039;&#039;&#039; An asset item that implements &#039;&#039;&#039;WebAssetAttachBehaviorInterface&#039;&#039;&#039; should be enabled before [https://docs.joomla.org/Plugin/Events/System#onBeforeCompileHead onBeforeCompileHead] event, otherwise &#039;onAttachCallback&#039; will be ignored.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Defining a custom WebAssetItem class in joomla.asset.json === &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:25--&amp;gt; In joomla.asset.json you can define which Class should be used with specific AssetItem.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt; For this you can use 2 properties &#039;&#039;&#039;namespace&#039;&#039;&#039; and &#039;&#039;&#039;class&#039;&#039;&#039;. &#039;&#039;&#039;namespace&#039;&#039;&#039; can be defined at Root level (then it will be used as default namespace for all Asset items in joomla.asset.json) or in the Item level. For example:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;$schema&amp;quot;: &amp;quot;https://developer.joomla.org/schemas/json-schema/web_assets.json&amp;quot;,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;com_example&amp;quot;,&lt;br /&gt;
  &amp;quot;version&amp;quot;: &amp;quot;4.0.0&amp;quot;,&lt;br /&gt;
  &amp;quot;namespace&amp;quot;: &amp;quot;Joomla\Component\Example\WebAsset&amp;quot;,&lt;br /&gt;
  &amp;quot;assets&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;foo&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
      &amp;quot;class&amp;quot;: &amp;quot;FooAssetItem&amp;quot;,&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/foo.js&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;bar&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
      &amp;quot;namespace&amp;quot;: &amp;quot;MyFooBar\Library\Example\WebAsset&amp;quot;,&lt;br /&gt;
      &amp;quot;class&amp;quot;: &amp;quot;BarAssetItem&amp;quot;,&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/bar.js&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt; Here the asset &#039;&#039;&#039;foo&#039;&#039;&#039; will be associated with class &#039;&#039;&#039;Joomla\Component\Example\WebAsset\FooAssetItem&#039;&#039;&#039;, and &#039;&#039;&#039;bar&#039;&#039;&#039; with class &#039;&#039;&#039;MyFooBar\Library\Example\WebAsset\BarAssetItem&#039;&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt; &#039;&#039;&#039;Note:&#039;&#039;&#039; If &#039;&#039;&#039;namespace&#039;&#039;&#039; are not defined then by default will be used &#039;&#039;&#039;Joomla\CMS\WebAsset&#039;&#039;&#039;. When &#039;&#039;&#039;namespace&#039;&#039;&#039; is defined but empty, then no namespace will be used, only &#039;&#039;&#039;class&#039;&#039;&#039;. Example:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;$schema&amp;quot;: &amp;quot;https://developer.joomla.org/schemas/json-schema/web_assets.json&amp;quot;,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;com_example&amp;quot;,&lt;br /&gt;
  &amp;quot;assets&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;foo&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
      &amp;quot;class&amp;quot;: &amp;quot;FooAssetItem&amp;quot;,&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/foo.js&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;bar&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
      &amp;quot;namespace&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
      &amp;quot;class&amp;quot;: &amp;quot;BarAssetItem&amp;quot;,&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/bar.js&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt; Here the asset &#039;&#039;&#039;foo&#039;&#039;&#039; will be associated with class &#039;&#039;&#039;Joomla\CMS\WebAsset\FooAssetItem&#039;&#039;&#039;, and &#039;&#039;&#039;bar&#039;&#039;&#039; with class &#039;&#039;&#039;BarAssetItem&#039;&#039;&#039; (without namespace).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Joomla! 4.x{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla! 4.0{{#translation:}}]]&lt;br /&gt;
[[Category:Tutorials{{#translation:}}]]&lt;br /&gt;
[[Category:Development{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Web_Assets&amp;diff=771826</id>
		<title>J4.x:Web Assets</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Web_Assets&amp;diff=771826"/>
		<updated>2020-12-21T23:54:25Z</updated>

		<summary type="html">&lt;p&gt;Garkell: /* Explaining asset stages */&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;translate&amp;gt;&lt;br /&gt;
== Concept == &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt; In the frontend world many assets are related. For example our keepalive script depends on the core.js file for options management. In Joomla there never was an easy way to specify this, you just had to include multiple files. Joomla 4 changes this with the concept of web assets.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Definition == &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt; Related assets are defined in a JSON file such as [https://github.com/joomla/joomla-cms/blob/7b72c565b610e02c1b01f8958d622879631fa6a2/build/media_source/system/joomla.asset.json#L14-L21 system/joomla.asset.json#L14-L21] &amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt; This has a structure of having a schema definition (for validation), name, version, license and then one or more asset definitions. Assets are comprised of a list of js files and css files related to the assets and any dependencies. The dependencies section is just a list of asset names that are required for the asset to function. Example:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;$schema&amp;quot;: &amp;quot;https://developer.joomla.org/schemas/json-schema/web_assets.json&amp;quot;,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;com_example&amp;quot;,&lt;br /&gt;
  &amp;quot;version&amp;quot;: &amp;quot;4.0.0&amp;quot;,&lt;br /&gt;
  &amp;quot;description&amp;quot;: &amp;quot;Joomla CMS&amp;quot;,&lt;br /&gt;
  &amp;quot;license&amp;quot;: &amp;quot;GPL-2.0+&amp;quot;,&lt;br /&gt;
  &amp;quot;assets&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;bar&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;style&amp;quot;,&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/bar.css&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;bar&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/bar.js&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;beer&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;style&amp;quot;,&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/beer.css&amp;quot;,&lt;br /&gt;
      &amp;quot;dependencies&amp;quot;: [&lt;br /&gt;
        &amp;quot;bar&amp;quot;&lt;br /&gt;
      ],&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;beer&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
      &amp;quot;dependencies&amp;quot;: [&lt;br /&gt;
        &amp;quot;core&amp;quot;,&lt;br /&gt;
        &amp;quot;bar&amp;quot;&lt;br /&gt;
      ],&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/beer.js&amp;quot;,&lt;br /&gt;
      &amp;quot;attributes&amp;quot;: {&lt;br /&gt;
        &amp;quot;defer&amp;quot;: true,&lt;br /&gt;
        &amp;quot;data-foo&amp;quot;: &amp;quot;bar&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;source lang=&amp;quot;json&amp;quot; inline&amp;gt;$schema&amp;lt;/source&amp;gt; attribute is a schema definition file that allows you to validate your file using JSON Schema. Read [https://json-schema.org/understanding-json-schema/index.html the official website] for more information on json schema validation works.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Having joomla.asset.json for your extension or template are recommend but not required to WebAssset to work (see next section).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; It is not recommended to add an inline asset to a json file, prefer to use a file.&lt;br /&gt;
&lt;br /&gt;
== Explaining asset stages ==&lt;br /&gt;
&lt;br /&gt;
Each asset has 2 stages: registered and used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Registered&#039;&#039;&#039; is where an asset is loaded into &#039;&#039;&#039;WebAssetRegistry&#039;&#039;&#039;. That means &#039;&#039;&#039;WebAssetManager&#039;&#039;&#039; knows about the existence of these assets, but will not attach them to a document while rendering.&lt;br /&gt;
All assets loaded from joomla.asset.json is at &#039;&#039;&#039;registered&#039;&#039;&#039; stage.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Used&#039;&#039;&#039; is where an asset is enabled via &amp;quot;$wa-&amp;gt;useAsset()&amp;quot; (-&amp;gt;useScript(), -&amp;gt;useStyle(), -&amp;gt;registerAndUseX() etc). That means &#039;&#039;&#039;WebAssetManager&#039;&#039;&#039; will attach these assets and their dependencies to a document while rendering.&lt;br /&gt;
&lt;br /&gt;
An asset cannot be used if it was not registered before, this will cause an unknown asset exception.&lt;br /&gt;
&lt;br /&gt;
== Register an asset ==&lt;br /&gt;
&lt;br /&gt;
All known assets loaded and then stored in &#039;&#039;&#039;WebAssetRegistry&#039;&#039;&#039; (to enable/disable an asset item you have to use &#039;&#039;&#039;WebAssetManager&#039;&#039;&#039;, see next section).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt; Joomla! will look for next assets definition automatically at runtime (in following order):&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
media/vendor/joomla.asset.json (on first access to WebAssetRegistry)&lt;br /&gt;
media/system/joomla.asset.json&lt;br /&gt;
media/legacy/joomla.asset.json&lt;br /&gt;
media/{com_active_component}/joomla.asset.json (on dispatch the application)&lt;br /&gt;
templates/{active_template}/joomla.asset.json&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And load them to registry of known assets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt; &#039;&#039;&#039;Note:&#039;&#039;&#039; Each following assets definition will override asset items from previous assets definition, by item name.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt; You can register your own assets definition via &#039;&#039;&#039;WebAssetRegistry&#039;&#039;&#039;:&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;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
$wr = $wa-&amp;gt;getRegistry();&lt;br /&gt;
$wr-&amp;gt;addRegistryFile(&#039;relative/path/to/your/joomla.asset.json&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt; To add a custom asset item at runtime:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wr-&amp;gt;add(&#039;script&#039;, new Joomla\CMS\WebAsset\WebAssetItem(&#039;foobar&#039;, &#039;com_foobar/file.js&#039;, [&#039;type&#039; =&amp;gt; &#039;script&#039;]));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or more simply, using &#039;&#039;&#039;WebAssetManager&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wa-&amp;gt;registerScript(&#039;foobar&#039;, &#039;com_foobar/file.js&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new asset item &#039;&#039;&#039;foobar&#039;&#039;&#039; will be added to the registry of know assets, but will not be attached to a document until your code (a layout, template etc) will request it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt; To check whether an asset exists:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
if ($wa-&amp;gt;assetExists(&#039;script&#039;, &#039;foobar&#039;))&lt;br /&gt;
{&lt;br /&gt;
    var_dump(&#039;Script &amp;quot;foobar&amp;quot; exists!&#039;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enabling an asset == &amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt; All asset management in the current Document handled by &#039;&#039;&#039;WebAssetManager&#039;&#039;&#039;, which is accessible with &#039;&#039;&#039;$doc-&amp;gt;getWebAssetManager();&#039;&#039;&#039;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt; By using AssetManager you can enable or disable needed asset easily in Joomla! through a standard methods.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt; To enable an asset in the page use the useAsset function, for example:&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;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
$wa-&amp;gt;useScript(&#039;keepalive&#039;);&lt;br /&gt;
&lt;br /&gt;
// Or multiple&lt;br /&gt;
$wa-&amp;gt;useScript(&#039;keepalive&#039;)&lt;br /&gt;
    -&amp;gt;useScript(&#039;fields.validate&#039;)&lt;br /&gt;
    -&amp;gt;useStyle(&#039;foobar&#039;)&lt;br /&gt;
    -&amp;gt;useScript(&#039;foobar&#039;);&lt;br /&gt;
&lt;br /&gt;
// Add new asset item with dependency and use it&lt;br /&gt;
$wa-&amp;gt;registerAndUseScript(&#039;bar&#039;, &#039;com_foobar/bar.js&#039;, [], [], [&#039;core&#039;, &#039;foobar&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt; &#039;&#039;&#039;WebAssetManager&#039;&#039;&#039; will look to &#039;&#039;&#039;WebAssetRegistry&#039;&#039;&#039; whether the requested asset exists, and will enable it for current Document instance. Otherwise it will throw an UnknownAssetException.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt; To disable an asset in the page use the disableAsset function. The example below will disable the jquery-noconflict asset from being loaded.&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;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
$wa-&amp;gt;disableScript(&#039;jquery-noconflict&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt; &#039;&#039;&#039;Note:&#039;&#039;&#039; If there are any dependencies to the disabled asset, then this asset will be re-enabled automatically, no matter what.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt; To check whether asset enabled, and the asset state:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Checking whether an asset are active (enabled manually or automatically as dependency)&lt;br /&gt;
if ($wa-&amp;gt;isAssetActive(&#039;script&#039;, &#039;foobar&#039;))&lt;br /&gt;
{&lt;br /&gt;
    var_dump(&#039;Script &amp;quot;foobar&amp;quot; are active!&#039;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Checking state&lt;br /&gt;
switch($wa-&amp;gt;getAssetState(&#039;script&#039;, &#039;foobar&#039;)){&lt;br /&gt;
	case Joomla\CMS\WebAsset\WebAssetManager::ASSET_STATE_ACTIVE:&lt;br /&gt;
		var_dump(&#039;Active! Was enabled manually&#039;);&lt;br /&gt;
		break;&lt;br /&gt;
	case Joomla\CMS\WebAsset\WebAssetManager::ASSET_STATE_DEPENDENCY:&lt;br /&gt;
		var_dump(&#039;Active! Was enabled automatically while resolving dependencies&#039;);&lt;br /&gt;
		break;&lt;br /&gt;
	default:&lt;br /&gt;
		var_dump(&#039;not active!&#039;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Overriding an asset == &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
Overriding may be useful when you need to redefine the URI of asset item or its dependencies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
As already was noted, each of the following assets definition from joomla.asset.json will override asset items from previous assets definitions, by item name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
That means if you provide joomla.asset.json which contain already loaded asset items, they will be replaced with your items.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Another way to override in the code is to register an item with the same name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Example, we have &amp;quot;foobar&amp;quot; script, that load com_example/foobar.js library, and we want to use CDN for this exact library:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
How it defined in the system initially:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
  &amp;quot;uri&amp;quot;: &amp;quot;com_example/foobar.js&amp;quot;,&lt;br /&gt;
  &amp;quot;dependencies&amp;quot;: [&amp;quot;core&amp;quot;]&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
To override the URI we define the asset item with &amp;quot;foobar&amp;quot; name in our joomla.asset.json:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
  &amp;quot;uri&amp;quot;: &amp;quot;http://foobar.cdn.blabla/foobar.js&amp;quot;,&lt;br /&gt;
  &amp;quot;dependencies&amp;quot;: [&amp;quot;core&amp;quot;]&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
Or, register new asset item with AssetManager:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wa-&amp;gt;registerScript(&#039;foobar&#039;, &#039;http://fobar.cdn.blabla/foobar.js&#039;, [], [], [&#039;core&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working with a styles == &amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
AssetManager allow to manage Stylesheet files. Stylesheet asset item have a type &amp;quot;style&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
Example json defination of item in joomla.asset.json:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;style&amp;quot;,&lt;br /&gt;
  &amp;quot;uri&amp;quot;: &amp;quot;com_example/foobar.css&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Methods to work with styles === &amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
AssetManager offer next methods to work with style files:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
// Attach foobar to the document&lt;br /&gt;
$wa-&amp;gt;useStyle(&#039;foobar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
// Disable foobar from being attached&lt;br /&gt;
$wa-&amp;gt;disableStyle(&#039;foobar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
// Register custom item without json defination&lt;br /&gt;
$wa-&amp;gt;registerStyle(&#039;bar&#039;, &#039;com_example/bar.css&#039;, [], [&#039;data-foo&#039; =&amp;gt; &#039;some attribute&#039;], [&#039;some.dependency&#039;]);&lt;br /&gt;
// And use it later&lt;br /&gt;
$wa-&amp;gt;useStyle(&#039;bar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
// Register and attach a custom item in one run&lt;br /&gt;
$wa-&amp;gt;registerAndUseStyle(&#039;bar&#039;, &#039;com_example/bar.css&#039;, [], [&#039;data-foo&#039; =&amp;gt; &#039;some attribute&#039;], [&#039;some.dependency&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add inline style === &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
Addittionaly to style files WebAssetManager allow to add an inline style, and maintain their relation to the file asset.&lt;br /&gt;
Inline style may be placed directly before the dependency, after the dependency, or as usual after all styles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
Inline asset may have a name as well as other assets (but not required), the name can be used to retrive the asset item form a registry, or as dependecy to another inline asset. If name not specified then will be used generated name based on a content hash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
// Add an inline content as usual, will be rendered in flow after all assets&lt;br /&gt;
$wa-&amp;gt;addInlineStyle(&#039;content of inline1&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
// Add an inline content that will be placed after &amp;quot;foobar&amp;quot; asset&lt;br /&gt;
$wa-&amp;gt;addInlineStyle(&#039;content of inline2&#039;, [&#039;position&#039; =&amp;gt; &#039;after&#039;], [&#039;data-foo&#039; =&amp;gt; &#039;bar&#039;], [&#039;foobar&#039;]);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
// Add an inline content that will be placed before &amp;quot;foobar&amp;quot; asset&lt;br /&gt;
$wa-&amp;gt;addInlineStyle(&#039;content of inline3&#039;, [&#039;position&#039; =&amp;gt; &#039;before&#039;], [], [&#039;foobar&#039;]);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
// Named inline asset&lt;br /&gt;
$wa-&amp;gt;addInlineStyle(&#039;content of inline4&#039;, [&#039;name&#039; =&amp;gt; &#039;my.inline.asset&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; &amp;quot;foobar&amp;quot; asset should exist in the asset registry, otherwise you will get an unsatisfied dependency exception.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
Example above will produce:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html5&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;style&amp;gt;content of inline3&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;foobar.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;style data-foo=&amp;quot;bar&amp;quot;&amp;gt;content of inline2&amp;lt;/style&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;style&amp;gt;content of inline1&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt;content of inline4&amp;lt;/style&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
If inline asset have a multiple dependencies, then will be used last one for positioning. Example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wa-&amp;gt;addInlineStyle(&#039;content of inline1&#039;, [&#039;position&#039; =&amp;gt; &#039;before&#039;], [], [&#039;foo&#039;, &#039;bar&#039;]);&lt;br /&gt;
$wa-&amp;gt;addInlineStyle(&#039;content of inline2&#039;, [&#039;position&#039; =&amp;gt; &#039;after&#039;], [], [&#039;foo&#039;, &#039;bar&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Will produce:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html5&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;foo.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt;content of inline1&amp;lt;/style&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;bar.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;style&amp;gt;content of inline2&amp;lt;/style&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Named inline asset may be as dependency to another inline asset, hovewer it is not recomended to use an inline asset as dependency to non-inline asset. This will work, but this behavior may changes in future. Prefer to use &amp;quot;position&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
== Working with a scripts == &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
AssetManager allow to manage Script files. Script asset item have a type &amp;quot;script&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
Example json defination of item in joomla.asset.json:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
  &amp;quot;uri&amp;quot;: &amp;quot;com_example/foobar.js&amp;quot;,&lt;br /&gt;
  &amp;quot;dependencies&amp;quot;: [&amp;quot;core&amp;quot;]&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Methods to work with scripts === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
AssetManager offer next methods to work with script files:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
// Attach foobar to the document&lt;br /&gt;
$wa-&amp;gt;useScript(&#039;foobar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
// Disable foobar from being attached&lt;br /&gt;
$wa-&amp;gt;disableScript(&#039;foobar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
// Register custom item without json defination&lt;br /&gt;
$wa-&amp;gt;registerScript(&#039;bar&#039;, &#039;com_example/bar.js&#039;, [], [&#039;defer&#039; =&amp;gt; true], [&#039;core&#039;]);&lt;br /&gt;
// And use it later&lt;br /&gt;
$wa-&amp;gt;useScript(&#039;bar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
// Register and attach a custom item in one run&lt;br /&gt;
$wa-&amp;gt;registerAndUseScript(&#039;bar&#039;,&#039;com_example/bar.js&#039;, [], [&#039;defer&#039; =&amp;gt; true], [&#039;core&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add inline script === &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
Addittionaly to script files WebAssetManager allow to add an inline script, and maintain their relation to the file asset.&lt;br /&gt;
Inline script may be placed directly before the dependency, after the dependency, or as usual after all scripts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
Inline asset may have a name as well as other assets (but not required), the name can be used to retrive the asset item form a registry, or as dependecy to another inline asset. If name not specified then will be used generated name based on a content hash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
// Add an inline content as usual, will be rendered in flow after all assets&lt;br /&gt;
$wa-&amp;gt;addInlineScript(&#039;content of inline1&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
// Add an inline content that will be placed after &amp;quot;foobar&amp;quot; asset&lt;br /&gt;
$wa-&amp;gt;addInlineScript(&#039;content of inline2&#039;, [&#039;position&#039; =&amp;gt; &#039;after&#039;], [&#039;data-foo&#039; =&amp;gt; &#039;bar&#039;], [&#039;foobar&#039;]);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
// Add an inline content that will be placed before &amp;quot;foobar&amp;quot; asset&lt;br /&gt;
$wa-&amp;gt;addInlineScript(&#039;content of inline3&#039;, [&#039;position&#039; =&amp;gt; &#039;before&#039;], [], [&#039;foobar&#039;]);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
// Named inline asset&lt;br /&gt;
$wa-&amp;gt;addInlineScript(&#039;content of inline4&#039;, [&#039;name&#039; =&amp;gt; &#039;my.inline.asset&#039;]);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
// Specify script type&lt;br /&gt;
$wa-&amp;gt;addInlineScript(&#039;content of inline5&#039;, [], [&#039;type&#039; =&amp;gt; &#039;module&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; &amp;quot;foobar&amp;quot; asset should exist in the asset registry, otherwise you will get an unsatisfied dependency exception.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
Example above will produce:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html5&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;script&amp;gt;content of inline3&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script src=&amp;quot;foobar.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script data-foo=&amp;quot;bar&amp;quot;&amp;gt;content of inline2&amp;lt;/script&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;script&amp;gt;content of inline1&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;content of inline4&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;module&amp;quot;&amp;gt;content of inline5&amp;lt;/script&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
If inline asset have a multiple dependencies, then will be used last one for positioning. Example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wa-&amp;gt;addInlineScript(&#039;content of inline1&#039;, [&#039;position&#039; =&amp;gt; &#039;before&#039;], [], [&#039;foo&#039;, &#039;bar&#039;]);&lt;br /&gt;
$wa-&amp;gt;addInlineScript(&#039;content of inline2&#039;, [&#039;position&#039; =&amp;gt; &#039;after&#039;], [], [&#039;foo&#039;, &#039;bar&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Will produce:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html5&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;script src=&amp;quot;foo.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;content of inline1&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script src=&amp;quot;bar.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;content of inline2&amp;lt;/script&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Named inline asset may be as dependency to another inline asset, hovewer it is not recomended to use an inline asset as dependency to non-inline asset. This will work, but this behavior may changes in future. Prefer to use &amp;quot;position&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
== Working with a web component == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
Joomla! allows you to use Web Components (https://developer.mozilla.org/en-US/docs/Web/Web_Components) for your needs. In Joomla! web components are not loaded as regular script, but loaded via Web Component loader so that they are loaded asynchronously. Therefore, a web component asset item must have a flag &amp;quot;webcomponent&amp;quot; set to the boolean &amp;quot;true&amp;quot;.&lt;br /&gt;
In all other aspects, working with web components in AssetManager is the same as working with a &amp;quot;script&amp;quot; asset item.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Example json definition of some web components in joomla.asset.json:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;webcomponent.foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;style&amp;quot;,&lt;br /&gt;
  &amp;quot;uri&amp;quot;: &amp;quot;com_example/foobar-custom-element.css&amp;quot;,&lt;br /&gt;
  &amp;quot;webcomponent&amp;quot;: true&lt;br /&gt;
},&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;webcomponent.foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
  &amp;quot;uri&amp;quot;: &amp;quot;com_example/foobar-custom-element.js&amp;quot;,&lt;br /&gt;
  &amp;quot;webcomponent&amp;quot;: true&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
Alternatively you can register them in PHP:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wa-&amp;gt;registerStyle(&#039;webcomponent.foobar&#039;, &#039;com_example/foobar-custom-element.css&#039;, [&#039;webcomponent&#039; =&amp;gt; true])&lt;br /&gt;
    -&amp;gt;registerScript(&#039;webcomponent.foobar&#039;, &#039;com_example/foobar-custom-element.js&#039;, [&#039;webcomponent&#039; =&amp;gt; true]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Attach to document:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$wa-&amp;gt;useStyle(&#039;webcomponent.foobar&#039;)&lt;br /&gt;
    -&amp;gt;useScript(&#039;webcomponent.foobar&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; It is preferred to prefix the asset name with &amp;quot;webcomponent.&amp;quot; to make it easily to spot, and distinct it from regular scripts in a layout.&lt;br /&gt;
&lt;br /&gt;
=== Methods to work with web component === &amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
All methods to work with a web component are the same as methods to work with script asset item.&lt;br /&gt;
&lt;br /&gt;
== Working with a presets == &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;quot;Preset&amp;quot; is a special kind of asset item that hold a list of items that has to be enabled, in same way as direct call of useAsset() to each of item in the list.&lt;br /&gt;
Preset can hold mixed types of assets (script, style, another preset, etc), the type should be provided after # symbol and follows after an asset name, example: foo#style, bar#script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
Example json defination of item in joomla.asset.json:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;type&amp;quot;: &amp;quot;preset&amp;quot;,&lt;br /&gt;
  &amp;quot;uri&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
  &amp;quot;dependencies&amp;quot;: [&lt;br /&gt;
    &amp;quot;core#script&amp;quot;,&lt;br /&gt;
    &amp;quot;foobar#style&amp;quot;,&lt;br /&gt;
    &amp;quot;foobar#script&amp;quot;,&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Methods to work with preset === &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
AssetManager offer next methods to work with preset items:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */&lt;br /&gt;
$wa = Factory::getApplication()-&amp;gt;getDocument()-&amp;gt;getWebAssetManager();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
// Attach all items from foobar preset to the document&lt;br /&gt;
$wa-&amp;gt;usePreset(&#039;foobar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
// Disable all items from foobar preset from being attached&lt;br /&gt;
$wa-&amp;gt;disablePreset(&#039;foobar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
// Register custom item without json defination&lt;br /&gt;
$wa-&amp;gt;registerPreset(&#039;bar&#039;, &#039;&#039;, [], [], [&#039;core#script&#039;, &#039;bar#script&#039;]);&lt;br /&gt;
// And use it later&lt;br /&gt;
$wa-&amp;gt;usePreset(&#039;bar&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
// Register and attach a custom item in one run&lt;br /&gt;
$wa-&amp;gt;registerAndUsePreset(&#039;bar&#039;,&#039;&#039;, [], [], [&#039;core#script&#039;, &#039;bar#script&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Advanced: Custom WebAssetItem class == &amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt; The default class for all WebAsset items is &#039;&#039;&#039;Joomla\CMS\WebAsset\WebAssetItem&#039;&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:21--&amp;gt; You are also allowed to use a custom class, which must implement &#039;&#039;&#039;Joomla\CMS\WebAsset\WebAssetItemInterface&#039;&#039;&#039; or extend &#039;&#039;&#039;Joomla\CMS\WebAsset\WebAssetItem&#039;&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt; A custom class can allow you to do advanced actions, for example, including a script file depending on an active language:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class MyComExampleAssetItem extends WebAssetItem&lt;br /&gt;
{&lt;br /&gt;
	public function getUri($resolvePath = true): string&lt;br /&gt;
	{&lt;br /&gt;
		$langTag = Factory::getApplication()-&amp;gt;getLanguage()-&amp;gt;getTag();&lt;br /&gt;
		// For script asset use &amp;quot;.js&amp;quot;, for style we would use &amp;quot;.css&amp;quot;&lt;br /&gt;
		$path    = &#039;com_example/bar-&#039; . $langTag . &#039;.js&#039;;&lt;br /&gt;
&lt;br /&gt;
		if ($resolvePath)&lt;br /&gt;
		{&lt;br /&gt;
			// For script asset use &amp;quot;script&amp;quot;, for style we would use &amp;quot;stylesheet&amp;quot;&lt;br /&gt;
			$path = $this-&amp;gt;resolvePath($path, &#039;script&#039;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $path;&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;&amp;lt;!--T:23--&amp;gt; Additionally, implementing &#039;&#039;&#039;Joomla\CMS\WebAsset\WebAssetAttachBehaviorInterface&#039;&#039;&#039; allows you to add a script options (which may depend on the environment) when your asset is enabled and attached to the Document.&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;
class MyFancyFoobarAssetItem extends WebAssetItem implements WebAssetAttachBehaviorInterface&lt;br /&gt;
{&lt;br /&gt;
	public function onAttachCallback(Document $doc): void&lt;br /&gt;
	{&lt;br /&gt;
		$user = Factory::getApplication()-&amp;gt;getIdentity();&lt;br /&gt;
		$doc-&amp;gt;addScriptOptions(&#039;com_example.fancyfoobar&#039;, [&#039;userName&#039; =&amp;gt; $user-&amp;gt;username]);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important note:&#039;&#039;&#039; An asset item that implements &#039;&#039;&#039;WebAssetAttachBehaviorInterface&#039;&#039;&#039; should be enabled before [https://docs.joomla.org/Plugin/Events/System#onBeforeCompileHead onBeforeCompileHead] event, otherwise &#039;onAttachCallback&#039; will be ignored.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Defining a custom WebAssetItem class in joomla.asset.json === &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:25--&amp;gt; In joomla.asset.json you can define which Class should be used with specific AssetItem.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt; For this you can use 2 properties &#039;&#039;&#039;namespace&#039;&#039;&#039; and &#039;&#039;&#039;class&#039;&#039;&#039;. &#039;&#039;&#039;namespace&#039;&#039;&#039; can be defined at Root level (then it will be used as default namespace for all Asset items in joomla.asset.json) or in the Item level. For example:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;$schema&amp;quot;: &amp;quot;https://developer.joomla.org/schemas/json-schema/web_assets.json&amp;quot;,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;com_example&amp;quot;,&lt;br /&gt;
  &amp;quot;version&amp;quot;: &amp;quot;4.0.0&amp;quot;,&lt;br /&gt;
  &amp;quot;namespace&amp;quot;: &amp;quot;Joomla\Component\Example\WebAsset&amp;quot;,&lt;br /&gt;
  &amp;quot;assets&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;foo&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
      &amp;quot;class&amp;quot;: &amp;quot;FooAssetItem&amp;quot;,&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/foo.js&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;bar&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
      &amp;quot;namespace&amp;quot;: &amp;quot;MyFooBar\Library\Example\WebAsset&amp;quot;,&lt;br /&gt;
      &amp;quot;class&amp;quot;: &amp;quot;BarAssetItem&amp;quot;,&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/bar.js&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt; Here the asset &#039;&#039;&#039;foo&#039;&#039;&#039; will be associated with class &#039;&#039;&#039;Joomla\Component\Example\WebAsset\FooAssetItem&#039;&#039;&#039;, and &#039;&#039;&#039;bar&#039;&#039;&#039; with class &#039;&#039;&#039;MyFooBar\Library\Example\WebAsset\BarAssetItem&#039;&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt; &#039;&#039;&#039;Note:&#039;&#039;&#039; If &#039;&#039;&#039;namespace&#039;&#039;&#039; are not defined then by default will be used &#039;&#039;&#039;Joomla\CMS\WebAsset&#039;&#039;&#039;. When &#039;&#039;&#039;namespace&#039;&#039;&#039; is defined but empty, then no namespace will be used, only &#039;&#039;&#039;class&#039;&#039;&#039;. Example:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;$schema&amp;quot;: &amp;quot;https://developer.joomla.org/schemas/json-schema/web_assets.json&amp;quot;,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;com_example&amp;quot;,&lt;br /&gt;
  &amp;quot;assets&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;foo&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
      &amp;quot;class&amp;quot;: &amp;quot;FooAssetItem&amp;quot;,&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/foo.js&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;bar&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;script&amp;quot;,&lt;br /&gt;
      &amp;quot;namespace&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
      &amp;quot;class&amp;quot;: &amp;quot;BarAssetItem&amp;quot;,&lt;br /&gt;
      &amp;quot;uri&amp;quot;: &amp;quot;com_example/bar.js&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt; Here the asset &#039;&#039;&#039;foo&#039;&#039;&#039; will be associated with class &#039;&#039;&#039;Joomla\CMS\WebAsset\FooAssetItem&#039;&#039;&#039;, and &#039;&#039;&#039;bar&#039;&#039;&#039; with class &#039;&#039;&#039;BarAssetItem&#039;&#039;&#039; (without namespace).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Joomla! 4.x{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla! 4.0{{#translation:}}]]&lt;br /&gt;
[[Category:Tutorials{{#translation:}}]]&lt;br /&gt;
[[Category:Development{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Namespace_Conventions_In_Joomla&amp;diff=715263</id>
		<title>J4.x:Namespace Conventions In Joomla</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Namespace_Conventions_In_Joomla&amp;diff=715263"/>
		<updated>2020-08-20T04:18:38Z</updated>

		<summary type="html">&lt;p&gt;Garkell: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{Joomla version|version=4.0}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Base Namespaces === &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt; The recommended naming conventions in Joomla 4 are the following:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Components === &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Core Components ==== &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Joomla\Component\&amp;lt;ComponentName&amp;gt;\&amp;lt;ClientName&amp;gt;&lt;br /&gt;
** Joomla\Component\Content\Site&lt;br /&gt;
** Joomla\Component\Content\Administrator&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== 3rd Party Components ==== &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &amp;lt;CompanyName&amp;gt;\&amp;lt;ComponentName&amp;gt;\&amp;lt;ClientName&amp;gt;&lt;br /&gt;
** Acme\Backup\Site&lt;br /&gt;
** Acme\Backup\Administrator&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Example locations ==== &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&#039;&#039;Joomla\Component\Content\Site\Controller&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
components/com_content/Controller/ArticleController.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Joomla\Component\Content\Administrator\Controller&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
administrator/components/com_content/Controller/ArticlesController.php&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Modules === &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Core Modules ==== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
* Joomla\Module\&amp;lt;ModuleName&amp;gt;\&amp;lt;ClientName&amp;gt;&lt;br /&gt;
** Joomla\Module\UsersLatest\Site&lt;br /&gt;
** Joomla\Module\Quickicon\Administrator&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== 3rd Party Modules ==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &amp;lt;CompanyName&amp;gt;\Module\&amp;lt;ModuleName&amp;gt;\&amp;lt;ClientName&amp;gt;&lt;br /&gt;
** Acme\Module\SubscriptionStatus\Site&lt;br /&gt;
** Acme\Module\LastBackupStatus\Administrator&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Example locations ==== &amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&#039;&#039;Joomla\Module\Quickicon\Administrator\Dispatcher&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
administrator/modules/mod_quickicon/Dispatcher/Dispatcher.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Joomla\Module\UsersLatest\Site\Helper&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
modules/mod_users_latest/Helper/UsersLatestHelper.php&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Plugins === &amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Core Plugins ==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
* Joomla\Plugin\&amp;lt;PluginGroup&amp;gt;\&amp;lt;PluginName&amp;gt;&lt;br /&gt;
** Joomla\Plugin\System\Debug&lt;br /&gt;
** Joomla\Plugin\Quickicon\Joomlaupdate&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== 3rd Party Plugins ==== &amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &amp;lt;CompanyName&amp;gt;\Plugin\&amp;lt;PluginGroup&amp;gt;\&amp;lt;PluginName&amp;gt;\&lt;br /&gt;
** Acme\Plugin\System\BackupOnDemand&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Example locations ==== &amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&#039;&#039;Joomla\Plugin\System\Debug&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
plugins/system/debug/DataFormatter.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Joomla\Plugin\Quickicon\Joomlaupdate\Extension&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
plugins/quickicon/joomlaupdate/Extension/Joomlaupdate.php&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Framework === &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Joomla Framework Library ==== &amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
* Joomla&lt;br /&gt;
** Joomla\Session&lt;br /&gt;
** Joomla\Image&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Joomla CMS Library ==== &amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
* Joomla\CMS&lt;br /&gt;
** Joomla\CMS\Mail&lt;br /&gt;
** Joomla\CMS\MVC&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Example locations ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&#039;&#039;Joomla\Session&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
libraries/vendor/joomla/session/src/Session.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Joomla\CMS\Mail&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
libraries/src/Mail/Mail.php&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Development{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla! 4.x{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla! 4.0{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Namespace_Conventions_In_Joomla&amp;diff=715262</id>
		<title>J4.x:Namespace Conventions In Joomla</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Namespace_Conventions_In_Joomla&amp;diff=715262"/>
		<updated>2020-08-20T04:17:25Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Added extra headings to make it more defined&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{Joomla version|version=4.0}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Base Namespaces === &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt; The recommended naming conventions in Joomla 4 are the following:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Components === &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Core Components ==== &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Joomla\Component\&amp;lt;ComponentName&amp;gt;\&amp;lt;ClientName&amp;gt;&lt;br /&gt;
** Joomla\Component\Content\Site&lt;br /&gt;
** Joomla\Component\Content\Administrator&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== 3rd Party Components ==== &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &amp;lt;CompanyName&amp;gt;\&amp;lt;ComponentName&amp;gt;\&amp;lt;ClientName&amp;gt;&lt;br /&gt;
** Acme\Backup\Site&lt;br /&gt;
** Acme\Backup\Administrator&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===== Example locations ===== &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&#039;&#039;Joomla\Component\Content\Site\Controller&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
components/com_content/Controller/ArticleController.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Joomla\Component\Content\Administrator\Controller&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
administrator/components/com_content/Controller/ArticlesController.php&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Modules === &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Core Modules ==== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
* Joomla\Module\&amp;lt;ModuleName&amp;gt;\&amp;lt;ClientName&amp;gt;&lt;br /&gt;
** Joomla\Module\UsersLatest\Site&lt;br /&gt;
** Joomla\Module\Quickicon\Administrator&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== 3rd Party Modules ==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &amp;lt;CompanyName&amp;gt;\Module\&amp;lt;ModuleName&amp;gt;\&amp;lt;ClientName&amp;gt;&lt;br /&gt;
** Acme\Module\SubscriptionStatus\Site&lt;br /&gt;
** Acme\Module\LastBackupStatus\Administrator&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===== Example locations ===== &amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&#039;&#039;Joomla\Module\Quickicon\Administrator\Dispatcher&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
administrator/modules/mod_quickicon/Dispatcher/Dispatcher.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Joomla\Module\UsersLatest\Site\Helper&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
modules/mod_users_latest/Helper/UsersLatestHelper.php&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Plugins === &amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Core Plugins ==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
* Joomla\Plugin\&amp;lt;PluginGroup&amp;gt;\&amp;lt;PluginName&amp;gt;&lt;br /&gt;
** Joomla\Plugin\System\Debug&lt;br /&gt;
** Joomla\Plugin\Quickicon\Joomlaupdate&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== 3rd Party Plugins ==== &amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &amp;lt;CompanyName&amp;gt;\Plugin\&amp;lt;PluginGroup&amp;gt;\&amp;lt;PluginName&amp;gt;\&lt;br /&gt;
** Acme\Plugin\System\BackupOnDemand&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===== Example locations ===== &amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&#039;&#039;Joomla\Plugin\System\Debug&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
plugins/system/debug/DataFormatter.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Joomla\Plugin\Quickicon\Joomlaupdate\Extension&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
plugins/quickicon/joomlaupdate/Extension/Joomlaupdate.php&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Framework === &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Joomla Framework Library ==== &amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
* Joomla&lt;br /&gt;
** Joomla\Session&lt;br /&gt;
** Joomla\Image&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Joomla CMS Library ==== &amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
* Joomla\CMS&lt;br /&gt;
** Joomla\CMS\Mail&lt;br /&gt;
** Joomla\CMS\MVC&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===== Example locations ===== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&#039;&#039;Joomla\Session&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
libraries/vendor/joomla/session/src/Session.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Joomla\CMS\Mail&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
libraries/src/Mail/Mail.php&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Development{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla! 4.x{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla! 4.0{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Package&amp;diff=616223</id>
		<title>Package</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Package&amp;diff=616223"/>
		<updated>2019-06-22T00:35:09Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Spelling&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;translate&amp;gt;&lt;br /&gt;
== Note on component dependent modules== &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Sometimes modules (or plugins etc.) use a component&#039;s models and helpers and such. In these occasions it would be nice to be able to package your module in this way that it gets uninstalled when the component itself gets uninstalled.  This is called dependency management which has been desired in joomla but hasn&#039;t been done yet.&lt;br /&gt;
It is suggested to follow the standards and just using a package as is described below.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== What is a package? == &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
A package is a extension that is used to install multiple extensions in one go. This is used if you have for example a component and a module that are depending on each other. Combining them in a package will let the user install and uninstall both extensions in one go. Package extensions can be used with Joomla {{JVer|2.5}} and higher.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== How do I create a package? == &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
A package extension is created by zipping all zip files of the extensions together with a xml manifest file. For example if you have a package composed by:&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;
* &#039;&#039;&#039;component&#039;&#039;&#039; helloworld&lt;br /&gt;
* &#039;&#039;&#039;module&#039;&#039;&#039; helloworld&lt;br /&gt;
* &#039;&#039;&#039;library&#039;&#039;&#039; helloworld &lt;br /&gt;
* &#039;&#039;&#039;system plugin&#039;&#039;&#039; helloworld &lt;br /&gt;
* &#039;&#039;&#039;template&#039;&#039;&#039; helloworld&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
The package should have the following tree in your zipfile:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  -- pkg_helloworld.xml&lt;br /&gt;
  -- packages &amp;lt;dir&amp;gt;&lt;br /&gt;
      |-- com_helloworld.zip&lt;br /&gt;
      |-- mod_helloworld.zip&lt;br /&gt;
      |-- lib_helloworld.zip&lt;br /&gt;
      |-- plg_sys_helloworld.zip&lt;br /&gt;
      |-- tpl_helloworld.zip&lt;br /&gt;
  -- pkg_script.php&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
The pkg_helloworld.xml could have the following contents:&lt;br /&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;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;extension type=&amp;quot;package&amp;quot; version=&amp;quot;1.6&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;name&amp;gt;Hello World Package&amp;lt;/name&amp;gt;&lt;br /&gt;
 &amp;lt;author&amp;gt;Hello World Package Team&amp;lt;/author&amp;gt;&lt;br /&gt;
 &amp;lt;creationDate&amp;gt;May 2012&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
 &amp;lt;packagename&amp;gt;helloworld&amp;lt;/packagename&amp;gt;&lt;br /&gt;
 &amp;lt;version&amp;gt;1.0.0&amp;lt;/version&amp;gt;&lt;br /&gt;
 &amp;lt;url&amp;gt;http://www.yoururl.com/&amp;lt;/url&amp;gt;&lt;br /&gt;
 &amp;lt;packager&amp;gt;Hello World Package Team&amp;lt;/packager&amp;gt;&lt;br /&gt;
 &amp;lt;packagerurl&amp;gt;http://www.yoururl.com/&amp;lt;/packagerurl&amp;gt;&lt;br /&gt;
 &amp;lt;description&amp;gt;Example package to combine multiple extensions&amp;lt;/description&amp;gt;&lt;br /&gt;
 &amp;lt;update&amp;gt;http://www.updateurl.com/update&amp;lt;/update&amp;gt;&lt;br /&gt;
 &amp;lt;scriptfile&amp;gt;pkg_script.php&amp;lt;/scriptfile&amp;gt;&lt;br /&gt;
 &amp;lt;files folder=&amp;quot;packages&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;file type=&amp;quot;component&amp;quot; id=&amp;quot;com_helloworld&amp;quot; &amp;gt;com_helloworld.zip&amp;lt;/file&amp;gt;&lt;br /&gt;
   &amp;lt;file type=&amp;quot;module&amp;quot; id=&amp;quot;helloworld&amp;quot; client=&amp;quot;site&amp;quot;&amp;gt;mod_helloworld.zip&amp;lt;/file&amp;gt;&lt;br /&gt;
   &amp;lt;file type=&amp;quot;library&amp;quot; id=&amp;quot;helloworld&amp;quot;&amp;gt;lib_helloworld.zip&amp;lt;/file&amp;gt;&lt;br /&gt;
   &amp;lt;file type=&amp;quot;plugin&amp;quot; id=&amp;quot;helloworld&amp;quot; group=&amp;quot;system&amp;quot;&amp;gt;plg_sys_helloworld.zip&amp;lt;/file&amp;gt;&lt;br /&gt;
   &amp;lt;file type=&amp;quot;template&amp;quot; id=&amp;quot;helloworld&amp;quot; client=&amp;quot;site&amp;quot;&amp;gt;tpl_helloworld.zip&amp;lt;/file&amp;gt;&lt;br /&gt;
 &amp;lt;/files&amp;gt;&lt;br /&gt;
 &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
When you zip this and try to install it, you will see that every extension will be installed. Also the package will be visible in the extension list to uninstall all the extension of this package.&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:11--&amp;gt;&lt;br /&gt;
Remember to use the package uninstaller instead of individual subpackage uninstallers to avoid orphan extension entries in the extension manager.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Id= &amp;lt;file id=&amp;quot;not_arbitrary&amp;quot;&amp;gt; === &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
The id element in &amp;lt;file ..&amp;gt; tag are NOT arbitrary!. The &amp;quot;id=&amp;quot; should be set to the value of the &amp;quot;element&amp;quot; column in the &amp;quot;#__extensions&amp;quot; table. If they are not set correctly, upon uninstalling of the package the children ( &amp;lt;file&amp;gt; ) will NOT be found and uninstalled.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Manifest filename and packagename === &amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
The naming of the manifest file and the ability to uninstall the package file itself are closely related. &lt;br /&gt;
The manifest file must have a &amp;quot;pkg_&amp;quot; prefix, the remainder of the manifest name ( without .xml extension ) is to be used as &amp;lt;packagename&amp;gt;. Or, the other way around, a package you want to identify as &amp;quot;blurpblurp_J3&amp;quot; get that as its &amp;lt;packagename&amp;gt; and should be in a manifest file named &amp;quot;pkg_blurpblurp_J3.xml&amp;quot;. Failure to do so will make it impossible to uninstall the package itself.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
An optional &amp;lt;pkg_script.php&amp;gt; which contains a class pkg_&amp;lt;packagename&amp;gt;InstallerScript with public function postflight can be used (works in Joomla! 3.6).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Extension tag === &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
As of Joomla! 3.4, you should include method=&amp;quot;upgrade&amp;quot; in the &amp;lt;extension&amp;gt; tag if you wish for your package to succeed in updating itself on subsequent installations.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
The version attribute of the &amp;lt;extension&amp;gt; tag should be set to the minimum supported version of Joomla for this package. For example, if your package only supports Joomla! 3.2 and above set this to 3.2.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Extension Uninstall Dependency === &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
As of 3.7.0, a package extension can declare that its child elements cannot be uninstalled independently with a &amp;quot;&amp;lt;blockChildUninstall&amp;gt;true&amp;lt;/blockChildUninstall&amp;gt;&amp;quot; element in your package manifest.  So if your package needs all it&#039;s extensions to operate effectively, set this to true or 1.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Package&amp;diff=616222</id>
		<title>Package</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Package&amp;diff=616222"/>
		<updated>2019-06-22T00:30:32Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Add Uninstall dependency.&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;translate&amp;gt;&lt;br /&gt;
== Note on component dependent modules== &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Sometimes modules (or plugins etc.) use a component&#039;s models and helpers and such. In these occasions it would be nice to be able to package your module in this way that it gets uninstalled when the component itself gets uninstalled.  This is called dependency management which has been desired in joomla but hasn&#039;t been done yet.&lt;br /&gt;
It is suggested to follow the standards and just using a package as is described below.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== What is a package? == &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
A package is a extension that is used to install multiple extensions in one go. This is used if you have for example a component and a module that are depending on each other. Combining them in a package will let the user install and uninstall both extensions in one go. Package extensions can be used with Joomla {{JVer|2.5}} and higher.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== How do I create a package? == &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
A package extension is created by zipping all zip files of the extensions together with a xml manifest file. For example if you have a package composed by:&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;
* &#039;&#039;&#039;component&#039;&#039;&#039; helloworld&lt;br /&gt;
* &#039;&#039;&#039;module&#039;&#039;&#039; helloworld&lt;br /&gt;
* &#039;&#039;&#039;library&#039;&#039;&#039; helloworld &lt;br /&gt;
* &#039;&#039;&#039;system plugin&#039;&#039;&#039; helloworld &lt;br /&gt;
* &#039;&#039;&#039;template&#039;&#039;&#039; helloworld&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
The package should have the following tree in your zipfile:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  -- pkg_helloworld.xml&lt;br /&gt;
  -- packages &amp;lt;dir&amp;gt;&lt;br /&gt;
      |-- com_helloworld.zip&lt;br /&gt;
      |-- mod_helloworld.zip&lt;br /&gt;
      |-- lib_helloworld.zip&lt;br /&gt;
      |-- plg_sys_helloworld.zip&lt;br /&gt;
      |-- tpl_helloworld.zip&lt;br /&gt;
  -- pkg_script.php&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
The pkg_helloworld.xml could have the following contents:&lt;br /&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;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;extension type=&amp;quot;package&amp;quot; version=&amp;quot;1.6&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;name&amp;gt;Hello World Package&amp;lt;/name&amp;gt;&lt;br /&gt;
 &amp;lt;author&amp;gt;Hello World Package Team&amp;lt;/author&amp;gt;&lt;br /&gt;
 &amp;lt;creationDate&amp;gt;May 2012&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
 &amp;lt;packagename&amp;gt;helloworld&amp;lt;/packagename&amp;gt;&lt;br /&gt;
 &amp;lt;version&amp;gt;1.0.0&amp;lt;/version&amp;gt;&lt;br /&gt;
 &amp;lt;url&amp;gt;http://www.yoururl.com/&amp;lt;/url&amp;gt;&lt;br /&gt;
 &amp;lt;packager&amp;gt;Hello World Package Team&amp;lt;/packager&amp;gt;&lt;br /&gt;
 &amp;lt;packagerurl&amp;gt;http://www.yoururl.com/&amp;lt;/packagerurl&amp;gt;&lt;br /&gt;
 &amp;lt;description&amp;gt;Example package to combine multiple extensions&amp;lt;/description&amp;gt;&lt;br /&gt;
 &amp;lt;update&amp;gt;http://www.updateurl.com/update&amp;lt;/update&amp;gt;&lt;br /&gt;
 &amp;lt;scriptfile&amp;gt;pkg_script.php&amp;lt;/scriptfile&amp;gt;&lt;br /&gt;
 &amp;lt;files folder=&amp;quot;packages&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;file type=&amp;quot;component&amp;quot; id=&amp;quot;com_helloworld&amp;quot; &amp;gt;com_helloworld.zip&amp;lt;/file&amp;gt;&lt;br /&gt;
   &amp;lt;file type=&amp;quot;module&amp;quot; id=&amp;quot;helloworld&amp;quot; client=&amp;quot;site&amp;quot;&amp;gt;mod_helloworld.zip&amp;lt;/file&amp;gt;&lt;br /&gt;
   &amp;lt;file type=&amp;quot;library&amp;quot; id=&amp;quot;helloworld&amp;quot;&amp;gt;lib_helloworld.zip&amp;lt;/file&amp;gt;&lt;br /&gt;
   &amp;lt;file type=&amp;quot;plugin&amp;quot; id=&amp;quot;helloworld&amp;quot; group=&amp;quot;system&amp;quot;&amp;gt;plg_sys_helloworld.zip&amp;lt;/file&amp;gt;&lt;br /&gt;
   &amp;lt;file type=&amp;quot;template&amp;quot; id=&amp;quot;helloworld&amp;quot; client=&amp;quot;site&amp;quot;&amp;gt;tpl_helloworld.zip&amp;lt;/file&amp;gt;&lt;br /&gt;
 &amp;lt;/files&amp;gt;&lt;br /&gt;
 &amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
When you zip this and try to install it, you will see that every extension will be installed. Also the package will be visible in the extension list to uninstall all the extension of this package.&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:11--&amp;gt;&lt;br /&gt;
Remember to use the package uninstaller instead of individual subpackage uninstallers to avoid orphan extension entries in the extension manager.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Id= &amp;lt;file id=&amp;quot;not_arbitrary&amp;quot;&amp;gt; === &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
The id element in &amp;lt;file ..&amp;gt; tag are NOT arbitrary!. The &amp;quot;id=&amp;quot; should be set to the value of the &amp;quot;element&amp;quot; column in the &amp;quot;#__extensions&amp;quot; table. If they are not set correctly, upon uninstalling of the package the children ( &amp;lt;file&amp;gt; ) will NOT be found and uninstalled.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Manifest filename and packagename === &amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
The naming of the manifest file and the ability to uninstall the package file itself are closely related. &lt;br /&gt;
The manifest file must have a &amp;quot;pkg_&amp;quot; prefix, the remainder of the manifest name ( without .xml extension ) is to be used as &amp;lt;packagename&amp;gt;. Or, the other way around, a package you want to identify as &amp;quot;blurpblurp_J3&amp;quot; get that as its &amp;lt;packagename&amp;gt; and should be in a manifest file named &amp;quot;pkg_blurpblurp_J3.xml&amp;quot;. Failure to do so will make it impossible to uninstall the package itself.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
An optional &amp;lt;pkg_script.php&amp;gt; which contains a class pkg_&amp;lt;packagename&amp;gt;InstallerScript with public function postflight can be used (works in Joomla! 3.6).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Extension tag === &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
As of Joomla! 3.4, you should include method=&amp;quot;upgrade&amp;quot; in the &amp;lt;extension&amp;gt; tag if you wish for your package to succeed in updating itself on subsequent installations.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
The version attribute of the &amp;lt;extension&amp;gt; tag should be set to the minimum supported version of Joomla for this package. For example, if your package only supports Joomla! 3.2 and above set this to 3.2.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Extension Uninstall Dependancy === &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
As of 3.7.0, a package extension can declare that its child elements cannot be uninstalled independently with a &amp;quot;&amp;lt;blockChildUninstall&amp;gt;true&amp;lt;/blockChildUninstall&amp;gt;&amp;quot; element in your package manifest.  So if your package needs all it&#039;s extensions to operate effectively, set this to true or 1.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Creating_a_Simple_Module&amp;diff=615710</id>
		<title>J4.x:Creating a Simple Module</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Creating_a_Simple_Module&amp;diff=615710"/>
		<updated>2019-06-21T07:07:43Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Changed to point to modules rather than plugin boilerplate&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=4.x|comment=&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt; Tutorial&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{Top portal heading|color=white-bkgd|icon=file-code-o|icon-color=#5091cd|size=5x|text-color=#333|title=&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt; Creating a Simple Module for Joomla 4.x&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{-}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt; This is a tutorial on how to Create a simple module for Joomla Version 4x.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Introduction == &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt; Joomlaǃ 4 provides five types of extensionsː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Component|&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt; Components&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt; A component is the main part of the site. A component handles data manipulation as well as input and storage into the database. A component on most sites is the primary focus of the page.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Module|&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt; Modules&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039; &amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt; A module is an add-on to the site that extends the functionality. A module usually occupies a secondary portion of the web page and is not considered the primary focus of a page. It can be displayed on different positions and you can choose on which active menu items it should be displayed. Modules are lightweight and flexible extensions. They are used for small bits of the page that are generally less complex and are able to be seen across different components.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Plugin|&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt; Plugins&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt; A Plugin manipulates output that is already generated by the system. It typically does not run as separate part of the site. It takes data from other sources (i.e. the content) and manipulates this data before displaying. A plugin typically work behind the scenes.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Languages|&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt; Languages&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;Probably the most basic extensions are languages. In essence the language package files consist of key/value pairs, which provide the translation of static text strings, assigned within the Joomla! source code. &lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Templates|&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt; Templates&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt; A template is basically the design of your Joomla! powered website.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt; Joomla! 4 is constructed using five different applications:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
* Installation (used for installing Joomla and have to delete after installation)&lt;br /&gt;
* Administrator (backend - used for managing content)&lt;br /&gt;
* Public or site (frontend - used for displaying content)&lt;br /&gt;
* CLI (used for accessing Joomla on the command line and for cron jobs)&lt;br /&gt;
* API (web services - used for creating APIs for machine accessible content)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The installation application is used once. The administrator and public are used through the concept of &#039;&#039;components&#039;&#039; with &#039;&#039;modules&#039;&#039;. Each module has a single entry point located in the &#039;&#039;modules&#039;&#039; and accordingly &#039;&#039;administrator/modules&#039;&#039;  directory. This entry point is called &amp;lt;tt&amp;gt;&#039;&#039;mod_modulename/mod_modulename.php&#039;&#039;&amp;lt;/tt&amp;gt; (the &#039;&#039;mod_&#039;&#039; prefix is a historical trace). The entry point for the login module is for &#039;&#039;example /mod_login/mod_login.php&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt; You can download Joomla! 4 at [https://github.com/joomla/joomla-cms/tree/4.0-dev GitHub], on the [https://developer.joomla.org/nightly-builds.html Developer website] or you can create a free website at https://launch.joomla.org.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Creating a simple module/Developing a Basic Module - Part 1 == &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt; You can see many examples of modules in the standard Joomla! install. For example:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* Menus &lt;br /&gt;
* Latest News&lt;br /&gt;
* Login form&lt;br /&gt;
* and many more.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt; This tutorial will explain how to create a simple module. Through this tutorial you will learn the basic file structure of a Joomlaǃ 4 module. This basic structure can then be expanded to produce more elaborate modules.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt; There are a few basic files that are used in the standard pattern of module development:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt; * &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; - This file is the main entry point for the module. It will perform any necessary initialization routines, call helper routines to collect any necessary data, and include the template which will display the module output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt; * &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - This file contains information about the module. It defines the files that need to be installed by the Joomla! installer and specifies configuration parameters for the module.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt; * &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; - This is the module template. This file will take the data collected by mod_foo.php and generate the HTML to be displayed on the page.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt; * &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.ini&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.sys.ini&amp;lt;/tt&amp;gt;- This are the files that provide the text in United Kingdom English.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating mod_foo.php === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:32--&amp;gt; The &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file will perform following tasks:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:33--&amp;gt; * Import the class &amp;lt;tt&amp;gt;ModuleHelper&amp;lt;/tt&amp;gt; to the current scope. We need it later for displaying the output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:34--&amp;gt; * Include the template to display the output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:35--&amp;gt; The helper class is imported to our current scope at the begin of the file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;use Joomla\CMS\Helper\ModuleHelper;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:36--&amp;gt; Last we include the template to display the output via&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;require ModuleHelper::getLayoutPath(&#039;mod_foo&#039;, $params-&amp;gt;get(&#039;layout&#039;, &#039;default&#039;));&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.php file ==== &amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:38--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Helper\ModuleHelper;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
require ModuleHelper::getLayoutPath(&#039;mod_foo&#039;, $params-&amp;gt;get(&#039;layout&#039;, &#039;default&#039;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:39--&amp;gt; &#039;&#039;Side note&#039;&#039;ː In Joomla 3x you usually used a line like &amp;lt;tt&amp;gt;$moduleclass_sfx = htmlspecialchars($params-&amp;gt;get(&#039;moduleclass_sfx&#039;));&amp;lt;/tt&amp;gt;. You don&#039;t need this anymore. See this PRː https://github.com/joomla/joomla-cms/pull/17447.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:40--&amp;gt; The one line that we haven’t explained so far is the first line &amp;lt;tt&amp;gt;defined(&#039;_JEXEC&#039;) or die;&amp;lt;/tt&amp;gt;. This line checks to make sure that this file is being included from the Joomla application. This is necessary to prevent variable injection and other potential security concerns.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating tmpl/default.php === &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:42--&amp;gt; The &amp;lt;tt&amp;gt;default.php&amp;lt;/tt&amp;gt; file is the template which displays the module output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed tmpl/default.php file ==== &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:44--&amp;gt; The code for the tmpl/default.php file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
echo &#039;[PROJECT_NAME]&#039;; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:45--&amp;gt; An important point to note is that the template file has the same scope as the &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file. It means that a variable can be defined in the &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file and then used in the template file without any extra declarations or function calls.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating mod_foo.xml === &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:47--&amp;gt; The &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is the installation file. Most entries are self-explanatory.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml file ==== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:49--&amp;gt; The code for the &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt;  file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;3.8&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating the language files === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:51--&amp;gt; The files &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod̠foo.ini&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod̠foo.sys.ini&amp;lt;/tt&amp;gt; are used to translate text in the frontend and in the backend.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:52--&amp;gt; The code for &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod̠foo.sys.ini&amp;lt;/tt&amp;gt; is as follows:&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;
&lt;br /&gt;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:53--&amp;gt; The &amp;lt;tt&amp;gt;.sys.ini&amp;lt;/tt&amp;gt; file is used to translate the description of the extension upon installation, where as the &amp;lt;tt&amp;gt;.ini&amp;lt;/tt&amp;gt; file is used to translate the remaining strings and the description when viewing your extension.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:54--&amp;gt; More information about language files can be found [[S:MyLanguage/Specification_of_language_files|here]].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:56--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;br /&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:57--&amp;gt; After that you can choose your module in the module manager, when you create a new site module.&amp;lt;/translate&amp;gt; &lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial1-&amp;lt;translate&amp;gt;&amp;lt;!--T:58--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial2-&amp;lt;translate&amp;gt;&amp;lt;!--T:59--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:60--&amp;gt; In the frontend, you will see your module like displayed in the next image.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial3-&amp;lt;translate&amp;gt;&amp;lt;!--T:61--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:63--&amp;gt; Module development for Joomla is a fairly simple, straightforward process. Using the techniques described in this tutorial, an endless variety of modules can be developed with little hassle.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:64--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/module&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:65--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add a helper class using namespaces - Part 2== &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:68--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Namespaces == &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:70--&amp;gt; With PHP 5.3, the namespaces came into their own. In other programming languages for a long time in use, these small structures now also help us with the clarity of our code.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:71--&amp;gt; Namespaces are separate areas in which certain logical things (in our case, classes, interfaces, functions, and constants) can live. These areas provide ncapsulation of the code and prevent name conflicts.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:72--&amp;gt; Let&#039;s take a look how to use them in Joomla 4. We use the helper file for this.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:74--&amp;gt; We will create/change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Helper/FooHelper.php&amp;lt;/code&amp;gt; - This is the file we use here as an example. We have to create it.&lt;br /&gt;
* &amp;lt;code&amp;gt;mod_foo.php&amp;lt;/code&amp;gt; - In this file we will mainly load the namespace.&lt;br /&gt;
* &amp;lt;code&amp;gt;tmpl/default.php&amp;lt;/code&amp;gt; - In this file demonstrate how the data of a helper can be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;mod_foo.xml&amp;lt;/code&amp;gt; - We create a new directory with a new file. This must be installed during the installation. For this we have to specify them in this file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating Helper/FooHelper.php === &amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:77--&amp;gt; Our new helper class should belong to a namespace. We achieve this with the following code. It is important, that this line is at the beginning of the file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;namespace Joomla\Module\Foo\Site\Helper;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:78--&amp;gt; Then we create a simple class with a simple method. Of course you can do a lot more here. Take a look at the Joomla core methods. Here are many examples. They show you first-hand what options you have.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed Helper/FooHelper.php ==== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:80--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Site&lt;br /&gt;
 * @subpackage  mod_foo&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
namespace Joomla\Module\Foo\Site\Helper;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Helper for mod_foo&lt;br /&gt;
 *&lt;br /&gt;
 * @since  4.0&lt;br /&gt;
 */&lt;br /&gt;
class FooHelper&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Retrieve foo test&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   Registry        $params  The module parameters&lt;br /&gt;
	 * @param   CMSApplication  $app     The application&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  array&lt;br /&gt;
	 */&lt;br /&gt;
	public static function getText()&lt;br /&gt;
	{&lt;br /&gt;
		return &#039;FooHelpertest&#039;;&lt;br /&gt;
	}&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;&lt;br /&gt;
&lt;br /&gt;
=== Editing mod_foo.php === &amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:82--&amp;gt; Our new helper class is imported to our current scope at the begin of the file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;use Joomla\Module\Foo\Site\Helper\FooHelper;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:83--&amp;gt; Last use the helper file for testing if it is loaded correctlyː&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$test  = FooHelper::getText($params, $app);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.php file ==== &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:85--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Helper\ModuleHelper;&lt;br /&gt;
use Joomla\Module\Foo\Site\Helper\FooHelper;&lt;br /&gt;
&lt;br /&gt;
$test  = FooHelper::getText();&lt;br /&gt;
&lt;br /&gt;
require ModuleHelper::getLayoutPath(&#039;mod_foo&#039;, $params-&amp;gt;get(&#039;layout&#039;, &#039;default&#039;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing tmpl/default.php === &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:87--&amp;gt; In this file you make only a small change to demonstrate in the frontend that your helper file is working properly. You only add the value of the variable at the end of the current output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed tmpl/default.php ==== &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:89--&amp;gt; The complete &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing mod_foo.xml === &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:91--&amp;gt; First you have to add a line, so that the namespace is set automatically in Joomla. After this change, you have to re-install your module. A simple change in an already installed module is not enough. If you are doing local development you can also delete the files libraries/autoload_psr4.php and it will automatically be re-created. After inserting and installing, the namespace is known by the loader &amp;lt;tt&amp;gt;JPATH_LIBRARIES . &#039;/autoload_psr4.php&#039;&amp;lt;/tt&amp;gt;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:92--&amp;gt; Joomla! should copy your helper file when installing the module. So Joomla! needs to know your helper file. For this, you need to add the following line to your XML file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:94--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;3.8&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:96--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:97--&amp;gt; After that you can choose your module in the module manager, when you create a new site module.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:98--&amp;gt; In the frontend you will see your module like displayed in the next image. The text form your helper file is displayed.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial23-&amp;lt;translate&amp;gt;&amp;lt;!--T:99--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:101--&amp;gt; As you can see, once you get a bit into the namespaces, they are not that complicated anymore. In big projects they can bring a lot of benefits. However, we should plan namespaces, as otherwise it will soon be more time-consuming.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:102--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/module&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:103--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Customizationː Add parameters via form fields - Part 3 == &amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:106--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Customization with form fields and parameters == &amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:108--&amp;gt; Form fields give a great deal of customization in Joomla and for modules are the sole way of allowing the user to tweak the module to the needs of their site.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:109--&amp;gt; In this case we are going to extend our previous example using a url field for inserting a domain that we can use as link in the front end. To allow this to happen we will use the [[S:MyLanguage/URL_form_field_type|URL Form Field]] type.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:110--&amp;gt; After that, we insert parameters that allow to use standard functionality of Joomla.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:111--&amp;gt; Let&#039;s take a look on how to use them in Joomla 4.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:113--&amp;gt; We will change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - This is the file where we add the fields.&lt;br /&gt;
* &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; - In this file demonstrate how the data of a field can be used.&lt;br /&gt;
* &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.ini&amp;lt;/tt&amp;gt; - Here we use a language string so that the field can be labeled correctly in different languages.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing mod_foo.xml === &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:116--&amp;gt; First we set a custom parameter.&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;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
    type=&amp;quot;url&amp;quot;&lt;br /&gt;
    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:117--&amp;gt; Then we insert Joomla default fields, so that we can use cache, moduleclass-suffix and layouts.&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;field&lt;br /&gt;
    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
    type=&amp;quot;list&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
    default=&amp;quot;0&amp;quot;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
    type=&amp;quot;number&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
    default=&amp;quot;0&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:119--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;3.8&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
    &amp;lt;config&amp;gt;&lt;br /&gt;
        &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
                    type=&amp;quot;url&amp;quot;&lt;br /&gt;
                    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
                    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;advanced&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
                    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
                    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
                    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
                    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
                    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
                    type=&amp;quot;list&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
                    type=&amp;quot;number&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
                    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
                    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
        &amp;lt;/fields&amp;gt;&lt;br /&gt;
    &amp;lt;/config&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing tmpl/default.php === &amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:121--&amp;gt; We can use the value of the parameter for creating an hyperlink in the frontend. We can access the value via the variable via the variable $params.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$domain = $params-&amp;gt;get(&#039;domain&#039;, &#039;https://www.joomla.org&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:122--&amp;gt; Later we set use this value for creating the hyperlink.&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;
&amp;lt;a href=&amp;quot;&amp;lt;?php echo $domain; ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test; ?&amp;gt;&lt;br /&gt;
&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed tmpl/default.php file ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:124--&amp;gt; The complete &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
$domain = $params-&amp;gt;get(&#039;domain&#039;, &#039;https://www.joomla.org&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;a href=&amp;quot;&amp;lt;?php echo $domain; ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test; ?&amp;gt;&lt;br /&gt;
&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing language/en-GB/en-GB.mod_foo.ini === &amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:126--&amp;gt; Here we can specify the text for the English version of the field label.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;MOD_FOO_FIELD_URL_LABEL=&amp;quot;Url&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed language/en-GB/en-GB.mod_foo.ini ==== &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:128--&amp;gt; The complete &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.ini&amp;lt;/tt&amp;gt; file 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;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
MOD_FOO_FIELD_URL_LABEL=&amp;quot;Url&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:130--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:131--&amp;gt; After that you can choose your module in the module manager, when you create a new site module.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:132--&amp;gt; In the backend, you will see your module like displayed in the next image.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:133--&amp;gt; In the basic tab, you will see the custom field where you can insert a domain. The text for the label is fetched from the language file.&amp;lt;/translate&amp;gt; &lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial31-&amp;lt;translate&amp;gt;&amp;lt;!--T:134--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:135--&amp;gt; In the advanced tab, you will see all default options except the cache mode because of this is a hidden field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial32-&amp;lt;translate&amp;gt;&amp;lt;!--T:136--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:137--&amp;gt; In the frontend, you will see your module like displayed in the next image. The text form your helper file is displayed and you should see a hyperlink.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial33-&amp;lt;translate&amp;gt;&amp;lt;!--T:138--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:140--&amp;gt; Form fields give the user an easy way to customize the module to their sites settings. This allows the modules scope to be increased.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:141--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/module&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:142--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:143--&amp;gt; See this issue for possible future changes:&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla/joomla-cms/pull/23553&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use Install, Update and Uninstall script - Part 4 == &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:146--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Scripts === &amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:148--&amp;gt; Installing, updating and uninstalling a module may require additional operations that cannot be achieved by the basic operations described in the main XML file. Joomla offers a new approach to solve this problem. It consists in using a PHP script file containing a class using five methods:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:149--&amp;gt;&lt;br /&gt;
* preflight which is executed before install and update&lt;br /&gt;
* install&lt;br /&gt;
* update&lt;br /&gt;
* uninstall&lt;br /&gt;
* postflight which is executed after install and update&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:150--&amp;gt; Let&#039;s take a look how to use them in Joomla 4. We use the helper file for this.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:151--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:152--&amp;gt; We will create/change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:153--&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;script.php&amp;lt;/tt&amp;gt; - This is the file we use here as an example. We have to create it.&lt;br /&gt;
* &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.sys.ini&amp;lt;/tt&amp;gt; - In this file we will add text.&lt;br /&gt;
* &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - We create a new file. This must be installed during the installation. For this we have to specify it in this file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating script.php === &amp;lt;!--T:154--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:155--&amp;gt; Writing an extension script consists in declaring a class whose name is &amp;lt;tt&amp;gt;mod_ModuleNameInstallerScripʈ&amp;lt;/tt&amp;gt; with these 5 methods. See the comments in the file for more information. In this comments I explain when a method is called.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:156--&amp;gt; In this example, I only use text to show when which method will be executed. In addition, I show you how to check the minimum requirements. Of course you can do much more. For example, you can delete files that are no longer needed in a new version of your module. This can be seen in the file. Another idea for this file is to create sample content, to show a success message with the current installed version number or you can redirect after a successful installation to the page with the module settings.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed script.php ==== &amp;lt;!--T:157--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:158--&amp;gt; The complete &amp;lt;tt&amp;gt;script.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Language\Text;&lt;br /&gt;
use Joomla\CMS\Log\Log;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Script file of Foo module&lt;br /&gt;
 */&lt;br /&gt;
class mod_fooInstallerScript {&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Extension script constructor.&lt;br /&gt;
     *&lt;br /&gt;
     * @return  void&lt;br /&gt;
     */&lt;br /&gt;
    public function __construct() {&lt;br /&gt;
        $this-&amp;gt;minimumJoomla = &#039;4.0&#039;;&lt;br /&gt;
        $this-&amp;gt;minimumPhp = JOOMLA_MINIMUM_PHP;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Method to install the extension&lt;br /&gt;
     *&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function install($parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_UNINSTALL&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Method to uninstall the extension&lt;br /&gt;
     *&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function uninstall($parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_UNINSTALL&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Method to update the extension&lt;br /&gt;
     *&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function update($parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_UPDATE&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Function called before extension installation/update/removal procedure commences&lt;br /&gt;
     *&lt;br /&gt;
     * @param   string            $type    The type of change (install, update or discover_install, not uninstall)&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function preflight($type, $parent) {&lt;br /&gt;
        // Check for the minimum PHP version before continuing&lt;br /&gt;
        if (!empty($this-&amp;gt;minimumPhp) &amp;amp;&amp;amp; version_compare(PHP_VERSION, $this-&amp;gt;minimumPhp, &#039;&amp;lt;&#039;)) {&lt;br /&gt;
            Log::add(Text::sprintf(&#039;JLIB_INSTALLER_MINIMUM_PHP&#039;, $this-&amp;gt;minimumPhp), Log::WARNING, &#039;jerror&#039;);&lt;br /&gt;
&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Check for the minimum Joomla version before continuing&lt;br /&gt;
        if (!empty($this-&amp;gt;minimumJoomla) &amp;amp;&amp;amp; version_compare(JVERSION, $this-&amp;gt;minimumJoomla, &#039;&amp;lt;&#039;)) {&lt;br /&gt;
            Log::add(Text::sprintf(&#039;JLIB_INSTALLER_MINIMUM_JOOMLA&#039;, $this-&amp;gt;minimumJoomla), Log::WARNING, &#039;jerror&#039;);&lt;br /&gt;
&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_PREFLIGHT&#039;);&lt;br /&gt;
        echo $this-&amp;gt;minimumJoomla . &#039; &#039; . $this-&amp;gt;minimumPhp;&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Function called after extension installation/update/removal procedure commences&lt;br /&gt;
     *&lt;br /&gt;
     * @param   string            $type    The type of change (install, update or discover_install, not uninstall)&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function postflight($type, $parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_POSTFLIGHT&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&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;&lt;br /&gt;
=== Editing language/en-GB/en-GB.mod_foo.sys.ini === &amp;lt;!--T:159--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:160--&amp;gt; There is not much to explain here. Write the text for the translation into this file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed language/en-GB/en-GB.mod_foo.sys.ini file ==== &amp;lt;!--T:161--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:162--&amp;gt; The complete &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.sys.ini&amp;lt;/tt&amp;gt; file 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;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_PREFLIGHT=&amp;quot;&amp;lt;p&amp;gt;Anything here happens before the installation/update/uninstallation of the module&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_UPDATE=&amp;quot;&amp;lt;p&amp;gt;The module has been updated&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_UNINSTALL=&amp;quot;&amp;lt;p&amp;gt;The module has been uninstalled&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_INSTALL=&amp;quot;&amp;lt;p&amp;gt;The module has been installed&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_POSTFLIGHT=&amp;quot;&amp;lt;p&amp;gt;Anything here happens after the installation/update/uninstallation of the module&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing mod_foo.xml === &amp;lt;!--T:163--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:164--&amp;gt; You have to add a line, so that the script is called automatically in Joomla.&amp;lt;/translate&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;scriptfile&amp;gt;script.php&amp;lt;/scriptfile&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:165--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:166--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;4.0&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;scriptfile&amp;gt;script.php&amp;lt;/scriptfile&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
    &amp;lt;config&amp;gt;&lt;br /&gt;
        &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
                    type=&amp;quot;url&amp;quot;&lt;br /&gt;
                    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
                    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;advanced&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
                    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
                    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
                    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
                    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
                    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
                    type=&amp;quot;list&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
                    type=&amp;quot;number&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
                    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
                    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
        &amp;lt;/fields&amp;gt;&lt;br /&gt;
    &amp;lt;/config&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:167--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:168--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:169--&amp;gt; Immediately after the installation, you will see the following information. This you had entered in the script so.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial14-&amp;lt;translate&amp;gt;&amp;lt;!--T:170--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:171--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:172--&amp;gt; As you can see, Joomla offers you a lot to make your extension easy to use - right from the start.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:173--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/module&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:174--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use Joomla Updaterː Adding Auto Update - Part 5 == &amp;lt;!--T:175--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:176--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:177--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Joomla Updater === &amp;lt;!--T:178--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:179--&amp;gt; The first thing to do is to read the [[S:MyLanguage/J2.5:Managing_Component_Updates|Managing Component Upgrades with Joomla 2.5 - Part 1]] tutorial to give an idea of how the upgrade process works in Joomla. Whilst written for 2.5 the process hasn&#039;t changed. Also read [[S:MyLanguage/Deploying_an_Update_Server|Deploying an update server]] - this is what we&#039;ll be implementing in this tutorial.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:180--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:181--&amp;gt; We will create/change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:182--&amp;gt; * &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - The only way to update our existing module is to add in a update server - for example &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/foo_update.xmɭ&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; - into the xml file.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:183--&amp;gt; * &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt; - Then we have to create the XML file for the update server at &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/foo_update.xmɭ&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; to let Joomla know an update is available.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Editing mod_foo.xml ==== &amp;lt;!--T:184--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:185--&amp;gt; To add our update server, we need to insert the following lines in your XML-File&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&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;[PROJECT_NAME]&amp;quot;&amp;gt;https://www.example.com/mod_foo.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
&amp;lt;/updateservers&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:186--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:187--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;4.0&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&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;[PROJECT_NAME]&amp;quot;&amp;gt;https://www.example.com/mod_foo.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
    &amp;lt;/updateservers&amp;gt;&lt;br /&gt;
    &amp;lt;config&amp;gt;&lt;br /&gt;
        &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
                    type=&amp;quot;url&amp;quot;&lt;br /&gt;
                    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
                    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;advanced&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
                    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
                    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
                    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
                    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
                    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
                    type=&amp;quot;list&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
                    type=&amp;quot;number&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
                    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
                    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
        &amp;lt;/fields&amp;gt;&lt;br /&gt;
    &amp;lt;/config&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:188--&amp;gt; So now that Joomla is searching for updates to our extension - let&#039;s create one to test out our process. But first we need to create the file &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt;. So far we have only described the update server. We do not know yet if there is an update. In the file &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt; we indicate when a new version is published and where it can be downloaded.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating foo_update.xml === &amp;lt;!--T:189--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:190--&amp;gt; Now we have to create the XML file at &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/foo_update.xml&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; to let Joomla know an update is available.&amp;lt;/translate&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed foo_update.xml ==== &amp;lt;!--T:191--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:192--&amp;gt; The complete &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;updates&amp;gt;&lt;br /&gt;
    &amp;lt;update&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;Foo&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;This is mod_foo 1.0.1&amp;lt;/description&amp;gt;&lt;br /&gt;
        &amp;lt;element&amp;gt;mod_foo&amp;lt;/element&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;module&amp;lt;/type&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;1.0.1&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;downloads&amp;gt;&lt;br /&gt;
            &amp;lt;downloadurl type=&amp;quot;full&amp;quot; format=&amp;quot;zip&amp;quot;&amp;gt;http://www.example.com/mod_foo_101.zip&amp;lt;/downloadurl&amp;gt;&lt;br /&gt;
        &amp;lt;/downloads&amp;gt;&lt;br /&gt;
        &amp;lt;maintainer&amp;gt;Joomla&amp;lt;/maintainer&amp;gt;&lt;br /&gt;
        &amp;lt;maintainerurl&amp;gt;http://www.example.com&amp;lt;/maintainerurl&amp;gt;&lt;br /&gt;
        &amp;lt;targetplatform name=&amp;quot;joomla&amp;quot; version=&amp;quot;4.0&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;client&amp;gt;site&amp;lt;/client&amp;gt;&lt;br /&gt;
    &amp;lt;/update&amp;gt;&lt;br /&gt;
&amp;lt;/updates&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:193--&amp;gt; After uploading this file to the address &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;https://www.example.com/mod_foo.xml&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; the update will be displayed in the Joomla backend.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Test your module update === &amp;lt;!--T:194--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:195--&amp;gt; Create a copy of the module as it is now. Then let&#039;s update the version number to 1.0.1. Now you can zip all files. After that you should load your zip to the URL &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/mod_foo_101.zip&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;. Now you can update your module via the Joomla Updater.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Commercial Modules === &amp;lt;!--T:196--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:197--&amp;gt; Note that in our files we have linked to the extensions updates xml file. And from that xml file we have a location for the zip of the module. This means that if someone was to track this backwards they could find the physical source of your modules zip file. If you don&#039;t do like this, you can find a solution in this PRː https://github.com/joomla/joomla-cms/pull/15185 .&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Conclusion === &amp;lt;!--T:198--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:199--&amp;gt; With the Joomla updater, you can easily reach all users and tell them that there is a new version. Even the update itself is easy.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:200--&amp;gt; Each extension should use an update server. Especially for security reasons.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:201--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/module&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:202--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Beginner Development{{#translation:}}]]&lt;br /&gt;
[[Category:Tutorials{{#translation:}}]]&lt;br /&gt;
[[Category:Tutorials in a Series{{#translation:}}]]&lt;br /&gt;
[[Category:Development{{#translation:}}]]&lt;br /&gt;
[[Category:Module Development{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla! 4.x{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla! 4.0{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Creating_a_Simple_Module&amp;diff=615709</id>
		<title>J4.x:Creating a Simple Module</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Creating_a_Simple_Module&amp;diff=615709"/>
		<updated>2019-06-21T07:05:24Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Changed to point to modules rather than plugin boilerplate&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=4.x|comment=&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt; Tutorial&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{Top portal heading|color=white-bkgd|icon=file-code-o|icon-color=#5091cd|size=5x|text-color=#333|title=&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt; Creating a Simple Module for Joomla 4.x&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{-}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt; This is a tutorial on how to Create a simple module for Joomla Version 4x.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Introduction == &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt; Joomlaǃ 4 provides five types of extensionsː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Component|&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt; Components&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt; A component is the main part of the site. A component handles data manipulation as well as input and storage into the database. A component on most sites is the primary focus of the page.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Module|&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt; Modules&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039; &amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt; A module is an add-on to the site that extends the functionality. A module usually occupies a secondary portion of the web page and is not considered the primary focus of a page. It can be displayed on different positions and you can choose on which active menu items it should be displayed. Modules are lightweight and flexible extensions. They are used for small bits of the page that are generally less complex and are able to be seen across different components.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Plugin|&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt; Plugins&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt; A Plugin manipulates output that is already generated by the system. It typically does not run as separate part of the site. It takes data from other sources (i.e. the content) and manipulates this data before displaying. A plugin typically work behind the scenes.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Languages|&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt; Languages&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;Probably the most basic extensions are languages. In essence the language package files consist of key/value pairs, which provide the translation of static text strings, assigned within the Joomla! source code. &lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Templates|&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt; Templates&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt; A template is basically the design of your Joomla! powered website.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt; Joomla! 4 is constructed using five different applications:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
* Installation (used for installing Joomla and have to delete after installation)&lt;br /&gt;
* Administrator (backend - used for managing content)&lt;br /&gt;
* Public or site (frontend - used for displaying content)&lt;br /&gt;
* CLI (used for accessing Joomla on the command line and for cron jobs)&lt;br /&gt;
* API (web services - used for creating APIs for machine accessible content)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The installation application is used once. The administrator and public are used through the concept of &#039;&#039;components&#039;&#039; with &#039;&#039;modules&#039;&#039;. Each module has a single entry point located in the &#039;&#039;modules&#039;&#039; and accordingly &#039;&#039;administrator/modules&#039;&#039;  directory. This entry point is called &amp;lt;tt&amp;gt;&#039;&#039;mod_modulename/mod_modulename.php&#039;&#039;&amp;lt;/tt&amp;gt; (the &#039;&#039;mod_&#039;&#039; prefix is a historical trace). The entry point for the login module is for &#039;&#039;example /mod_login/mod_login.php&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt; You can download Joomla! 4 at [https://github.com/joomla/joomla-cms/tree/4.0-dev GitHub], on the [https://developer.joomla.org/nightly-builds.html Developer website] or you can create a free website at https://launch.joomla.org.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Creating a simple module/Developing a Basic Module - Part 1 == &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt; You can see many examples of modules in the standard Joomla! install. For example:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* Menus &lt;br /&gt;
* Latest News&lt;br /&gt;
* Login form&lt;br /&gt;
* and many more.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt; This tutorial will explain how to create a simple module. Through this tutorial you will learn the basic file structure of a Joomlaǃ 4 module. This basic structure can then be expanded to produce more elaborate modules.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt; There are a few basic files that are used in the standard pattern of module development:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt; * &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; - This file is the main entry point for the module. It will perform any necessary initialization routines, call helper routines to collect any necessary data, and include the template which will display the module output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt; * &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - This file contains information about the module. It defines the files that need to be installed by the Joomla! installer and specifies configuration parameters for the module.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt; * &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; - This is the module template. This file will take the data collected by mod_foo.php and generate the HTML to be displayed on the page.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt; * &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.ini&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.sys.ini&amp;lt;/tt&amp;gt;- This are the files that provide the text in United Kingdom English.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating mod_foo.php === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:32--&amp;gt; The &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file will perform following tasks:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:33--&amp;gt; * Import the class &amp;lt;tt&amp;gt;ModuleHelper&amp;lt;/tt&amp;gt; to the current scope. We need it later for displaying the output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:34--&amp;gt; * Include the template to display the output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:35--&amp;gt; The helper class is imported to our current scope at the begin of the file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;use Joomla\CMS\Helper\ModuleHelper;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:36--&amp;gt; Last we include the template to display the output via&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;require ModuleHelper::getLayoutPath(&#039;mod_foo&#039;, $params-&amp;gt;get(&#039;layout&#039;, &#039;default&#039;));&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.php file ==== &amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:38--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Helper\ModuleHelper;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
require ModuleHelper::getLayoutPath(&#039;mod_foo&#039;, $params-&amp;gt;get(&#039;layout&#039;, &#039;default&#039;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:39--&amp;gt; &#039;&#039;Side note&#039;&#039;ː In Joomla 3x you usually used a line like &amp;lt;tt&amp;gt;$moduleclass_sfx = htmlspecialchars($params-&amp;gt;get(&#039;moduleclass_sfx&#039;));&amp;lt;/tt&amp;gt;. You don&#039;t need this anymore. See this PRː https://github.com/joomla/joomla-cms/pull/17447.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:40--&amp;gt; The one line that we haven’t explained so far is the first line &amp;lt;tt&amp;gt;defined(&#039;_JEXEC&#039;) or die;&amp;lt;/tt&amp;gt;. This line checks to make sure that this file is being included from the Joomla application. This is necessary to prevent variable injection and other potential security concerns.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating tmpl/default.php === &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:42--&amp;gt; The &amp;lt;tt&amp;gt;default.php&amp;lt;/tt&amp;gt; file is the template which displays the module output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed tmpl/default.php file ==== &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:44--&amp;gt; The code for the tmpl/default.php file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
echo &#039;[PROJECT_NAME]&#039;; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:45--&amp;gt; An important point to note is that the template file has the same scope as the &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file. It means that a variable can be defined in the &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file and then used in the template file without any extra declarations or function calls.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating mod_foo.xml === &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:47--&amp;gt; The &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is the installation file. Most entries are self-explanatory.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml file ==== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:49--&amp;gt; The code for the &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt;  file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;3.8&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating the language files === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:51--&amp;gt; The files &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod̠foo.ini&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod̠foo.sys.ini&amp;lt;/tt&amp;gt; are used to translate text in the frontend and in the backend.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:52--&amp;gt; The code for &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod̠foo.sys.ini&amp;lt;/tt&amp;gt; is as follows:&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;
&lt;br /&gt;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:53--&amp;gt; The &amp;lt;tt&amp;gt;.sys.ini&amp;lt;/tt&amp;gt; file is used to translate the description of the extension upon installation, where as the &amp;lt;tt&amp;gt;.ini&amp;lt;/tt&amp;gt; file is used to translate the remaining strings and the description when viewing your extension.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:54--&amp;gt; More information about language files can be found [[S:MyLanguage/Specification_of_language_files|here]].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:56--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;br /&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:57--&amp;gt; After that you can choose your module in the module manager, when you create a new site module.&amp;lt;/translate&amp;gt; &lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial1-&amp;lt;translate&amp;gt;&amp;lt;!--T:58--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial2-&amp;lt;translate&amp;gt;&amp;lt;!--T:59--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:60--&amp;gt; In the frontend, you will see your module like displayed in the next image.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial3-&amp;lt;translate&amp;gt;&amp;lt;!--T:61--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:63--&amp;gt; Module development for Joomla is a fairly simple, straightforward process. Using the techniques described in this tutorial, an endless variety of modules can be developed with little hassle.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:64--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/module&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:65--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add a helper class using namespaces - Part 2== &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:68--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Namespaces == &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:70--&amp;gt; With PHP 5.3, the namespaces came into their own. In other programming languages for a long time in use, these small structures now also help us with the clarity of our code.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:71--&amp;gt; Namespaces are separate areas in which certain logical things (in our case, classes, interfaces, functions, and constants) can live. These areas provide ncapsulation of the code and prevent name conflicts.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:72--&amp;gt; Let&#039;s take a look how to use them in Joomla 4. We use the helper file for this.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:74--&amp;gt; We will create/change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Helper/FooHelper.php&amp;lt;/code&amp;gt; - This is the file we use here as an example. We have to create it.&lt;br /&gt;
* &amp;lt;code&amp;gt;mod_foo.php&amp;lt;/code&amp;gt; - In this file we will mainly load the namespace.&lt;br /&gt;
* &amp;lt;code&amp;gt;tmpl/default.php&amp;lt;/code&amp;gt; - In this file demonstrate how the data of a helper can be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;mod_foo.xml&amp;lt;/code&amp;gt; - We create a new directory with a new file. This must be installed during the installation. For this we have to specify them in this file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating Helper/FooHelper.php === &amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:77--&amp;gt; Our new helper class should belong to a namespace. We achieve this with the following code. It is important, that this line is at the beginning of the file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;namespace Joomla\Module\Foo\Site\Helper;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:78--&amp;gt; Then we create a simple class with a simple method. Of course you can do a lot more here. Take a look at the Joomla core methods. Here are many examples. They show you first-hand what options you have.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed Helper/FooHelper.php ==== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:80--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Site&lt;br /&gt;
 * @subpackage  mod_foo&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
namespace Joomla\Module\Foo\Site\Helper;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Helper for mod_foo&lt;br /&gt;
 *&lt;br /&gt;
 * @since  4.0&lt;br /&gt;
 */&lt;br /&gt;
class FooHelper&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Retrieve foo test&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   Registry        $params  The module parameters&lt;br /&gt;
	 * @param   CMSApplication  $app     The application&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  array&lt;br /&gt;
	 */&lt;br /&gt;
	public static function getText()&lt;br /&gt;
	{&lt;br /&gt;
		return &#039;FooHelpertest&#039;;&lt;br /&gt;
	}&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;&lt;br /&gt;
&lt;br /&gt;
=== Editing mod_foo.php === &amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:82--&amp;gt; Our new helper class is imported to our current scope at the begin of the file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;use Joomla\Module\Foo\Site\Helper\FooHelper;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:83--&amp;gt; Last use the helper file for testing if it is loaded correctlyː&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$test  = FooHelper::getText($params, $app);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.php file ==== &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:85--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Helper\ModuleHelper;&lt;br /&gt;
use Joomla\Module\Foo\Site\Helper\FooHelper;&lt;br /&gt;
&lt;br /&gt;
$test  = FooHelper::getText();&lt;br /&gt;
&lt;br /&gt;
require ModuleHelper::getLayoutPath(&#039;mod_foo&#039;, $params-&amp;gt;get(&#039;layout&#039;, &#039;default&#039;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing tmpl/default.php === &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:87--&amp;gt; In this file you make only a small change to demonstrate in the frontend that your helper file is working properly. You only add the value of the variable at the end of the current output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed tmpl/default.php ==== &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:89--&amp;gt; The complete &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing mod_foo.xml === &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:91--&amp;gt; First you have to add a line, so that the namespace is set automatically in Joomla. After this change, you have to re-install your module. A simple change in an already installed module is not enough. If you are doing local development you can also delete the files libraries/autoload_psr4.php and it will automatically be re-created. After inserting and installing, the namespace is known by the loader &amp;lt;tt&amp;gt;JPATH_LIBRARIES . &#039;/autoload_psr4.php&#039;&amp;lt;/tt&amp;gt;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:92--&amp;gt; Joomla! should copy your helper file when installing the module. So Joomla! needs to know your helper file. For this, you need to add the following line to your XML file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:94--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;3.8&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:96--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:97--&amp;gt; After that you can choose your module in the module manager, when you create a new site module.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:98--&amp;gt; In the frontend you will see your module like displayed in the next image. The text form your helper file is displayed.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial23-&amp;lt;translate&amp;gt;&amp;lt;!--T:99--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:101--&amp;gt; As you can see, once you get a bit into the namespaces, they are not that complicated anymore. In big projects they can bring a lot of benefits. However, we should plan namespaces, as otherwise it will soon be more time-consuming.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:102--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/module&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:103--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Customizationː Add parameters via form fields - Part 3 == &amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:106--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Customization with form fields and parameters == &amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:108--&amp;gt; Form fields give a great deal of customization in Joomla and for modules are the sole way of allowing the user to tweak the module to the needs of their site.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:109--&amp;gt; In this case we are going to extend our previous example using a url field for inserting a domain that we can use as link in the front end. To allow this to happen we will use the [[S:MyLanguage/URL_form_field_type|URL Form Field]] type.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:110--&amp;gt; After that, we insert parameters that allow to use standard functionality of Joomla.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:111--&amp;gt; Let&#039;s take a look on how to use them in Joomla 4.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:113--&amp;gt; We will change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - This is the file where we add the fields.&lt;br /&gt;
* &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; - In this file demonstrate how the data of a field can be used.&lt;br /&gt;
* &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.ini&amp;lt;/tt&amp;gt; - Here we use a language string so that the field can be labeled correctly in different languages.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing mod_foo.xml === &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:116--&amp;gt; First we set a custom parameter.&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;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
    type=&amp;quot;url&amp;quot;&lt;br /&gt;
    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:117--&amp;gt; Then we insert Joomla default fields, so that we can use cache, moduleclass-suffix and layouts.&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;field&lt;br /&gt;
    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
    type=&amp;quot;list&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
    default=&amp;quot;0&amp;quot;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
    type=&amp;quot;number&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
    default=&amp;quot;0&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:119--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;3.8&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
    &amp;lt;config&amp;gt;&lt;br /&gt;
        &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
                    type=&amp;quot;url&amp;quot;&lt;br /&gt;
                    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
                    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;advanced&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
                    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
                    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
                    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
                    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
                    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
                    type=&amp;quot;list&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
                    type=&amp;quot;number&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
                    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
                    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
        &amp;lt;/fields&amp;gt;&lt;br /&gt;
    &amp;lt;/config&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing tmpl/default.php === &amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:121--&amp;gt; We can use the value of the parameter for creating an hyperlink in the frontend. We can access the value via the variable via the variable $params.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$domain = $params-&amp;gt;get(&#039;domain&#039;, &#039;https://www.joomla.org&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:122--&amp;gt; Later we set use this value for creating the hyperlink.&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;
&amp;lt;a href=&amp;quot;&amp;lt;?php echo $domain; ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test; ?&amp;gt;&lt;br /&gt;
&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed tmpl/default.php file ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:124--&amp;gt; The complete &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
$domain = $params-&amp;gt;get(&#039;domain&#039;, &#039;https://www.joomla.org&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;a href=&amp;quot;&amp;lt;?php echo $domain; ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test; ?&amp;gt;&lt;br /&gt;
&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing language/en-GB/en-GB.mod_foo.ini === &amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:126--&amp;gt; Here we can specify the text for the English version of the field label.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;MOD_FOO_FIELD_URL_LABEL=&amp;quot;Url&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed language/en-GB/en-GB.mod_foo.ini ==== &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:128--&amp;gt; The complete &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.ini&amp;lt;/tt&amp;gt; file 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;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
MOD_FOO_FIELD_URL_LABEL=&amp;quot;Url&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:130--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:131--&amp;gt; After that you can choose your module in the module manager, when you create a new site module.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:132--&amp;gt; In the backend, you will see your module like displayed in the next image.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:133--&amp;gt; In the basic tab, you will see the custom field where you can insert a domain. The text for the label is fetched from the language file.&amp;lt;/translate&amp;gt; &lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial31-&amp;lt;translate&amp;gt;&amp;lt;!--T:134--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:135--&amp;gt; In the advanced tab, you will see all default options except the cache mode because of this is a hidden field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial32-&amp;lt;translate&amp;gt;&amp;lt;!--T:136--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:137--&amp;gt; In the frontend, you will see your module like displayed in the next image. The text form your helper file is displayed and you should see a hyperlink.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial33-&amp;lt;translate&amp;gt;&amp;lt;!--T:138--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:140--&amp;gt; Form fields give the user an easy way to customize the module to their sites settings. This allows the modules scope to be increased.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:141--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/module&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:142--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:143--&amp;gt; See this issue for possible future changes:&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla/joomla-cms/pull/23553&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use Install, Update and Uninstall script - Part 4 == &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:146--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Scripts === &amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:148--&amp;gt; Installing, updating and uninstalling a module may require additional operations that cannot be achieved by the basic operations described in the main XML file. Joomla offers a new approach to solve this problem. It consists in using a PHP script file containing a class using five methods:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:149--&amp;gt;&lt;br /&gt;
* preflight which is executed before install and update&lt;br /&gt;
* install&lt;br /&gt;
* update&lt;br /&gt;
* uninstall&lt;br /&gt;
* postflight which is executed after install and update&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:150--&amp;gt; Let&#039;s take a look how to use them in Joomla 4. We use the helper file for this.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:151--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:152--&amp;gt; We will create/change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:153--&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;script.php&amp;lt;/tt&amp;gt; - This is the file we use here as an example. We have to create it.&lt;br /&gt;
* &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.sys.ini&amp;lt;/tt&amp;gt; - In this file we will add text.&lt;br /&gt;
* &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - We create a new file. This must be installed during the installation. For this we have to specify it in this file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating script.php === &amp;lt;!--T:154--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:155--&amp;gt; Writing an extension script consists in declaring a class whose name is &amp;lt;tt&amp;gt;mod_ModuleNameInstallerScripʈ&amp;lt;/tt&amp;gt; with these 5 methods. See the comments in the file for more information. In this comments I explain when a method is called.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:156--&amp;gt; In this example, I only use text to show when which method will be executed. In addition, I show you how to check the minimum requirements. Of course you can do much more. For example, you can delete files that are no longer needed in a new version of your module. This can be seen in the file. Another idea for this file is to create sample content, to show a success message with the current installed version number or you can redirect after a successful installation to the page with the module settings.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed script.php ==== &amp;lt;!--T:157--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:158--&amp;gt; The complete &amp;lt;tt&amp;gt;script.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Language\Text;&lt;br /&gt;
use Joomla\CMS\Log\Log;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Script file of Foo module&lt;br /&gt;
 */&lt;br /&gt;
class mod_fooInstallerScript {&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Extension script constructor.&lt;br /&gt;
     *&lt;br /&gt;
     * @return  void&lt;br /&gt;
     */&lt;br /&gt;
    public function __construct() {&lt;br /&gt;
        $this-&amp;gt;minimumJoomla = &#039;4.0&#039;;&lt;br /&gt;
        $this-&amp;gt;minimumPhp = JOOMLA_MINIMUM_PHP;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Method to install the extension&lt;br /&gt;
     *&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function install($parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_UNINSTALL&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Method to uninstall the extension&lt;br /&gt;
     *&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function uninstall($parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_UNINSTALL&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Method to update the extension&lt;br /&gt;
     *&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function update($parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_UPDATE&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Function called before extension installation/update/removal procedure commences&lt;br /&gt;
     *&lt;br /&gt;
     * @param   string            $type    The type of change (install, update or discover_install, not uninstall)&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function preflight($type, $parent) {&lt;br /&gt;
        // Check for the minimum PHP version before continuing&lt;br /&gt;
        if (!empty($this-&amp;gt;minimumPhp) &amp;amp;&amp;amp; version_compare(PHP_VERSION, $this-&amp;gt;minimumPhp, &#039;&amp;lt;&#039;)) {&lt;br /&gt;
            Log::add(Text::sprintf(&#039;JLIB_INSTALLER_MINIMUM_PHP&#039;, $this-&amp;gt;minimumPhp), Log::WARNING, &#039;jerror&#039;);&lt;br /&gt;
&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Check for the minimum Joomla version before continuing&lt;br /&gt;
        if (!empty($this-&amp;gt;minimumJoomla) &amp;amp;&amp;amp; version_compare(JVERSION, $this-&amp;gt;minimumJoomla, &#039;&amp;lt;&#039;)) {&lt;br /&gt;
            Log::add(Text::sprintf(&#039;JLIB_INSTALLER_MINIMUM_JOOMLA&#039;, $this-&amp;gt;minimumJoomla), Log::WARNING, &#039;jerror&#039;);&lt;br /&gt;
&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_PREFLIGHT&#039;);&lt;br /&gt;
        echo $this-&amp;gt;minimumJoomla . &#039; &#039; . $this-&amp;gt;minimumPhp;&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Function called after extension installation/update/removal procedure commences&lt;br /&gt;
     *&lt;br /&gt;
     * @param   string            $type    The type of change (install, update or discover_install, not uninstall)&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function postflight($type, $parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_POSTFLIGHT&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&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;&lt;br /&gt;
=== Editing language/en-GB/en-GB.mod_foo.sys.ini === &amp;lt;!--T:159--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:160--&amp;gt; There is not much to explain here. Write the text for the translation into this file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed language/en-GB/en-GB.mod_foo.sys.ini file ==== &amp;lt;!--T:161--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:162--&amp;gt; The complete &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.sys.ini&amp;lt;/tt&amp;gt; file 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;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_PREFLIGHT=&amp;quot;&amp;lt;p&amp;gt;Anything here happens before the installation/update/uninstallation of the module&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_UPDATE=&amp;quot;&amp;lt;p&amp;gt;The module has been updated&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_UNINSTALL=&amp;quot;&amp;lt;p&amp;gt;The module has been uninstalled&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_INSTALL=&amp;quot;&amp;lt;p&amp;gt;The module has been installed&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_POSTFLIGHT=&amp;quot;&amp;lt;p&amp;gt;Anything here happens after the installation/update/uninstallation of the module&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing mod_foo.xml === &amp;lt;!--T:163--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:164--&amp;gt; You have to add a line, so that the script is called automatically in Joomla.&amp;lt;/translate&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;scriptfile&amp;gt;script.php&amp;lt;/scriptfile&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:165--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:166--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;4.0&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;scriptfile&amp;gt;script.php&amp;lt;/scriptfile&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
    &amp;lt;config&amp;gt;&lt;br /&gt;
        &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
                    type=&amp;quot;url&amp;quot;&lt;br /&gt;
                    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
                    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;advanced&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
                    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
                    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
                    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
                    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
                    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
                    type=&amp;quot;list&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
                    type=&amp;quot;number&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
                    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
                    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
        &amp;lt;/fields&amp;gt;&lt;br /&gt;
    &amp;lt;/config&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:167--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:168--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:169--&amp;gt; Immediately after the installation, you will see the following information. This you had entered in the script so.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial14-&amp;lt;translate&amp;gt;&amp;lt;!--T:170--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:171--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:172--&amp;gt; As you can see, Joomla offers you a lot to make your extension easy to use - right from the start.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:173--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/module&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:174--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use Joomla Updaterː Adding Auto Update - Part 5 == &amp;lt;!--T:175--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:176--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:177--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Joomla Updater === &amp;lt;!--T:178--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:179--&amp;gt; The first thing to do is to read the [[S:MyLanguage/J2.5:Managing_Component_Updates|Managing Component Upgrades with Joomla 2.5 - Part 1]] tutorial to give an idea of how the upgrade process works in Joomla. Whilst written for 2.5 the process hasn&#039;t changed. Also read [[S:MyLanguage/Deploying_an_Update_Server|Deploying an update server]] - this is what we&#039;ll be implementing in this tutorial.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:180--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:181--&amp;gt; We will create/change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:182--&amp;gt; * &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - The only way to update our existing module is to add in a update server - for example &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/foo_update.xmɭ&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; - into the xml file.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:183--&amp;gt; * &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt; - Then we have to create the XML file for the update server at &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/foo_update.xmɭ&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; to let Joomla know an update is available.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Editing mod_foo.xml ==== &amp;lt;!--T:184--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:185--&amp;gt; To add our update server, we need to insert the following lines in your XML-File&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&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;[PROJECT_NAME]&amp;quot;&amp;gt;https://www.example.com/mod_foo.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
&amp;lt;/updateservers&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:186--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:187--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;4.0&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&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;[PROJECT_NAME]&amp;quot;&amp;gt;https://www.example.com/mod_foo.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
    &amp;lt;/updateservers&amp;gt;&lt;br /&gt;
    &amp;lt;config&amp;gt;&lt;br /&gt;
        &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
                    type=&amp;quot;url&amp;quot;&lt;br /&gt;
                    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
                    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;advanced&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
                    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
                    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
                    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
                    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
                    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
                    type=&amp;quot;list&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
                    type=&amp;quot;number&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
                    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
                    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
        &amp;lt;/fields&amp;gt;&lt;br /&gt;
    &amp;lt;/config&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:188--&amp;gt; So now that Joomla is searching for updates to our extension - let&#039;s create one to test out our process. But first we need to create the file &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt;. So far we have only described the update server. We do not know yet if there is an update. In the file &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt; we indicate when a new version is published and where it can be downloaded.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating foo_update.xml === &amp;lt;!--T:189--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:190--&amp;gt; Now we have to create the XML file at &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/foo_update.xml&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; to let Joomla know an update is available.&amp;lt;/translate&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed foo_update.xml ==== &amp;lt;!--T:191--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:192--&amp;gt; The complete &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;updates&amp;gt;&lt;br /&gt;
    &amp;lt;update&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;Foo&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;This is mod_foo 1.0.1&amp;lt;/description&amp;gt;&lt;br /&gt;
        &amp;lt;element&amp;gt;mod_foo&amp;lt;/element&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;module&amp;lt;/type&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;1.0.1&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;downloads&amp;gt;&lt;br /&gt;
            &amp;lt;downloadurl type=&amp;quot;full&amp;quot; format=&amp;quot;zip&amp;quot;&amp;gt;http://www.example.com/mod_foo_101.zip&amp;lt;/downloadurl&amp;gt;&lt;br /&gt;
        &amp;lt;/downloads&amp;gt;&lt;br /&gt;
        &amp;lt;maintainer&amp;gt;Joomla&amp;lt;/maintainer&amp;gt;&lt;br /&gt;
        &amp;lt;maintainerurl&amp;gt;http://www.example.com&amp;lt;/maintainerurl&amp;gt;&lt;br /&gt;
        &amp;lt;targetplatform name=&amp;quot;joomla&amp;quot; version=&amp;quot;4.0&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;client&amp;gt;site&amp;lt;/client&amp;gt;&lt;br /&gt;
    &amp;lt;/update&amp;gt;&lt;br /&gt;
&amp;lt;/updates&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:193--&amp;gt; After uploading this file to the address &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;https://www.example.com/mod_foo.xml&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; the update will be displayed in the Joomla backend.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Test your module update === &amp;lt;!--T:194--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:195--&amp;gt; Create a copy of the module as it is now. Then let&#039;s update the version number to 1.0.1. Now you can zip all files. After that you should load your zip to the URL &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/mod_foo_101.zip&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;. Now you can update your module via the Joomla Updater.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Commercial Modules === &amp;lt;!--T:196--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:197--&amp;gt; Note that in our files we have linked to the extensions updates xml file. And from that xml file we have a location for the zip of the module. This means that if someone was to track this backwards they could find the physical source of your modules zip file. If you don&#039;t do like this, you can find a solution in this PRː https://github.com/joomla/joomla-cms/pull/15185 .&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Conclusion === &amp;lt;!--T:198--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:199--&amp;gt; With the Joomla updater, you can easily reach all users and tell them that there is a new version. Even the update itself is easy.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:200--&amp;gt; Each extension should use an update server. Especially for security reasons.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:201--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/plugins/system&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:202--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Beginner Development{{#translation:}}]]&lt;br /&gt;
[[Category:Tutorials{{#translation:}}]]&lt;br /&gt;
[[Category:Tutorials in a Series{{#translation:}}]]&lt;br /&gt;
[[Category:Development{{#translation:}}]]&lt;br /&gt;
[[Category:Module Development{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla! 4.x{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla! 4.0{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Creating_a_Simple_Module&amp;diff=615708</id>
		<title>J4.x:Creating a Simple Module</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Creating_a_Simple_Module&amp;diff=615708"/>
		<updated>2019-06-21T07:02:34Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Changed to point to modules rather than plugin boilerplate&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=4.x|comment=&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt; Tutorial&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{Top portal heading|color=white-bkgd|icon=file-code-o|icon-color=#5091cd|size=5x|text-color=#333|title=&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt; Creating a Simple Module for Joomla 4.x&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{-}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt; This is a tutorial on how to Create a simple module for Joomla Version 4x.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Introduction == &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt; Joomlaǃ 4 provides five types of extensionsː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Component|&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt; Components&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt; A component is the main part of the site. A component handles data manipulation as well as input and storage into the database. A component on most sites is the primary focus of the page.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Module|&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt; Modules&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039; &amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt; A module is an add-on to the site that extends the functionality. A module usually occupies a secondary portion of the web page and is not considered the primary focus of a page. It can be displayed on different positions and you can choose on which active menu items it should be displayed. Modules are lightweight and flexible extensions. They are used for small bits of the page that are generally less complex and are able to be seen across different components.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Plugin|&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt; Plugins&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt; A Plugin manipulates output that is already generated by the system. It typically does not run as separate part of the site. It takes data from other sources (i.e. the content) and manipulates this data before displaying. A plugin typically work behind the scenes.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Languages|&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt; Languages&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;Probably the most basic extensions are languages. In essence the language package files consist of key/value pairs, which provide the translation of static text strings, assigned within the Joomla! source code. &lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Templates|&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt; Templates&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt; A template is basically the design of your Joomla! powered website.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt; Joomla! 4 is constructed using five different applications:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
* Installation (used for installing Joomla and have to delete after installation)&lt;br /&gt;
* Administrator (backend - used for managing content)&lt;br /&gt;
* Public or site (frontend - used for displaying content)&lt;br /&gt;
* CLI (used for accessing Joomla on the command line and for cron jobs)&lt;br /&gt;
* API (web services - used for creating APIs for machine accessible content)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The installation application is used once. The administrator and public are used through the concept of &#039;&#039;components&#039;&#039; with &#039;&#039;modules&#039;&#039;. Each module has a single entry point located in the &#039;&#039;modules&#039;&#039; and accordingly &#039;&#039;administrator/modules&#039;&#039;  directory. This entry point is called &amp;lt;tt&amp;gt;&#039;&#039;mod_modulename/mod_modulename.php&#039;&#039;&amp;lt;/tt&amp;gt; (the &#039;&#039;mod_&#039;&#039; prefix is a historical trace). The entry point for the login module is for &#039;&#039;example /mod_login/mod_login.php&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt; You can download Joomla! 4 at [https://github.com/joomla/joomla-cms/tree/4.0-dev GitHub], on the [https://developer.joomla.org/nightly-builds.html Developer website] or you can create a free website at https://launch.joomla.org.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Creating a simple module/Developing a Basic Module - Part 1 == &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt; You can see many examples of modules in the standard Joomla! install. For example:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* Menus &lt;br /&gt;
* Latest News&lt;br /&gt;
* Login form&lt;br /&gt;
* and many more.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt; This tutorial will explain how to create a simple module. Through this tutorial you will learn the basic file structure of a Joomlaǃ 4 module. This basic structure can then be expanded to produce more elaborate modules.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt; There are a few basic files that are used in the standard pattern of module development:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt; * &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; - This file is the main entry point for the module. It will perform any necessary initialization routines, call helper routines to collect any necessary data, and include the template which will display the module output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt; * &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - This file contains information about the module. It defines the files that need to be installed by the Joomla! installer and specifies configuration parameters for the module.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt; * &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; - This is the module template. This file will take the data collected by mod_foo.php and generate the HTML to be displayed on the page.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt; * &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.ini&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.sys.ini&amp;lt;/tt&amp;gt;- This are the files that provide the text in United Kingdom English.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating mod_foo.php === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:32--&amp;gt; The &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file will perform following tasks:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:33--&amp;gt; * Import the class &amp;lt;tt&amp;gt;ModuleHelper&amp;lt;/tt&amp;gt; to the current scope. We need it later for displaying the output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:34--&amp;gt; * Include the template to display the output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:35--&amp;gt; The helper class is imported to our current scope at the begin of the file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;use Joomla\CMS\Helper\ModuleHelper;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:36--&amp;gt; Last we include the template to display the output via&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;require ModuleHelper::getLayoutPath(&#039;mod_foo&#039;, $params-&amp;gt;get(&#039;layout&#039;, &#039;default&#039;));&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.php file ==== &amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:38--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Helper\ModuleHelper;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
require ModuleHelper::getLayoutPath(&#039;mod_foo&#039;, $params-&amp;gt;get(&#039;layout&#039;, &#039;default&#039;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:39--&amp;gt; &#039;&#039;Side note&#039;&#039;ː In Joomla 3x you usually used a line like &amp;lt;tt&amp;gt;$moduleclass_sfx = htmlspecialchars($params-&amp;gt;get(&#039;moduleclass_sfx&#039;));&amp;lt;/tt&amp;gt;. You don&#039;t need this anymore. See this PRː https://github.com/joomla/joomla-cms/pull/17447.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:40--&amp;gt; The one line that we haven’t explained so far is the first line &amp;lt;tt&amp;gt;defined(&#039;_JEXEC&#039;) or die;&amp;lt;/tt&amp;gt;. This line checks to make sure that this file is being included from the Joomla application. This is necessary to prevent variable injection and other potential security concerns.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating tmpl/default.php === &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:42--&amp;gt; The &amp;lt;tt&amp;gt;default.php&amp;lt;/tt&amp;gt; file is the template which displays the module output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed tmpl/default.php file ==== &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:44--&amp;gt; The code for the tmpl/default.php file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
echo &#039;[PROJECT_NAME]&#039;; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:45--&amp;gt; An important point to note is that the template file has the same scope as the &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file. It means that a variable can be defined in the &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file and then used in the template file without any extra declarations or function calls.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating mod_foo.xml === &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:47--&amp;gt; The &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is the installation file. Most entries are self-explanatory.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml file ==== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:49--&amp;gt; The code for the &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt;  file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;3.8&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating the language files === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:51--&amp;gt; The files &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod̠foo.ini&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod̠foo.sys.ini&amp;lt;/tt&amp;gt; are used to translate text in the frontend and in the backend.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:52--&amp;gt; The code for &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod̠foo.sys.ini&amp;lt;/tt&amp;gt; is as follows:&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;
&lt;br /&gt;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:53--&amp;gt; The &amp;lt;tt&amp;gt;.sys.ini&amp;lt;/tt&amp;gt; file is used to translate the description of the extension upon installation, where as the &amp;lt;tt&amp;gt;.ini&amp;lt;/tt&amp;gt; file is used to translate the remaining strings and the description when viewing your extension.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:54--&amp;gt; More information about language files can be found [[S:MyLanguage/Specification_of_language_files|here]].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:56--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;br /&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:57--&amp;gt; After that you can choose your module in the module manager, when you create a new site module.&amp;lt;/translate&amp;gt; &lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial1-&amp;lt;translate&amp;gt;&amp;lt;!--T:58--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial2-&amp;lt;translate&amp;gt;&amp;lt;!--T:59--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:60--&amp;gt; In the frontend, you will see your module like displayed in the next image.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial3-&amp;lt;translate&amp;gt;&amp;lt;!--T:61--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:63--&amp;gt; Module development for Joomla is a fairly simple, straightforward process. Using the techniques described in this tutorial, an endless variety of modules can be developed with little hassle.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:64--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/module&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:65--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add a helper class using namespaces - Part 2== &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:68--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Namespaces == &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:70--&amp;gt; With PHP 5.3, the namespaces came into their own. In other programming languages for a long time in use, these small structures now also help us with the clarity of our code.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:71--&amp;gt; Namespaces are separate areas in which certain logical things (in our case, classes, interfaces, functions, and constants) can live. These areas provide ncapsulation of the code and prevent name conflicts.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:72--&amp;gt; Let&#039;s take a look how to use them in Joomla 4. We use the helper file for this.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:74--&amp;gt; We will create/change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Helper/FooHelper.php&amp;lt;/code&amp;gt; - This is the file we use here as an example. We have to create it.&lt;br /&gt;
* &amp;lt;code&amp;gt;mod_foo.php&amp;lt;/code&amp;gt; - In this file we will mainly load the namespace.&lt;br /&gt;
* &amp;lt;code&amp;gt;tmpl/default.php&amp;lt;/code&amp;gt; - In this file demonstrate how the data of a helper can be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;mod_foo.xml&amp;lt;/code&amp;gt; - We create a new directory with a new file. This must be installed during the installation. For this we have to specify them in this file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating Helper/FooHelper.php === &amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:77--&amp;gt; Our new helper class should belong to a namespace. We achieve this with the following code. It is important, that this line is at the beginning of the file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;namespace Joomla\Module\Foo\Site\Helper;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:78--&amp;gt; Then we create a simple class with a simple method. Of course you can do a lot more here. Take a look at the Joomla core methods. Here are many examples. They show you first-hand what options you have.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed Helper/FooHelper.php ==== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:80--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Site&lt;br /&gt;
 * @subpackage  mod_foo&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
namespace Joomla\Module\Foo\Site\Helper;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Helper for mod_foo&lt;br /&gt;
 *&lt;br /&gt;
 * @since  4.0&lt;br /&gt;
 */&lt;br /&gt;
class FooHelper&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Retrieve foo test&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   Registry        $params  The module parameters&lt;br /&gt;
	 * @param   CMSApplication  $app     The application&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  array&lt;br /&gt;
	 */&lt;br /&gt;
	public static function getText()&lt;br /&gt;
	{&lt;br /&gt;
		return &#039;FooHelpertest&#039;;&lt;br /&gt;
	}&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;&lt;br /&gt;
&lt;br /&gt;
=== Editing mod_foo.php === &amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:82--&amp;gt; Our new helper class is imported to our current scope at the begin of the file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;use Joomla\Module\Foo\Site\Helper\FooHelper;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:83--&amp;gt; Last use the helper file for testing if it is loaded correctlyː&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$test  = FooHelper::getText($params, $app);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.php file ==== &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:85--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Helper\ModuleHelper;&lt;br /&gt;
use Joomla\Module\Foo\Site\Helper\FooHelper;&lt;br /&gt;
&lt;br /&gt;
$test  = FooHelper::getText();&lt;br /&gt;
&lt;br /&gt;
require ModuleHelper::getLayoutPath(&#039;mod_foo&#039;, $params-&amp;gt;get(&#039;layout&#039;, &#039;default&#039;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing tmpl/default.php === &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:87--&amp;gt; In this file you make only a small change to demonstrate in the frontend that your helper file is working properly. You only add the value of the variable at the end of the current output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed tmpl/default.php ==== &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:89--&amp;gt; The complete &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing mod_foo.xml === &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:91--&amp;gt; First you have to add a line, so that the namespace is set automatically in Joomla. After this change, you have to re-install your module. A simple change in an already installed module is not enough. If you are doing local development you can also delete the files libraries/autoload_psr4.php and it will automatically be re-created. After inserting and installing, the namespace is known by the loader &amp;lt;tt&amp;gt;JPATH_LIBRARIES . &#039;/autoload_psr4.php&#039;&amp;lt;/tt&amp;gt;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:92--&amp;gt; Joomla! should copy your helper file when installing the module. So Joomla! needs to know your helper file. For this, you need to add the following line to your XML file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:94--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;3.8&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:96--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:97--&amp;gt; After that you can choose your module in the module manager, when you create a new site module.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:98--&amp;gt; In the frontend you will see your module like displayed in the next image. The text form your helper file is displayed.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial23-&amp;lt;translate&amp;gt;&amp;lt;!--T:99--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:101--&amp;gt; As you can see, once you get a bit into the namespaces, they are not that complicated anymore. In big projects they can bring a lot of benefits. However, we should plan namespaces, as otherwise it will soon be more time-consuming.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:102--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/module&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:103--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Customizationː Add parameters via form fields - Part 3 == &amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:106--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Customization with form fields and parameters == &amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:108--&amp;gt; Form fields give a great deal of customization in Joomla and for modules are the sole way of allowing the user to tweak the module to the needs of their site.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:109--&amp;gt; In this case we are going to extend our previous example using a url field for inserting a domain that we can use as link in the front end. To allow this to happen we will use the [[S:MyLanguage/URL_form_field_type|URL Form Field]] type.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:110--&amp;gt; After that, we insert parameters that allow to use standard functionality of Joomla.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:111--&amp;gt; Let&#039;s take a look on how to use them in Joomla 4.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:113--&amp;gt; We will change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - This is the file where we add the fields.&lt;br /&gt;
* &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; - In this file demonstrate how the data of a field can be used.&lt;br /&gt;
* &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.ini&amp;lt;/tt&amp;gt; - Here we use a language string so that the field can be labeled correctly in different languages.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing mod_foo.xml === &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:116--&amp;gt; First we set a custom parameter.&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;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
    type=&amp;quot;url&amp;quot;&lt;br /&gt;
    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:117--&amp;gt; Then we insert Joomla default fields, so that we can use cache, moduleclass-suffix and layouts.&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;field&lt;br /&gt;
    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
    type=&amp;quot;list&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
    default=&amp;quot;0&amp;quot;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
    type=&amp;quot;number&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
    default=&amp;quot;0&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:119--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;3.8&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
    &amp;lt;config&amp;gt;&lt;br /&gt;
        &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
                    type=&amp;quot;url&amp;quot;&lt;br /&gt;
                    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
                    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;advanced&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
                    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
                    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
                    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
                    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
                    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
                    type=&amp;quot;list&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
                    type=&amp;quot;number&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
                    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
                    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
        &amp;lt;/fields&amp;gt;&lt;br /&gt;
    &amp;lt;/config&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing tmpl/default.php === &amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:121--&amp;gt; We can use the value of the parameter for creating an hyperlink in the frontend. We can access the value via the variable via the variable $params.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$domain = $params-&amp;gt;get(&#039;domain&#039;, &#039;https://www.joomla.org&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:122--&amp;gt; Later we set use this value for creating the hyperlink.&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;
&amp;lt;a href=&amp;quot;&amp;lt;?php echo $domain; ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test; ?&amp;gt;&lt;br /&gt;
&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed tmpl/default.php file ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:124--&amp;gt; The complete &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
$domain = $params-&amp;gt;get(&#039;domain&#039;, &#039;https://www.joomla.org&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;a href=&amp;quot;&amp;lt;?php echo $domain; ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test; ?&amp;gt;&lt;br /&gt;
&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing language/en-GB/en-GB.mod_foo.ini === &amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:126--&amp;gt; Here we can specify the text for the English version of the field label.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;MOD_FOO_FIELD_URL_LABEL=&amp;quot;Url&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed language/en-GB/en-GB.mod_foo.ini ==== &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:128--&amp;gt; The complete &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.ini&amp;lt;/tt&amp;gt; file 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;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
MOD_FOO_FIELD_URL_LABEL=&amp;quot;Url&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:130--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:131--&amp;gt; After that you can choose your module in the module manager, when you create a new site module.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:132--&amp;gt; In the backend, you will see your module like displayed in the next image.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:133--&amp;gt; In the basic tab, you will see the custom field where you can insert a domain. The text for the label is fetched from the language file.&amp;lt;/translate&amp;gt; &lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial31-&amp;lt;translate&amp;gt;&amp;lt;!--T:134--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:135--&amp;gt; In the advanced tab, you will see all default options except the cache mode because of this is a hidden field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial32-&amp;lt;translate&amp;gt;&amp;lt;!--T:136--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:137--&amp;gt; In the frontend, you will see your module like displayed in the next image. The text form your helper file is displayed and you should see a hyperlink.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial33-&amp;lt;translate&amp;gt;&amp;lt;!--T:138--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:140--&amp;gt; Form fields give the user an easy way to customize the module to their sites settings. This allows the modules scope to be increased.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:141--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/module&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:142--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:143--&amp;gt; See this issue for possible future changes:&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla/joomla-cms/pull/23553&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use Install, Update and Uninstall script - Part 4 == &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:146--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Scripts === &amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:148--&amp;gt; Installing, updating and uninstalling a module may require additional operations that cannot be achieved by the basic operations described in the main XML file. Joomla offers a new approach to solve this problem. It consists in using a PHP script file containing a class using five methods:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:149--&amp;gt;&lt;br /&gt;
* preflight which is executed before install and update&lt;br /&gt;
* install&lt;br /&gt;
* update&lt;br /&gt;
* uninstall&lt;br /&gt;
* postflight which is executed after install and update&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:150--&amp;gt; Let&#039;s take a look how to use them in Joomla 4. We use the helper file for this.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:151--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:152--&amp;gt; We will create/change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:153--&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;script.php&amp;lt;/tt&amp;gt; - This is the file we use here as an example. We have to create it.&lt;br /&gt;
* &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.sys.ini&amp;lt;/tt&amp;gt; - In this file we will add text.&lt;br /&gt;
* &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - We create a new file. This must be installed during the installation. For this we have to specify it in this file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating script.php === &amp;lt;!--T:154--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:155--&amp;gt; Writing an extension script consists in declaring a class whose name is &amp;lt;tt&amp;gt;mod_ModuleNameInstallerScripʈ&amp;lt;/tt&amp;gt; with these 5 methods. See the comments in the file for more information. In this comments I explain when a method is called.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:156--&amp;gt; In this example, I only use text to show when which method will be executed. In addition, I show you how to check the minimum requirements. Of course you can do much more. For example, you can delete files that are no longer needed in a new version of your module. This can be seen in the file. Another idea for this file is to create sample content, to show a success message with the current installed version number or you can redirect after a successful installation to the page with the module settings.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed script.php ==== &amp;lt;!--T:157--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:158--&amp;gt; The complete &amp;lt;tt&amp;gt;script.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Language\Text;&lt;br /&gt;
use Joomla\CMS\Log\Log;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Script file of Foo module&lt;br /&gt;
 */&lt;br /&gt;
class mod_fooInstallerScript {&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Extension script constructor.&lt;br /&gt;
     *&lt;br /&gt;
     * @return  void&lt;br /&gt;
     */&lt;br /&gt;
    public function __construct() {&lt;br /&gt;
        $this-&amp;gt;minimumJoomla = &#039;4.0&#039;;&lt;br /&gt;
        $this-&amp;gt;minimumPhp = JOOMLA_MINIMUM_PHP;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Method to install the extension&lt;br /&gt;
     *&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function install($parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_UNINSTALL&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Method to uninstall the extension&lt;br /&gt;
     *&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function uninstall($parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_UNINSTALL&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Method to update the extension&lt;br /&gt;
     *&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function update($parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_UPDATE&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Function called before extension installation/update/removal procedure commences&lt;br /&gt;
     *&lt;br /&gt;
     * @param   string            $type    The type of change (install, update or discover_install, not uninstall)&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function preflight($type, $parent) {&lt;br /&gt;
        // Check for the minimum PHP version before continuing&lt;br /&gt;
        if (!empty($this-&amp;gt;minimumPhp) &amp;amp;&amp;amp; version_compare(PHP_VERSION, $this-&amp;gt;minimumPhp, &#039;&amp;lt;&#039;)) {&lt;br /&gt;
            Log::add(Text::sprintf(&#039;JLIB_INSTALLER_MINIMUM_PHP&#039;, $this-&amp;gt;minimumPhp), Log::WARNING, &#039;jerror&#039;);&lt;br /&gt;
&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Check for the minimum Joomla version before continuing&lt;br /&gt;
        if (!empty($this-&amp;gt;minimumJoomla) &amp;amp;&amp;amp; version_compare(JVERSION, $this-&amp;gt;minimumJoomla, &#039;&amp;lt;&#039;)) {&lt;br /&gt;
            Log::add(Text::sprintf(&#039;JLIB_INSTALLER_MINIMUM_JOOMLA&#039;, $this-&amp;gt;minimumJoomla), Log::WARNING, &#039;jerror&#039;);&lt;br /&gt;
&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_PREFLIGHT&#039;);&lt;br /&gt;
        echo $this-&amp;gt;minimumJoomla . &#039; &#039; . $this-&amp;gt;minimumPhp;&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Function called after extension installation/update/removal procedure commences&lt;br /&gt;
     *&lt;br /&gt;
     * @param   string            $type    The type of change (install, update or discover_install, not uninstall)&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function postflight($type, $parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_POSTFLIGHT&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&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;&lt;br /&gt;
=== Editing language/en-GB/en-GB.mod_foo.sys.ini === &amp;lt;!--T:159--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:160--&amp;gt; There is not much to explain here. Write the text for the translation into this file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed language/en-GB/en-GB.mod_foo.sys.ini file ==== &amp;lt;!--T:161--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:162--&amp;gt; The complete &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.sys.ini&amp;lt;/tt&amp;gt; file 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;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_PREFLIGHT=&amp;quot;&amp;lt;p&amp;gt;Anything here happens before the installation/update/uninstallation of the module&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_UPDATE=&amp;quot;&amp;lt;p&amp;gt;The module has been updated&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_UNINSTALL=&amp;quot;&amp;lt;p&amp;gt;The module has been uninstalled&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_INSTALL=&amp;quot;&amp;lt;p&amp;gt;The module has been installed&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_POSTFLIGHT=&amp;quot;&amp;lt;p&amp;gt;Anything here happens after the installation/update/uninstallation of the module&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing mod_foo.xml === &amp;lt;!--T:163--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:164--&amp;gt; You have to add a line, so that the script is called automatically in Joomla.&amp;lt;/translate&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;scriptfile&amp;gt;script.php&amp;lt;/scriptfile&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:165--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:166--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;4.0&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;scriptfile&amp;gt;script.php&amp;lt;/scriptfile&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
    &amp;lt;config&amp;gt;&lt;br /&gt;
        &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
                    type=&amp;quot;url&amp;quot;&lt;br /&gt;
                    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
                    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;advanced&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
                    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
                    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
                    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
                    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
                    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
                    type=&amp;quot;list&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
                    type=&amp;quot;number&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
                    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
                    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
        &amp;lt;/fields&amp;gt;&lt;br /&gt;
    &amp;lt;/config&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:167--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:168--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:169--&amp;gt; Immediately after the installation, you will see the following information. This you had entered in the script so.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial14-&amp;lt;translate&amp;gt;&amp;lt;!--T:170--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:171--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:172--&amp;gt; As you can see, Joomla offers you a lot to make your extension easy to use - right from the start.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:173--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/plugins/system&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:174--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use Joomla Updaterː Adding Auto Update - Part 5 == &amp;lt;!--T:175--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:176--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:177--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Joomla Updater === &amp;lt;!--T:178--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:179--&amp;gt; The first thing to do is to read the [[S:MyLanguage/J2.5:Managing_Component_Updates|Managing Component Upgrades with Joomla 2.5 - Part 1]] tutorial to give an idea of how the upgrade process works in Joomla. Whilst written for 2.5 the process hasn&#039;t changed. Also read [[S:MyLanguage/Deploying_an_Update_Server|Deploying an update server]] - this is what we&#039;ll be implementing in this tutorial.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:180--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:181--&amp;gt; We will create/change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:182--&amp;gt; * &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - The only way to update our existing module is to add in a update server - for example &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/foo_update.xmɭ&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; - into the xml file.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:183--&amp;gt; * &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt; - Then we have to create the XML file for the update server at &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/foo_update.xmɭ&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; to let Joomla know an update is available.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Editing mod_foo.xml ==== &amp;lt;!--T:184--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:185--&amp;gt; To add our update server, we need to insert the following lines in your XML-File&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&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;[PROJECT_NAME]&amp;quot;&amp;gt;https://www.example.com/mod_foo.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
&amp;lt;/updateservers&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:186--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:187--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;4.0&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&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;[PROJECT_NAME]&amp;quot;&amp;gt;https://www.example.com/mod_foo.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
    &amp;lt;/updateservers&amp;gt;&lt;br /&gt;
    &amp;lt;config&amp;gt;&lt;br /&gt;
        &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
                    type=&amp;quot;url&amp;quot;&lt;br /&gt;
                    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
                    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;advanced&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
                    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
                    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
                    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
                    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
                    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
                    type=&amp;quot;list&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
                    type=&amp;quot;number&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
                    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
                    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
        &amp;lt;/fields&amp;gt;&lt;br /&gt;
    &amp;lt;/config&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:188--&amp;gt; So now that Joomla is searching for updates to our extension - let&#039;s create one to test out our process. But first we need to create the file &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt;. So far we have only described the update server. We do not know yet if there is an update. In the file &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt; we indicate when a new version is published and where it can be downloaded.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating foo_update.xml === &amp;lt;!--T:189--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:190--&amp;gt; Now we have to create the XML file at &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/foo_update.xml&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; to let Joomla know an update is available.&amp;lt;/translate&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed foo_update.xml ==== &amp;lt;!--T:191--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:192--&amp;gt; The complete &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;updates&amp;gt;&lt;br /&gt;
    &amp;lt;update&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;Foo&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;This is mod_foo 1.0.1&amp;lt;/description&amp;gt;&lt;br /&gt;
        &amp;lt;element&amp;gt;mod_foo&amp;lt;/element&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;module&amp;lt;/type&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;1.0.1&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;downloads&amp;gt;&lt;br /&gt;
            &amp;lt;downloadurl type=&amp;quot;full&amp;quot; format=&amp;quot;zip&amp;quot;&amp;gt;http://www.example.com/mod_foo_101.zip&amp;lt;/downloadurl&amp;gt;&lt;br /&gt;
        &amp;lt;/downloads&amp;gt;&lt;br /&gt;
        &amp;lt;maintainer&amp;gt;Joomla&amp;lt;/maintainer&amp;gt;&lt;br /&gt;
        &amp;lt;maintainerurl&amp;gt;http://www.example.com&amp;lt;/maintainerurl&amp;gt;&lt;br /&gt;
        &amp;lt;targetplatform name=&amp;quot;joomla&amp;quot; version=&amp;quot;4.0&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;client&amp;gt;site&amp;lt;/client&amp;gt;&lt;br /&gt;
    &amp;lt;/update&amp;gt;&lt;br /&gt;
&amp;lt;/updates&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:193--&amp;gt; After uploading this file to the address &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;https://www.example.com/mod_foo.xml&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; the update will be displayed in the Joomla backend.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Test your module update === &amp;lt;!--T:194--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:195--&amp;gt; Create a copy of the module as it is now. Then let&#039;s update the version number to 1.0.1. Now you can zip all files. After that you should load your zip to the URL &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/mod_foo_101.zip&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;. Now you can update your module via the Joomla Updater.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Commercial Modules === &amp;lt;!--T:196--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:197--&amp;gt; Note that in our files we have linked to the extensions updates xml file. And from that xml file we have a location for the zip of the module. This means that if someone was to track this backwards they could find the physical source of your modules zip file. If you don&#039;t do like this, you can find a solution in this PRː https://github.com/joomla/joomla-cms/pull/15185 .&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Conclusion === &amp;lt;!--T:198--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:199--&amp;gt; With the Joomla updater, you can easily reach all users and tell them that there is a new version. Even the update itself is easy.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:200--&amp;gt; Each extension should use an update server. Especially for security reasons.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:201--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/plugins/system&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:202--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Beginner Development{{#translation:}}]]&lt;br /&gt;
[[Category:Tutorials{{#translation:}}]]&lt;br /&gt;
[[Category:Tutorials in a Series{{#translation:}}]]&lt;br /&gt;
[[Category:Development{{#translation:}}]]&lt;br /&gt;
[[Category:Module Development{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla! 4.x{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla! 4.0{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Creating_a_Simple_Module&amp;diff=615707</id>
		<title>J4.x:Creating a Simple Module</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Creating_a_Simple_Module&amp;diff=615707"/>
		<updated>2019-06-21T06:59:50Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Changed to point to modules rather than plugin boilerplate&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=4.x|comment=&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt; Tutorial&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{Top portal heading|color=white-bkgd|icon=file-code-o|icon-color=#5091cd|size=5x|text-color=#333|title=&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt; Creating a Simple Module for Joomla 4.x&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{-}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt; This is a tutorial on how to Create a simple module for Joomla Version 4x.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Introduction == &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt; Joomlaǃ 4 provides five types of extensionsː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Component|&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt; Components&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt; A component is the main part of the site. A component handles data manipulation as well as input and storage into the database. A component on most sites is the primary focus of the page.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Module|&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt; Modules&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039; &amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt; A module is an add-on to the site that extends the functionality. A module usually occupies a secondary portion of the web page and is not considered the primary focus of a page. It can be displayed on different positions and you can choose on which active menu items it should be displayed. Modules are lightweight and flexible extensions. They are used for small bits of the page that are generally less complex and are able to be seen across different components.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Plugin|&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt; Plugins&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt; A Plugin manipulates output that is already generated by the system. It typically does not run as separate part of the site. It takes data from other sources (i.e. the content) and manipulates this data before displaying. A plugin typically work behind the scenes.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Languages|&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt; Languages&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;Probably the most basic extensions are languages. In essence the language package files consist of key/value pairs, which provide the translation of static text strings, assigned within the Joomla! source code. &lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Templates|&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt; Templates&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt; A template is basically the design of your Joomla! powered website.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt; Joomla! 4 is constructed using five different applications:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
* Installation (used for installing Joomla and have to delete after installation)&lt;br /&gt;
* Administrator (backend - used for managing content)&lt;br /&gt;
* Public or site (frontend - used for displaying content)&lt;br /&gt;
* CLI (used for accessing Joomla on the command line and for cron jobs)&lt;br /&gt;
* API (web services - used for creating APIs for machine accessible content)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The installation application is used once. The administrator and public are used through the concept of &#039;&#039;components&#039;&#039; with &#039;&#039;modules&#039;&#039;. Each module has a single entry point located in the &#039;&#039;modules&#039;&#039; and accordingly &#039;&#039;administrator/modules&#039;&#039;  directory. This entry point is called &amp;lt;tt&amp;gt;&#039;&#039;mod_modulename/mod_modulename.php&#039;&#039;&amp;lt;/tt&amp;gt; (the &#039;&#039;mod_&#039;&#039; prefix is a historical trace). The entry point for the login module is for &#039;&#039;example /mod_login/mod_login.php&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt; You can download Joomla! 4 at [https://github.com/joomla/joomla-cms/tree/4.0-dev GitHub], on the [https://developer.joomla.org/nightly-builds.html Developer website] or you can create a free website at https://launch.joomla.org.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Creating a simple module/Developing a Basic Module - Part 1 == &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt; You can see many examples of modules in the standard Joomla! install. For example:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* Menus &lt;br /&gt;
* Latest News&lt;br /&gt;
* Login form&lt;br /&gt;
* and many more.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt; This tutorial will explain how to create a simple module. Through this tutorial you will learn the basic file structure of a Joomlaǃ 4 module. This basic structure can then be expanded to produce more elaborate modules.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt; There are a few basic files that are used in the standard pattern of module development:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt; * &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; - This file is the main entry point for the module. It will perform any necessary initialization routines, call helper routines to collect any necessary data, and include the template which will display the module output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt; * &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - This file contains information about the module. It defines the files that need to be installed by the Joomla! installer and specifies configuration parameters for the module.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt; * &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; - This is the module template. This file will take the data collected by mod_foo.php and generate the HTML to be displayed on the page.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt; * &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.ini&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.sys.ini&amp;lt;/tt&amp;gt;- This are the files that provide the text in United Kingdom English.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating mod_foo.php === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:32--&amp;gt; The &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file will perform following tasks:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:33--&amp;gt; * Import the class &amp;lt;tt&amp;gt;ModuleHelper&amp;lt;/tt&amp;gt; to the current scope. We need it later for displaying the output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:34--&amp;gt; * Include the template to display the output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:35--&amp;gt; The helper class is imported to our current scope at the begin of the file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;use Joomla\CMS\Helper\ModuleHelper;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:36--&amp;gt; Last we include the template to display the output via&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;require ModuleHelper::getLayoutPath(&#039;mod_foo&#039;, $params-&amp;gt;get(&#039;layout&#039;, &#039;default&#039;));&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.php file ==== &amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:38--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Helper\ModuleHelper;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
require ModuleHelper::getLayoutPath(&#039;mod_foo&#039;, $params-&amp;gt;get(&#039;layout&#039;, &#039;default&#039;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:39--&amp;gt; &#039;&#039;Side note&#039;&#039;ː In Joomla 3x you usually used a line like &amp;lt;tt&amp;gt;$moduleclass_sfx = htmlspecialchars($params-&amp;gt;get(&#039;moduleclass_sfx&#039;));&amp;lt;/tt&amp;gt;. You don&#039;t need this anymore. See this PRː https://github.com/joomla/joomla-cms/pull/17447.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:40--&amp;gt; The one line that we haven’t explained so far is the first line &amp;lt;tt&amp;gt;defined(&#039;_JEXEC&#039;) or die;&amp;lt;/tt&amp;gt;. This line checks to make sure that this file is being included from the Joomla application. This is necessary to prevent variable injection and other potential security concerns.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating tmpl/default.php === &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:42--&amp;gt; The &amp;lt;tt&amp;gt;default.php&amp;lt;/tt&amp;gt; file is the template which displays the module output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed tmpl/default.php file ==== &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:44--&amp;gt; The code for the tmpl/default.php file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
echo &#039;[PROJECT_NAME]&#039;; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:45--&amp;gt; An important point to note is that the template file has the same scope as the &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file. It means that a variable can be defined in the &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file and then used in the template file without any extra declarations or function calls.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating mod_foo.xml === &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:47--&amp;gt; The &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is the installation file. Most entries are self-explanatory.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml file ==== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:49--&amp;gt; The code for the &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt;  file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;3.8&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating the language files === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:51--&amp;gt; The files &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod̠foo.ini&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod̠foo.sys.ini&amp;lt;/tt&amp;gt; are used to translate text in the frontend and in the backend.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:52--&amp;gt; The code for &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod̠foo.sys.ini&amp;lt;/tt&amp;gt; is as follows:&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;
&lt;br /&gt;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:53--&amp;gt; The &amp;lt;tt&amp;gt;.sys.ini&amp;lt;/tt&amp;gt; file is used to translate the description of the extension upon installation, where as the &amp;lt;tt&amp;gt;.ini&amp;lt;/tt&amp;gt; file is used to translate the remaining strings and the description when viewing your extension.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:54--&amp;gt; More information about language files can be found [[S:MyLanguage/Specification_of_language_files|here]].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:56--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;br /&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:57--&amp;gt; After that you can choose your module in the module manager, when you create a new site module.&amp;lt;/translate&amp;gt; &lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial1-&amp;lt;translate&amp;gt;&amp;lt;!--T:58--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial2-&amp;lt;translate&amp;gt;&amp;lt;!--T:59--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:60--&amp;gt; In the frontend, you will see your module like displayed in the next image.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial3-&amp;lt;translate&amp;gt;&amp;lt;!--T:61--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:63--&amp;gt; Module development for Joomla is a fairly simple, straightforward process. Using the techniques described in this tutorial, an endless variety of modules can be developed with little hassle.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:64--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/module&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:65--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add a helper class using namespaces - Part 2== &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:68--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Namespaces == &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:70--&amp;gt; With PHP 5.3, the namespaces came into their own. In other programming languages for a long time in use, these small structures now also help us with the clarity of our code.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:71--&amp;gt; Namespaces are separate areas in which certain logical things (in our case, classes, interfaces, functions, and constants) can live. These areas provide ncapsulation of the code and prevent name conflicts.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:72--&amp;gt; Let&#039;s take a look how to use them in Joomla 4. We use the helper file for this.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:74--&amp;gt; We will create/change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Helper/FooHelper.php&amp;lt;/code&amp;gt; - This is the file we use here as an example. We have to create it.&lt;br /&gt;
* &amp;lt;code&amp;gt;mod_foo.php&amp;lt;/code&amp;gt; - In this file we will mainly load the namespace.&lt;br /&gt;
* &amp;lt;code&amp;gt;tmpl/default.php&amp;lt;/code&amp;gt; - In this file demonstrate how the data of a helper can be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;mod_foo.xml&amp;lt;/code&amp;gt; - We create a new directory with a new file. This must be installed during the installation. For this we have to specify them in this file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating Helper/FooHelper.php === &amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:77--&amp;gt; Our new helper class should belong to a namespace. We achieve this with the following code. It is important, that this line is at the beginning of the file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;namespace Joomla\Module\Foo\Site\Helper;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:78--&amp;gt; Then we create a simple class with a simple method. Of course you can do a lot more here. Take a look at the Joomla core methods. Here are many examples. They show you first-hand what options you have.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed Helper/FooHelper.php ==== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:80--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Site&lt;br /&gt;
 * @subpackage  mod_foo&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
namespace Joomla\Module\Foo\Site\Helper;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Helper for mod_foo&lt;br /&gt;
 *&lt;br /&gt;
 * @since  4.0&lt;br /&gt;
 */&lt;br /&gt;
class FooHelper&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Retrieve foo test&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   Registry        $params  The module parameters&lt;br /&gt;
	 * @param   CMSApplication  $app     The application&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  array&lt;br /&gt;
	 */&lt;br /&gt;
	public static function getText()&lt;br /&gt;
	{&lt;br /&gt;
		return &#039;FooHelpertest&#039;;&lt;br /&gt;
	}&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;&lt;br /&gt;
&lt;br /&gt;
=== Editing mod_foo.php === &amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:82--&amp;gt; Our new helper class is imported to our current scope at the begin of the file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;use Joomla\Module\Foo\Site\Helper\FooHelper;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:83--&amp;gt; Last use the helper file for testing if it is loaded correctlyː&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$test  = FooHelper::getText($params, $app);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.php file ==== &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:85--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Helper\ModuleHelper;&lt;br /&gt;
use Joomla\Module\Foo\Site\Helper\FooHelper;&lt;br /&gt;
&lt;br /&gt;
$test  = FooHelper::getText();&lt;br /&gt;
&lt;br /&gt;
require ModuleHelper::getLayoutPath(&#039;mod_foo&#039;, $params-&amp;gt;get(&#039;layout&#039;, &#039;default&#039;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing tmpl/default.php === &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:87--&amp;gt; In this file you make only a small change to demonstrate in the frontend that your helper file is working properly. You only add the value of the variable at the end of the current output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed tmpl/default.php ==== &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:89--&amp;gt; The complete &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing mod_foo.xml === &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:91--&amp;gt; First you have to add a line, so that the namespace is set automatically in Joomla. After this change, you have to re-install your module. A simple change in an already installed module is not enough. If you are doing local development you can also delete the files libraries/autoload_psr4.php and it will automatically be re-created. After inserting and installing, the namespace is known by the loader &amp;lt;tt&amp;gt;JPATH_LIBRARIES . &#039;/autoload_psr4.php&#039;&amp;lt;/tt&amp;gt;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:92--&amp;gt; Joomla! should copy your helper file when installing the module. So Joomla! needs to know your helper file. For this, you need to add the following line to your XML file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:94--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;3.8&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:96--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:97--&amp;gt; After that you can choose your module in the module manager, when you create a new site module.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:98--&amp;gt; In the frontend you will see your module like displayed in the next image. The text form your helper file is displayed.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial23-&amp;lt;translate&amp;gt;&amp;lt;!--T:99--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:101--&amp;gt; As you can see, once you get a bit into the namespaces, they are not that complicated anymore. In big projects they can bring a lot of benefits. However, we should plan namespaces, as otherwise it will soon be more time-consuming.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:102--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/module&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:103--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Customizationː Add parameters via form fields - Part 3 == &amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:106--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Customization with form fields and parameters == &amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:108--&amp;gt; Form fields give a great deal of customization in Joomla and for modules are the sole way of allowing the user to tweak the module to the needs of their site.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:109--&amp;gt; In this case we are going to extend our previous example using a url field for inserting a domain that we can use as link in the front end. To allow this to happen we will use the [[S:MyLanguage/URL_form_field_type|URL Form Field]] type.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:110--&amp;gt; After that, we insert parameters that allow to use standard functionality of Joomla.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:111--&amp;gt; Let&#039;s take a look on how to use them in Joomla 4.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:113--&amp;gt; We will change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - This is the file where we add the fields.&lt;br /&gt;
* &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; - In this file demonstrate how the data of a field can be used.&lt;br /&gt;
* &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.ini&amp;lt;/tt&amp;gt; - Here we use a language string so that the field can be labeled correctly in different languages.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing mod_foo.xml === &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:116--&amp;gt; First we set a custom parameter.&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;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
    type=&amp;quot;url&amp;quot;&lt;br /&gt;
    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:117--&amp;gt; Then we insert Joomla default fields, so that we can use cache, moduleclass-suffix and layouts.&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;field&lt;br /&gt;
    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
    type=&amp;quot;list&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
    default=&amp;quot;0&amp;quot;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
    type=&amp;quot;number&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
    default=&amp;quot;0&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:119--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;3.8&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
    &amp;lt;config&amp;gt;&lt;br /&gt;
        &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
                    type=&amp;quot;url&amp;quot;&lt;br /&gt;
                    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
                    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;advanced&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
                    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
                    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
                    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
                    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
                    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
                    type=&amp;quot;list&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
                    type=&amp;quot;number&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
                    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
                    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
        &amp;lt;/fields&amp;gt;&lt;br /&gt;
    &amp;lt;/config&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing tmpl/default.php === &amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:121--&amp;gt; We can use the value of the parameter for creating an hyperlink in the frontend. We can access the value via the variable via the variable $params.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$domain = $params-&amp;gt;get(&#039;domain&#039;, &#039;https://www.joomla.org&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:122--&amp;gt; Later we set use this value for creating the hyperlink.&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;
&amp;lt;a href=&amp;quot;&amp;lt;?php echo $domain; ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test; ?&amp;gt;&lt;br /&gt;
&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed tmpl/default.php file ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:124--&amp;gt; The complete &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
$domain = $params-&amp;gt;get(&#039;domain&#039;, &#039;https://www.joomla.org&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;a href=&amp;quot;&amp;lt;?php echo $domain; ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test; ?&amp;gt;&lt;br /&gt;
&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing language/en-GB/en-GB.mod_foo.ini === &amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:126--&amp;gt; Here we can specify the text for the English version of the field label.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;MOD_FOO_FIELD_URL_LABEL=&amp;quot;Url&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed language/en-GB/en-GB.mod_foo.ini ==== &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:128--&amp;gt; The complete &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.ini&amp;lt;/tt&amp;gt; file 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;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
MOD_FOO_FIELD_URL_LABEL=&amp;quot;Url&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:130--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:131--&amp;gt; After that you can choose your module in the module manager, when you create a new site module.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:132--&amp;gt; In the backend, you will see your module like displayed in the next image.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:133--&amp;gt; In the basic tab, you will see the custom field where you can insert a domain. The text for the label is fetched from the language file.&amp;lt;/translate&amp;gt; &lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial31-&amp;lt;translate&amp;gt;&amp;lt;!--T:134--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:135--&amp;gt; In the advanced tab, you will see all default options except the cache mode because of this is a hidden field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial32-&amp;lt;translate&amp;gt;&amp;lt;!--T:136--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:137--&amp;gt; In the frontend, you will see your module like displayed in the next image. The text form your helper file is displayed and you should see a hyperlink.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial33-&amp;lt;translate&amp;gt;&amp;lt;!--T:138--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:140--&amp;gt; Form fields give the user an easy way to customize the module to their sites settings. This allows the modules scope to be increased.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:141--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/plugins/system&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:142--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:143--&amp;gt; See this issue for possible future changes:&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla/joomla-cms/pull/23553&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use Install, Update and Uninstall script - Part 4 == &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:146--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Scripts === &amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:148--&amp;gt; Installing, updating and uninstalling a module may require additional operations that cannot be achieved by the basic operations described in the main XML file. Joomla offers a new approach to solve this problem. It consists in using a PHP script file containing a class using five methods:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:149--&amp;gt;&lt;br /&gt;
* preflight which is executed before install and update&lt;br /&gt;
* install&lt;br /&gt;
* update&lt;br /&gt;
* uninstall&lt;br /&gt;
* postflight which is executed after install and update&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:150--&amp;gt; Let&#039;s take a look how to use them in Joomla 4. We use the helper file for this.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:151--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:152--&amp;gt; We will create/change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:153--&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;script.php&amp;lt;/tt&amp;gt; - This is the file we use here as an example. We have to create it.&lt;br /&gt;
* &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.sys.ini&amp;lt;/tt&amp;gt; - In this file we will add text.&lt;br /&gt;
* &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - We create a new file. This must be installed during the installation. For this we have to specify it in this file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating script.php === &amp;lt;!--T:154--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:155--&amp;gt; Writing an extension script consists in declaring a class whose name is &amp;lt;tt&amp;gt;mod_ModuleNameInstallerScripʈ&amp;lt;/tt&amp;gt; with these 5 methods. See the comments in the file for more information. In this comments I explain when a method is called.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:156--&amp;gt; In this example, I only use text to show when which method will be executed. In addition, I show you how to check the minimum requirements. Of course you can do much more. For example, you can delete files that are no longer needed in a new version of your module. This can be seen in the file. Another idea for this file is to create sample content, to show a success message with the current installed version number or you can redirect after a successful installation to the page with the module settings.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed script.php ==== &amp;lt;!--T:157--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:158--&amp;gt; The complete &amp;lt;tt&amp;gt;script.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Language\Text;&lt;br /&gt;
use Joomla\CMS\Log\Log;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Script file of Foo module&lt;br /&gt;
 */&lt;br /&gt;
class mod_fooInstallerScript {&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Extension script constructor.&lt;br /&gt;
     *&lt;br /&gt;
     * @return  void&lt;br /&gt;
     */&lt;br /&gt;
    public function __construct() {&lt;br /&gt;
        $this-&amp;gt;minimumJoomla = &#039;4.0&#039;;&lt;br /&gt;
        $this-&amp;gt;minimumPhp = JOOMLA_MINIMUM_PHP;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Method to install the extension&lt;br /&gt;
     *&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function install($parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_UNINSTALL&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Method to uninstall the extension&lt;br /&gt;
     *&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function uninstall($parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_UNINSTALL&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Method to update the extension&lt;br /&gt;
     *&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function update($parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_UPDATE&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Function called before extension installation/update/removal procedure commences&lt;br /&gt;
     *&lt;br /&gt;
     * @param   string            $type    The type of change (install, update or discover_install, not uninstall)&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function preflight($type, $parent) {&lt;br /&gt;
        // Check for the minimum PHP version before continuing&lt;br /&gt;
        if (!empty($this-&amp;gt;minimumPhp) &amp;amp;&amp;amp; version_compare(PHP_VERSION, $this-&amp;gt;minimumPhp, &#039;&amp;lt;&#039;)) {&lt;br /&gt;
            Log::add(Text::sprintf(&#039;JLIB_INSTALLER_MINIMUM_PHP&#039;, $this-&amp;gt;minimumPhp), Log::WARNING, &#039;jerror&#039;);&lt;br /&gt;
&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Check for the minimum Joomla version before continuing&lt;br /&gt;
        if (!empty($this-&amp;gt;minimumJoomla) &amp;amp;&amp;amp; version_compare(JVERSION, $this-&amp;gt;minimumJoomla, &#039;&amp;lt;&#039;)) {&lt;br /&gt;
            Log::add(Text::sprintf(&#039;JLIB_INSTALLER_MINIMUM_JOOMLA&#039;, $this-&amp;gt;minimumJoomla), Log::WARNING, &#039;jerror&#039;);&lt;br /&gt;
&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_PREFLIGHT&#039;);&lt;br /&gt;
        echo $this-&amp;gt;minimumJoomla . &#039; &#039; . $this-&amp;gt;minimumPhp;&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Function called after extension installation/update/removal procedure commences&lt;br /&gt;
     *&lt;br /&gt;
     * @param   string            $type    The type of change (install, update or discover_install, not uninstall)&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function postflight($type, $parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_POSTFLIGHT&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&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;&lt;br /&gt;
=== Editing language/en-GB/en-GB.mod_foo.sys.ini === &amp;lt;!--T:159--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:160--&amp;gt; There is not much to explain here. Write the text for the translation into this file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed language/en-GB/en-GB.mod_foo.sys.ini file ==== &amp;lt;!--T:161--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:162--&amp;gt; The complete &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.sys.ini&amp;lt;/tt&amp;gt; file 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;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_PREFLIGHT=&amp;quot;&amp;lt;p&amp;gt;Anything here happens before the installation/update/uninstallation of the module&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_UPDATE=&amp;quot;&amp;lt;p&amp;gt;The module has been updated&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_UNINSTALL=&amp;quot;&amp;lt;p&amp;gt;The module has been uninstalled&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_INSTALL=&amp;quot;&amp;lt;p&amp;gt;The module has been installed&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_POSTFLIGHT=&amp;quot;&amp;lt;p&amp;gt;Anything here happens after the installation/update/uninstallation of the module&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing mod_foo.xml === &amp;lt;!--T:163--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:164--&amp;gt; You have to add a line, so that the script is called automatically in Joomla.&amp;lt;/translate&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;scriptfile&amp;gt;script.php&amp;lt;/scriptfile&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:165--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:166--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;4.0&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;scriptfile&amp;gt;script.php&amp;lt;/scriptfile&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
    &amp;lt;config&amp;gt;&lt;br /&gt;
        &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
                    type=&amp;quot;url&amp;quot;&lt;br /&gt;
                    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
                    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;advanced&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
                    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
                    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
                    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
                    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
                    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
                    type=&amp;quot;list&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
                    type=&amp;quot;number&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
                    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
                    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
        &amp;lt;/fields&amp;gt;&lt;br /&gt;
    &amp;lt;/config&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:167--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:168--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:169--&amp;gt; Immediately after the installation, you will see the following information. This you had entered in the script so.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial14-&amp;lt;translate&amp;gt;&amp;lt;!--T:170--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:171--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:172--&amp;gt; As you can see, Joomla offers you a lot to make your extension easy to use - right from the start.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:173--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/plugins/system&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:174--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use Joomla Updaterː Adding Auto Update - Part 5 == &amp;lt;!--T:175--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:176--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:177--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Joomla Updater === &amp;lt;!--T:178--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:179--&amp;gt; The first thing to do is to read the [[S:MyLanguage/J2.5:Managing_Component_Updates|Managing Component Upgrades with Joomla 2.5 - Part 1]] tutorial to give an idea of how the upgrade process works in Joomla. Whilst written for 2.5 the process hasn&#039;t changed. Also read [[S:MyLanguage/Deploying_an_Update_Server|Deploying an update server]] - this is what we&#039;ll be implementing in this tutorial.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:180--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:181--&amp;gt; We will create/change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:182--&amp;gt; * &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - The only way to update our existing module is to add in a update server - for example &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/foo_update.xmɭ&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; - into the xml file.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:183--&amp;gt; * &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt; - Then we have to create the XML file for the update server at &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/foo_update.xmɭ&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; to let Joomla know an update is available.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Editing mod_foo.xml ==== &amp;lt;!--T:184--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:185--&amp;gt; To add our update server, we need to insert the following lines in your XML-File&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&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;[PROJECT_NAME]&amp;quot;&amp;gt;https://www.example.com/mod_foo.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
&amp;lt;/updateservers&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:186--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:187--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;4.0&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&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;[PROJECT_NAME]&amp;quot;&amp;gt;https://www.example.com/mod_foo.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
    &amp;lt;/updateservers&amp;gt;&lt;br /&gt;
    &amp;lt;config&amp;gt;&lt;br /&gt;
        &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
                    type=&amp;quot;url&amp;quot;&lt;br /&gt;
                    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
                    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;advanced&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
                    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
                    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
                    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
                    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
                    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
                    type=&amp;quot;list&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
                    type=&amp;quot;number&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
                    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
                    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
        &amp;lt;/fields&amp;gt;&lt;br /&gt;
    &amp;lt;/config&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:188--&amp;gt; So now that Joomla is searching for updates to our extension - let&#039;s create one to test out our process. But first we need to create the file &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt;. So far we have only described the update server. We do not know yet if there is an update. In the file &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt; we indicate when a new version is published and where it can be downloaded.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating foo_update.xml === &amp;lt;!--T:189--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:190--&amp;gt; Now we have to create the XML file at &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/foo_update.xml&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; to let Joomla know an update is available.&amp;lt;/translate&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed foo_update.xml ==== &amp;lt;!--T:191--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:192--&amp;gt; The complete &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;updates&amp;gt;&lt;br /&gt;
    &amp;lt;update&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;Foo&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;This is mod_foo 1.0.1&amp;lt;/description&amp;gt;&lt;br /&gt;
        &amp;lt;element&amp;gt;mod_foo&amp;lt;/element&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;module&amp;lt;/type&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;1.0.1&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;downloads&amp;gt;&lt;br /&gt;
            &amp;lt;downloadurl type=&amp;quot;full&amp;quot; format=&amp;quot;zip&amp;quot;&amp;gt;http://www.example.com/mod_foo_101.zip&amp;lt;/downloadurl&amp;gt;&lt;br /&gt;
        &amp;lt;/downloads&amp;gt;&lt;br /&gt;
        &amp;lt;maintainer&amp;gt;Joomla&amp;lt;/maintainer&amp;gt;&lt;br /&gt;
        &amp;lt;maintainerurl&amp;gt;http://www.example.com&amp;lt;/maintainerurl&amp;gt;&lt;br /&gt;
        &amp;lt;targetplatform name=&amp;quot;joomla&amp;quot; version=&amp;quot;4.0&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;client&amp;gt;site&amp;lt;/client&amp;gt;&lt;br /&gt;
    &amp;lt;/update&amp;gt;&lt;br /&gt;
&amp;lt;/updates&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:193--&amp;gt; After uploading this file to the address &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;https://www.example.com/mod_foo.xml&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; the update will be displayed in the Joomla backend.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Test your module update === &amp;lt;!--T:194--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:195--&amp;gt; Create a copy of the module as it is now. Then let&#039;s update the version number to 1.0.1. Now you can zip all files. After that you should load your zip to the URL &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/mod_foo_101.zip&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;. Now you can update your module via the Joomla Updater.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Commercial Modules === &amp;lt;!--T:196--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:197--&amp;gt; Note that in our files we have linked to the extensions updates xml file. And from that xml file we have a location for the zip of the module. This means that if someone was to track this backwards they could find the physical source of your modules zip file. If you don&#039;t do like this, you can find a solution in this PRː https://github.com/joomla/joomla-cms/pull/15185 .&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Conclusion === &amp;lt;!--T:198--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:199--&amp;gt; With the Joomla updater, you can easily reach all users and tell them that there is a new version. Even the update itself is easy.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:200--&amp;gt; Each extension should use an update server. Especially for security reasons.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:201--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/plugins/system&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:202--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Beginner Development{{#translation:}}]]&lt;br /&gt;
[[Category:Tutorials{{#translation:}}]]&lt;br /&gt;
[[Category:Tutorials in a Series{{#translation:}}]]&lt;br /&gt;
[[Category:Development{{#translation:}}]]&lt;br /&gt;
[[Category:Module Development{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla! 4.x{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla! 4.0{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Creating_a_Simple_Module&amp;diff=615706</id>
		<title>J4.x:Creating a Simple Module</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Creating_a_Simple_Module&amp;diff=615706"/>
		<updated>2019-06-21T06:58:02Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Change mod_breadcrumbs to mod_foo in comment&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=4.x|comment=&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt; Tutorial&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{Top portal heading|color=white-bkgd|icon=file-code-o|icon-color=#5091cd|size=5x|text-color=#333|title=&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt; Creating a Simple Module for Joomla 4.x&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{-}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt; This is a tutorial on how to Create a simple module for Joomla Version 4x.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Introduction == &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt; Joomlaǃ 4 provides five types of extensionsː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Component|&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt; Components&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt; A component is the main part of the site. A component handles data manipulation as well as input and storage into the database. A component on most sites is the primary focus of the page.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Module|&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt; Modules&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039; &amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt; A module is an add-on to the site that extends the functionality. A module usually occupies a secondary portion of the web page and is not considered the primary focus of a page. It can be displayed on different positions and you can choose on which active menu items it should be displayed. Modules are lightweight and flexible extensions. They are used for small bits of the page that are generally less complex and are able to be seen across different components.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Plugin|&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt; Plugins&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt; A Plugin manipulates output that is already generated by the system. It typically does not run as separate part of the site. It takes data from other sources (i.e. the content) and manipulates this data before displaying. A plugin typically work behind the scenes.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Languages|&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt; Languages&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;Probably the most basic extensions are languages. In essence the language package files consist of key/value pairs, which provide the translation of static text strings, assigned within the Joomla! source code. &lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Templates|&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt; Templates&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt; A template is basically the design of your Joomla! powered website.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt; Joomla! 4 is constructed using five different applications:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
* Installation (used for installing Joomla and have to delete after installation)&lt;br /&gt;
* Administrator (backend - used for managing content)&lt;br /&gt;
* Public or site (frontend - used for displaying content)&lt;br /&gt;
* CLI (used for accessing Joomla on the command line and for cron jobs)&lt;br /&gt;
* API (web services - used for creating APIs for machine accessible content)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The installation application is used once. The administrator and public are used through the concept of &#039;&#039;components&#039;&#039; with &#039;&#039;modules&#039;&#039;. Each module has a single entry point located in the &#039;&#039;modules&#039;&#039; and accordingly &#039;&#039;administrator/modules&#039;&#039;  directory. This entry point is called &amp;lt;tt&amp;gt;&#039;&#039;mod_modulename/mod_modulename.php&#039;&#039;&amp;lt;/tt&amp;gt; (the &#039;&#039;mod_&#039;&#039; prefix is a historical trace). The entry point for the login module is for &#039;&#039;example /mod_login/mod_login.php&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt; You can download Joomla! 4 at [https://github.com/joomla/joomla-cms/tree/4.0-dev GitHub], on the [https://developer.joomla.org/nightly-builds.html Developer website] or you can create a free website at https://launch.joomla.org.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Creating a simple module/Developing a Basic Module - Part 1 == &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt; You can see many examples of modules in the standard Joomla! install. For example:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* Menus &lt;br /&gt;
* Latest News&lt;br /&gt;
* Login form&lt;br /&gt;
* and many more.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt; This tutorial will explain how to create a simple module. Through this tutorial you will learn the basic file structure of a Joomlaǃ 4 module. This basic structure can then be expanded to produce more elaborate modules.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt; There are a few basic files that are used in the standard pattern of module development:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt; * &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; - This file is the main entry point for the module. It will perform any necessary initialization routines, call helper routines to collect any necessary data, and include the template which will display the module output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt; * &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - This file contains information about the module. It defines the files that need to be installed by the Joomla! installer and specifies configuration parameters for the module.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt; * &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; - This is the module template. This file will take the data collected by mod_foo.php and generate the HTML to be displayed on the page.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt; * &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.ini&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.sys.ini&amp;lt;/tt&amp;gt;- This are the files that provide the text in United Kingdom English.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating mod_foo.php === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:32--&amp;gt; The &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file will perform following tasks:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:33--&amp;gt; * Import the class &amp;lt;tt&amp;gt;ModuleHelper&amp;lt;/tt&amp;gt; to the current scope. We need it later for displaying the output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:34--&amp;gt; * Include the template to display the output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:35--&amp;gt; The helper class is imported to our current scope at the begin of the file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;use Joomla\CMS\Helper\ModuleHelper;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:36--&amp;gt; Last we include the template to display the output via&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;require ModuleHelper::getLayoutPath(&#039;mod_foo&#039;, $params-&amp;gt;get(&#039;layout&#039;, &#039;default&#039;));&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.php file ==== &amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:38--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Helper\ModuleHelper;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
require ModuleHelper::getLayoutPath(&#039;mod_foo&#039;, $params-&amp;gt;get(&#039;layout&#039;, &#039;default&#039;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:39--&amp;gt; &#039;&#039;Side note&#039;&#039;ː In Joomla 3x you usually used a line like &amp;lt;tt&amp;gt;$moduleclass_sfx = htmlspecialchars($params-&amp;gt;get(&#039;moduleclass_sfx&#039;));&amp;lt;/tt&amp;gt;. You don&#039;t need this anymore. See this PRː https://github.com/joomla/joomla-cms/pull/17447.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:40--&amp;gt; The one line that we haven’t explained so far is the first line &amp;lt;tt&amp;gt;defined(&#039;_JEXEC&#039;) or die;&amp;lt;/tt&amp;gt;. This line checks to make sure that this file is being included from the Joomla application. This is necessary to prevent variable injection and other potential security concerns.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating tmpl/default.php === &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:42--&amp;gt; The &amp;lt;tt&amp;gt;default.php&amp;lt;/tt&amp;gt; file is the template which displays the module output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed tmpl/default.php file ==== &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:44--&amp;gt; The code for the tmpl/default.php file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
echo &#039;[PROJECT_NAME]&#039;; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:45--&amp;gt; An important point to note is that the template file has the same scope as the &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file. It means that a variable can be defined in the &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file and then used in the template file without any extra declarations or function calls.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating mod_foo.xml === &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:47--&amp;gt; The &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is the installation file. Most entries are self-explanatory.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml file ==== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:49--&amp;gt; The code for the &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt;  file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;3.8&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating the language files === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:51--&amp;gt; The files &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod̠foo.ini&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod̠foo.sys.ini&amp;lt;/tt&amp;gt; are used to translate text in the frontend and in the backend.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:52--&amp;gt; The code for &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod̠foo.sys.ini&amp;lt;/tt&amp;gt; is as follows:&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;
&lt;br /&gt;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:53--&amp;gt; The &amp;lt;tt&amp;gt;.sys.ini&amp;lt;/tt&amp;gt; file is used to translate the description of the extension upon installation, where as the &amp;lt;tt&amp;gt;.ini&amp;lt;/tt&amp;gt; file is used to translate the remaining strings and the description when viewing your extension.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:54--&amp;gt; More information about language files can be found [[S:MyLanguage/Specification_of_language_files|here]].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:56--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;br /&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:57--&amp;gt; After that you can choose your module in the module manager, when you create a new site module.&amp;lt;/translate&amp;gt; &lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial1-&amp;lt;translate&amp;gt;&amp;lt;!--T:58--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial2-&amp;lt;translate&amp;gt;&amp;lt;!--T:59--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:60--&amp;gt; In the frontend, you will see your module like displayed in the next image.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial3-&amp;lt;translate&amp;gt;&amp;lt;!--T:61--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:63--&amp;gt; Module development for Joomla is a fairly simple, straightforward process. Using the techniques described in this tutorial, an endless variety of modules can be developed with little hassle.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:64--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/module&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:65--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add a helper class using namespaces - Part 2== &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:68--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Namespaces == &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:70--&amp;gt; With PHP 5.3, the namespaces came into their own. In other programming languages for a long time in use, these small structures now also help us with the clarity of our code.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:71--&amp;gt; Namespaces are separate areas in which certain logical things (in our case, classes, interfaces, functions, and constants) can live. These areas provide ncapsulation of the code and prevent name conflicts.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:72--&amp;gt; Let&#039;s take a look how to use them in Joomla 4. We use the helper file for this.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:74--&amp;gt; We will create/change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Helper/FooHelper.php&amp;lt;/code&amp;gt; - This is the file we use here as an example. We have to create it.&lt;br /&gt;
* &amp;lt;code&amp;gt;mod_foo.php&amp;lt;/code&amp;gt; - In this file we will mainly load the namespace.&lt;br /&gt;
* &amp;lt;code&amp;gt;tmpl/default.php&amp;lt;/code&amp;gt; - In this file demonstrate how the data of a helper can be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;mod_foo.xml&amp;lt;/code&amp;gt; - We create a new directory with a new file. This must be installed during the installation. For this we have to specify them in this file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating Helper/FooHelper.php === &amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:77--&amp;gt; Our new helper class should belong to a namespace. We achieve this with the following code. It is important, that this line is at the beginning of the file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;namespace Joomla\Module\Foo\Site\Helper;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:78--&amp;gt; Then we create a simple class with a simple method. Of course you can do a lot more here. Take a look at the Joomla core methods. Here are many examples. They show you first-hand what options you have.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed Helper/FooHelper.php ==== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:80--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Site&lt;br /&gt;
 * @subpackage  mod_foo&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
namespace Joomla\Module\Foo\Site\Helper;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Helper for mod_foo&lt;br /&gt;
 *&lt;br /&gt;
 * @since  4.0&lt;br /&gt;
 */&lt;br /&gt;
class FooHelper&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Retrieve foo test&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   Registry        $params  The module parameters&lt;br /&gt;
	 * @param   CMSApplication  $app     The application&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  array&lt;br /&gt;
	 */&lt;br /&gt;
	public static function getText()&lt;br /&gt;
	{&lt;br /&gt;
		return &#039;FooHelpertest&#039;;&lt;br /&gt;
	}&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;&lt;br /&gt;
&lt;br /&gt;
=== Editing mod_foo.php === &amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:82--&amp;gt; Our new helper class is imported to our current scope at the begin of the file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;use Joomla\Module\Foo\Site\Helper\FooHelper;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:83--&amp;gt; Last use the helper file for testing if it is loaded correctlyː&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$test  = FooHelper::getText($params, $app);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.php file ==== &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:85--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Helper\ModuleHelper;&lt;br /&gt;
use Joomla\Module\Foo\Site\Helper\FooHelper;&lt;br /&gt;
&lt;br /&gt;
$test  = FooHelper::getText();&lt;br /&gt;
&lt;br /&gt;
require ModuleHelper::getLayoutPath(&#039;mod_foo&#039;, $params-&amp;gt;get(&#039;layout&#039;, &#039;default&#039;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing tmpl/default.php === &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:87--&amp;gt; In this file you make only a small change to demonstrate in the frontend that your helper file is working properly. You only add the value of the variable at the end of the current output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed tmpl/default.php ==== &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:89--&amp;gt; The complete &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing mod_foo.xml === &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:91--&amp;gt; First you have to add a line, so that the namespace is set automatically in Joomla. After this change, you have to re-install your module. A simple change in an already installed module is not enough. If you are doing local development you can also delete the files libraries/autoload_psr4.php and it will automatically be re-created. After inserting and installing, the namespace is known by the loader &amp;lt;tt&amp;gt;JPATH_LIBRARIES . &#039;/autoload_psr4.php&#039;&amp;lt;/tt&amp;gt;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:92--&amp;gt; Joomla! should copy your helper file when installing the module. So Joomla! needs to know your helper file. For this, you need to add the following line to your XML file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:94--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;3.8&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:96--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:97--&amp;gt; After that you can choose your module in the module manager, when you create a new site module.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:98--&amp;gt; In the frontend you will see your module like displayed in the next image. The text form your helper file is displayed.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial23-&amp;lt;translate&amp;gt;&amp;lt;!--T:99--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:101--&amp;gt; As you can see, once you get a bit into the namespaces, they are not that complicated anymore. In big projects they can bring a lot of benefits. However, we should plan namespaces, as otherwise it will soon be more time-consuming.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:102--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/plugins/system&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:103--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Customizationː Add parameters via form fields - Part 3 == &amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:106--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Customization with form fields and parameters == &amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:108--&amp;gt; Form fields give a great deal of customization in Joomla and for modules are the sole way of allowing the user to tweak the module to the needs of their site.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:109--&amp;gt; In this case we are going to extend our previous example using a url field for inserting a domain that we can use as link in the front end. To allow this to happen we will use the [[S:MyLanguage/URL_form_field_type|URL Form Field]] type.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:110--&amp;gt; After that, we insert parameters that allow to use standard functionality of Joomla.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:111--&amp;gt; Let&#039;s take a look on how to use them in Joomla 4.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:113--&amp;gt; We will change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - This is the file where we add the fields.&lt;br /&gt;
* &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; - In this file demonstrate how the data of a field can be used.&lt;br /&gt;
* &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.ini&amp;lt;/tt&amp;gt; - Here we use a language string so that the field can be labeled correctly in different languages.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing mod_foo.xml === &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:116--&amp;gt; First we set a custom parameter.&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;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
    type=&amp;quot;url&amp;quot;&lt;br /&gt;
    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:117--&amp;gt; Then we insert Joomla default fields, so that we can use cache, moduleclass-suffix and layouts.&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;field&lt;br /&gt;
    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
    type=&amp;quot;list&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
    default=&amp;quot;0&amp;quot;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
    type=&amp;quot;number&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
    default=&amp;quot;0&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:119--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;3.8&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
    &amp;lt;config&amp;gt;&lt;br /&gt;
        &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
                    type=&amp;quot;url&amp;quot;&lt;br /&gt;
                    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
                    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;advanced&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
                    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
                    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
                    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
                    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
                    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
                    type=&amp;quot;list&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
                    type=&amp;quot;number&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
                    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
                    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
        &amp;lt;/fields&amp;gt;&lt;br /&gt;
    &amp;lt;/config&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing tmpl/default.php === &amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:121--&amp;gt; We can use the value of the parameter for creating an hyperlink in the frontend. We can access the value via the variable via the variable $params.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$domain = $params-&amp;gt;get(&#039;domain&#039;, &#039;https://www.joomla.org&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:122--&amp;gt; Later we set use this value for creating the hyperlink.&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;
&amp;lt;a href=&amp;quot;&amp;lt;?php echo $domain; ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test; ?&amp;gt;&lt;br /&gt;
&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed tmpl/default.php file ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:124--&amp;gt; The complete &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
$domain = $params-&amp;gt;get(&#039;domain&#039;, &#039;https://www.joomla.org&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;a href=&amp;quot;&amp;lt;?php echo $domain; ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test; ?&amp;gt;&lt;br /&gt;
&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing language/en-GB/en-GB.mod_foo.ini === &amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:126--&amp;gt; Here we can specify the text for the English version of the field label.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;MOD_FOO_FIELD_URL_LABEL=&amp;quot;Url&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed language/en-GB/en-GB.mod_foo.ini ==== &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:128--&amp;gt; The complete &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.ini&amp;lt;/tt&amp;gt; file 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;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
MOD_FOO_FIELD_URL_LABEL=&amp;quot;Url&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:130--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:131--&amp;gt; After that you can choose your module in the module manager, when you create a new site module.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:132--&amp;gt; In the backend, you will see your module like displayed in the next image.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:133--&amp;gt; In the basic tab, you will see the custom field where you can insert a domain. The text for the label is fetched from the language file.&amp;lt;/translate&amp;gt; &lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial31-&amp;lt;translate&amp;gt;&amp;lt;!--T:134--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:135--&amp;gt; In the advanced tab, you will see all default options except the cache mode because of this is a hidden field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial32-&amp;lt;translate&amp;gt;&amp;lt;!--T:136--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:137--&amp;gt; In the frontend, you will see your module like displayed in the next image. The text form your helper file is displayed and you should see a hyperlink.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial33-&amp;lt;translate&amp;gt;&amp;lt;!--T:138--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:140--&amp;gt; Form fields give the user an easy way to customize the module to their sites settings. This allows the modules scope to be increased.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:141--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/plugins/system&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:142--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:143--&amp;gt; See this issue for possible future changes:&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla/joomla-cms/pull/23553&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use Install, Update and Uninstall script - Part 4 == &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:146--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Scripts === &amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:148--&amp;gt; Installing, updating and uninstalling a module may require additional operations that cannot be achieved by the basic operations described in the main XML file. Joomla offers a new approach to solve this problem. It consists in using a PHP script file containing a class using five methods:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:149--&amp;gt;&lt;br /&gt;
* preflight which is executed before install and update&lt;br /&gt;
* install&lt;br /&gt;
* update&lt;br /&gt;
* uninstall&lt;br /&gt;
* postflight which is executed after install and update&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:150--&amp;gt; Let&#039;s take a look how to use them in Joomla 4. We use the helper file for this.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:151--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:152--&amp;gt; We will create/change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:153--&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;script.php&amp;lt;/tt&amp;gt; - This is the file we use here as an example. We have to create it.&lt;br /&gt;
* &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.sys.ini&amp;lt;/tt&amp;gt; - In this file we will add text.&lt;br /&gt;
* &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - We create a new file. This must be installed during the installation. For this we have to specify it in this file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating script.php === &amp;lt;!--T:154--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:155--&amp;gt; Writing an extension script consists in declaring a class whose name is &amp;lt;tt&amp;gt;mod_ModuleNameInstallerScripʈ&amp;lt;/tt&amp;gt; with these 5 methods. See the comments in the file for more information. In this comments I explain when a method is called.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:156--&amp;gt; In this example, I only use text to show when which method will be executed. In addition, I show you how to check the minimum requirements. Of course you can do much more. For example, you can delete files that are no longer needed in a new version of your module. This can be seen in the file. Another idea for this file is to create sample content, to show a success message with the current installed version number or you can redirect after a successful installation to the page with the module settings.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed script.php ==== &amp;lt;!--T:157--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:158--&amp;gt; The complete &amp;lt;tt&amp;gt;script.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Language\Text;&lt;br /&gt;
use Joomla\CMS\Log\Log;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Script file of Foo module&lt;br /&gt;
 */&lt;br /&gt;
class mod_fooInstallerScript {&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Extension script constructor.&lt;br /&gt;
     *&lt;br /&gt;
     * @return  void&lt;br /&gt;
     */&lt;br /&gt;
    public function __construct() {&lt;br /&gt;
        $this-&amp;gt;minimumJoomla = &#039;4.0&#039;;&lt;br /&gt;
        $this-&amp;gt;minimumPhp = JOOMLA_MINIMUM_PHP;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Method to install the extension&lt;br /&gt;
     *&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function install($parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_UNINSTALL&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Method to uninstall the extension&lt;br /&gt;
     *&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function uninstall($parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_UNINSTALL&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Method to update the extension&lt;br /&gt;
     *&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function update($parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_UPDATE&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Function called before extension installation/update/removal procedure commences&lt;br /&gt;
     *&lt;br /&gt;
     * @param   string            $type    The type of change (install, update or discover_install, not uninstall)&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function preflight($type, $parent) {&lt;br /&gt;
        // Check for the minimum PHP version before continuing&lt;br /&gt;
        if (!empty($this-&amp;gt;minimumPhp) &amp;amp;&amp;amp; version_compare(PHP_VERSION, $this-&amp;gt;minimumPhp, &#039;&amp;lt;&#039;)) {&lt;br /&gt;
            Log::add(Text::sprintf(&#039;JLIB_INSTALLER_MINIMUM_PHP&#039;, $this-&amp;gt;minimumPhp), Log::WARNING, &#039;jerror&#039;);&lt;br /&gt;
&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Check for the minimum Joomla version before continuing&lt;br /&gt;
        if (!empty($this-&amp;gt;minimumJoomla) &amp;amp;&amp;amp; version_compare(JVERSION, $this-&amp;gt;minimumJoomla, &#039;&amp;lt;&#039;)) {&lt;br /&gt;
            Log::add(Text::sprintf(&#039;JLIB_INSTALLER_MINIMUM_JOOMLA&#039;, $this-&amp;gt;minimumJoomla), Log::WARNING, &#039;jerror&#039;);&lt;br /&gt;
&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_PREFLIGHT&#039;);&lt;br /&gt;
        echo $this-&amp;gt;minimumJoomla . &#039; &#039; . $this-&amp;gt;minimumPhp;&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Function called after extension installation/update/removal procedure commences&lt;br /&gt;
     *&lt;br /&gt;
     * @param   string            $type    The type of change (install, update or discover_install, not uninstall)&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function postflight($type, $parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_POSTFLIGHT&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&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;&lt;br /&gt;
=== Editing language/en-GB/en-GB.mod_foo.sys.ini === &amp;lt;!--T:159--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:160--&amp;gt; There is not much to explain here. Write the text for the translation into this file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed language/en-GB/en-GB.mod_foo.sys.ini file ==== &amp;lt;!--T:161--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:162--&amp;gt; The complete &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.sys.ini&amp;lt;/tt&amp;gt; file 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;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_PREFLIGHT=&amp;quot;&amp;lt;p&amp;gt;Anything here happens before the installation/update/uninstallation of the module&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_UPDATE=&amp;quot;&amp;lt;p&amp;gt;The module has been updated&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_UNINSTALL=&amp;quot;&amp;lt;p&amp;gt;The module has been uninstalled&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_INSTALL=&amp;quot;&amp;lt;p&amp;gt;The module has been installed&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_POSTFLIGHT=&amp;quot;&amp;lt;p&amp;gt;Anything here happens after the installation/update/uninstallation of the module&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing mod_foo.xml === &amp;lt;!--T:163--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:164--&amp;gt; You have to add a line, so that the script is called automatically in Joomla.&amp;lt;/translate&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;scriptfile&amp;gt;script.php&amp;lt;/scriptfile&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:165--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:166--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;4.0&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;scriptfile&amp;gt;script.php&amp;lt;/scriptfile&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
    &amp;lt;config&amp;gt;&lt;br /&gt;
        &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
                    type=&amp;quot;url&amp;quot;&lt;br /&gt;
                    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
                    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;advanced&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
                    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
                    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
                    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
                    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
                    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
                    type=&amp;quot;list&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
                    type=&amp;quot;number&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
                    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
                    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
        &amp;lt;/fields&amp;gt;&lt;br /&gt;
    &amp;lt;/config&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:167--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:168--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:169--&amp;gt; Immediately after the installation, you will see the following information. This you had entered in the script so.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial14-&amp;lt;translate&amp;gt;&amp;lt;!--T:170--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:171--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:172--&amp;gt; As you can see, Joomla offers you a lot to make your extension easy to use - right from the start.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:173--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/plugins/system&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:174--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use Joomla Updaterː Adding Auto Update - Part 5 == &amp;lt;!--T:175--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:176--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:177--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Joomla Updater === &amp;lt;!--T:178--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:179--&amp;gt; The first thing to do is to read the [[S:MyLanguage/J2.5:Managing_Component_Updates|Managing Component Upgrades with Joomla 2.5 - Part 1]] tutorial to give an idea of how the upgrade process works in Joomla. Whilst written for 2.5 the process hasn&#039;t changed. Also read [[S:MyLanguage/Deploying_an_Update_Server|Deploying an update server]] - this is what we&#039;ll be implementing in this tutorial.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:180--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:181--&amp;gt; We will create/change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:182--&amp;gt; * &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - The only way to update our existing module is to add in a update server - for example &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/foo_update.xmɭ&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; - into the xml file.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:183--&amp;gt; * &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt; - Then we have to create the XML file for the update server at &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/foo_update.xmɭ&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; to let Joomla know an update is available.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Editing mod_foo.xml ==== &amp;lt;!--T:184--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:185--&amp;gt; To add our update server, we need to insert the following lines in your XML-File&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&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;[PROJECT_NAME]&amp;quot;&amp;gt;https://www.example.com/mod_foo.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
&amp;lt;/updateservers&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:186--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:187--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;4.0&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&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;[PROJECT_NAME]&amp;quot;&amp;gt;https://www.example.com/mod_foo.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
    &amp;lt;/updateservers&amp;gt;&lt;br /&gt;
    &amp;lt;config&amp;gt;&lt;br /&gt;
        &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
                    type=&amp;quot;url&amp;quot;&lt;br /&gt;
                    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
                    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;advanced&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
                    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
                    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
                    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
                    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
                    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
                    type=&amp;quot;list&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
                    type=&amp;quot;number&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
                    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
                    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
        &amp;lt;/fields&amp;gt;&lt;br /&gt;
    &amp;lt;/config&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:188--&amp;gt; So now that Joomla is searching for updates to our extension - let&#039;s create one to test out our process. But first we need to create the file &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt;. So far we have only described the update server. We do not know yet if there is an update. In the file &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt; we indicate when a new version is published and where it can be downloaded.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating foo_update.xml === &amp;lt;!--T:189--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:190--&amp;gt; Now we have to create the XML file at &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/foo_update.xml&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; to let Joomla know an update is available.&amp;lt;/translate&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed foo_update.xml ==== &amp;lt;!--T:191--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:192--&amp;gt; The complete &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;updates&amp;gt;&lt;br /&gt;
    &amp;lt;update&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;Foo&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;This is mod_foo 1.0.1&amp;lt;/description&amp;gt;&lt;br /&gt;
        &amp;lt;element&amp;gt;mod_foo&amp;lt;/element&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;module&amp;lt;/type&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;1.0.1&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;downloads&amp;gt;&lt;br /&gt;
            &amp;lt;downloadurl type=&amp;quot;full&amp;quot; format=&amp;quot;zip&amp;quot;&amp;gt;http://www.example.com/mod_foo_101.zip&amp;lt;/downloadurl&amp;gt;&lt;br /&gt;
        &amp;lt;/downloads&amp;gt;&lt;br /&gt;
        &amp;lt;maintainer&amp;gt;Joomla&amp;lt;/maintainer&amp;gt;&lt;br /&gt;
        &amp;lt;maintainerurl&amp;gt;http://www.example.com&amp;lt;/maintainerurl&amp;gt;&lt;br /&gt;
        &amp;lt;targetplatform name=&amp;quot;joomla&amp;quot; version=&amp;quot;4.0&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;client&amp;gt;site&amp;lt;/client&amp;gt;&lt;br /&gt;
    &amp;lt;/update&amp;gt;&lt;br /&gt;
&amp;lt;/updates&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:193--&amp;gt; After uploading this file to the address &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;https://www.example.com/mod_foo.xml&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; the update will be displayed in the Joomla backend.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Test your module update === &amp;lt;!--T:194--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:195--&amp;gt; Create a copy of the module as it is now. Then let&#039;s update the version number to 1.0.1. Now you can zip all files. After that you should load your zip to the URL &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/mod_foo_101.zip&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;. Now you can update your module via the Joomla Updater.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Commercial Modules === &amp;lt;!--T:196--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:197--&amp;gt; Note that in our files we have linked to the extensions updates xml file. And from that xml file we have a location for the zip of the module. This means that if someone was to track this backwards they could find the physical source of your modules zip file. If you don&#039;t do like this, you can find a solution in this PRː https://github.com/joomla/joomla-cms/pull/15185 .&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Conclusion === &amp;lt;!--T:198--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:199--&amp;gt; With the Joomla updater, you can easily reach all users and tell them that there is a new version. Even the update itself is easy.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:200--&amp;gt; Each extension should use an update server. Especially for security reasons.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:201--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/plugins/system&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:202--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Beginner Development{{#translation:}}]]&lt;br /&gt;
[[Category:Tutorials{{#translation:}}]]&lt;br /&gt;
[[Category:Tutorials in a Series{{#translation:}}]]&lt;br /&gt;
[[Category:Development{{#translation:}}]]&lt;br /&gt;
[[Category:Module Development{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla! 4.x{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla! 4.0{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Creating_a_Simple_Module&amp;diff=615705</id>
		<title>J4.x:Creating a Simple Module</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Creating_a_Simple_Module&amp;diff=615705"/>
		<updated>2019-06-21T06:55:55Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Changed to point to modules rather than plugin boilerplate&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=4.x|comment=&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt; Tutorial&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{Top portal heading|color=white-bkgd|icon=file-code-o|icon-color=#5091cd|size=5x|text-color=#333|title=&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt; Creating a Simple Module for Joomla 4.x&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{-}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt; This is a tutorial on how to Create a simple module for Joomla Version 4x.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Introduction == &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt; Joomlaǃ 4 provides five types of extensionsː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Component|&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt; Components&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt; A component is the main part of the site. A component handles data manipulation as well as input and storage into the database. A component on most sites is the primary focus of the page.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Module|&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt; Modules&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039; &amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt; A module is an add-on to the site that extends the functionality. A module usually occupies a secondary portion of the web page and is not considered the primary focus of a page. It can be displayed on different positions and you can choose on which active menu items it should be displayed. Modules are lightweight and flexible extensions. They are used for small bits of the page that are generally less complex and are able to be seen across different components.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Plugin|&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt; Plugins&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt; A Plugin manipulates output that is already generated by the system. It typically does not run as separate part of the site. It takes data from other sources (i.e. the content) and manipulates this data before displaying. A plugin typically work behind the scenes.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Languages|&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt; Languages&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;Probably the most basic extensions are languages. In essence the language package files consist of key/value pairs, which provide the translation of static text strings, assigned within the Joomla! source code. &lt;br /&gt;
* &#039;&#039;&#039;[[S:MyLanguage/Templates|&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt; Templates&amp;lt;/translate&amp;gt;]]&#039;&#039;&#039;&amp;lt;br /&amp;gt;&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt; A template is basically the design of your Joomla! powered website.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt; Joomla! 4 is constructed using five different applications:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
* Installation (used for installing Joomla and have to delete after installation)&lt;br /&gt;
* Administrator (backend - used for managing content)&lt;br /&gt;
* Public or site (frontend - used for displaying content)&lt;br /&gt;
* CLI (used for accessing Joomla on the command line and for cron jobs)&lt;br /&gt;
* API (web services - used for creating APIs for machine accessible content)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The installation application is used once. The administrator and public are used through the concept of &#039;&#039;components&#039;&#039; with &#039;&#039;modules&#039;&#039;. Each module has a single entry point located in the &#039;&#039;modules&#039;&#039; and accordingly &#039;&#039;administrator/modules&#039;&#039;  directory. This entry point is called &amp;lt;tt&amp;gt;&#039;&#039;mod_modulename/mod_modulename.php&#039;&#039;&amp;lt;/tt&amp;gt; (the &#039;&#039;mod_&#039;&#039; prefix is a historical trace). The entry point for the login module is for &#039;&#039;example /mod_login/mod_login.php&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt; You can download Joomla! 4 at [https://github.com/joomla/joomla-cms/tree/4.0-dev GitHub], on the [https://developer.joomla.org/nightly-builds.html Developer website] or you can create a free website at https://launch.joomla.org.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Creating a simple module/Developing a Basic Module - Part 1 == &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt; You can see many examples of modules in the standard Joomla! install. For example:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* Menus &lt;br /&gt;
* Latest News&lt;br /&gt;
* Login form&lt;br /&gt;
* and many more.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt; This tutorial will explain how to create a simple module. Through this tutorial you will learn the basic file structure of a Joomlaǃ 4 module. This basic structure can then be expanded to produce more elaborate modules.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt; There are a few basic files that are used in the standard pattern of module development:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt; * &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; - This file is the main entry point for the module. It will perform any necessary initialization routines, call helper routines to collect any necessary data, and include the template which will display the module output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt; * &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - This file contains information about the module. It defines the files that need to be installed by the Joomla! installer and specifies configuration parameters for the module.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt; * &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; - This is the module template. This file will take the data collected by mod_foo.php and generate the HTML to be displayed on the page.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt; * &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.ini&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.sys.ini&amp;lt;/tt&amp;gt;- This are the files that provide the text in United Kingdom English.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating mod_foo.php === &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:32--&amp;gt; The &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file will perform following tasks:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:33--&amp;gt; * Import the class &amp;lt;tt&amp;gt;ModuleHelper&amp;lt;/tt&amp;gt; to the current scope. We need it later for displaying the output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:34--&amp;gt; * Include the template to display the output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:35--&amp;gt; The helper class is imported to our current scope at the begin of the file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;use Joomla\CMS\Helper\ModuleHelper;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:36--&amp;gt; Last we include the template to display the output via&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;require ModuleHelper::getLayoutPath(&#039;mod_foo&#039;, $params-&amp;gt;get(&#039;layout&#039;, &#039;default&#039;));&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.php file ==== &amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:38--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Helper\ModuleHelper;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
require ModuleHelper::getLayoutPath(&#039;mod_foo&#039;, $params-&amp;gt;get(&#039;layout&#039;, &#039;default&#039;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:39--&amp;gt; &#039;&#039;Side note&#039;&#039;ː In Joomla 3x you usually used a line like &amp;lt;tt&amp;gt;$moduleclass_sfx = htmlspecialchars($params-&amp;gt;get(&#039;moduleclass_sfx&#039;));&amp;lt;/tt&amp;gt;. You don&#039;t need this anymore. See this PRː https://github.com/joomla/joomla-cms/pull/17447.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:40--&amp;gt; The one line that we haven’t explained so far is the first line &amp;lt;tt&amp;gt;defined(&#039;_JEXEC&#039;) or die;&amp;lt;/tt&amp;gt;. This line checks to make sure that this file is being included from the Joomla application. This is necessary to prevent variable injection and other potential security concerns.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating tmpl/default.php === &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:42--&amp;gt; The &amp;lt;tt&amp;gt;default.php&amp;lt;/tt&amp;gt; file is the template which displays the module output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed tmpl/default.php file ==== &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:44--&amp;gt; The code for the tmpl/default.php file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
echo &#039;[PROJECT_NAME]&#039;; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:45--&amp;gt; An important point to note is that the template file has the same scope as the &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file. It means that a variable can be defined in the &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file and then used in the template file without any extra declarations or function calls.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating mod_foo.xml === &amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:47--&amp;gt; The &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is the installation file. Most entries are self-explanatory.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml file ==== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:49--&amp;gt; The code for the &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt;  file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;3.8&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating the language files === &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:51--&amp;gt; The files &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod̠foo.ini&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod̠foo.sys.ini&amp;lt;/tt&amp;gt; are used to translate text in the frontend and in the backend.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:52--&amp;gt; The code for &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod̠foo.sys.ini&amp;lt;/tt&amp;gt; is as follows:&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;
&lt;br /&gt;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:53--&amp;gt; The &amp;lt;tt&amp;gt;.sys.ini&amp;lt;/tt&amp;gt; file is used to translate the description of the extension upon installation, where as the &amp;lt;tt&amp;gt;.ini&amp;lt;/tt&amp;gt; file is used to translate the remaining strings and the description when viewing your extension.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:54--&amp;gt; More information about language files can be found [[S:MyLanguage/Specification_of_language_files|here]].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:56--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;br /&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:57--&amp;gt; After that you can choose your module in the module manager, when you create a new site module.&amp;lt;/translate&amp;gt; &lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial1-&amp;lt;translate&amp;gt;&amp;lt;!--T:58--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial2-&amp;lt;translate&amp;gt;&amp;lt;!--T:59--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:60--&amp;gt; In the frontend, you will see your module like displayed in the next image.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial3-&amp;lt;translate&amp;gt;&amp;lt;!--T:61--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:63--&amp;gt; Module development for Joomla is a fairly simple, straightforward process. Using the techniques described in this tutorial, an endless variety of modules can be developed with little hassle.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:64--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/module&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:65--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add a helper class using namespaces - Part 2== &amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:68--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Namespaces == &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:70--&amp;gt; With PHP 5.3, the namespaces came into their own. In other programming languages for a long time in use, these small structures now also help us with the clarity of our code.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:71--&amp;gt; Namespaces are separate areas in which certain logical things (in our case, classes, interfaces, functions, and constants) can live. These areas provide ncapsulation of the code and prevent name conflicts.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:72--&amp;gt; Let&#039;s take a look how to use them in Joomla 4. We use the helper file for this.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:74--&amp;gt; We will create/change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Helper/FooHelper.php&amp;lt;/code&amp;gt; - This is the file we use here as an example. We have to create it.&lt;br /&gt;
* &amp;lt;code&amp;gt;mod_foo.php&amp;lt;/code&amp;gt; - In this file we will mainly load the namespace.&lt;br /&gt;
* &amp;lt;code&amp;gt;tmpl/default.php&amp;lt;/code&amp;gt; - In this file demonstrate how the data of a helper can be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;mod_foo.xml&amp;lt;/code&amp;gt; - We create a new directory with a new file. This must be installed during the installation. For this we have to specify them in this file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating Helper/FooHelper.php === &amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:77--&amp;gt; Our new helper class should belong to a namespace. We achieve this with the following code. It is important, that this line is at the beginning of the file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;namespace Joomla\Module\Foo\Site\Helper;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:78--&amp;gt; Then we create a simple class with a simple method. Of course you can do a lot more here. Take a look at the Joomla core methods. Here are many examples. They show you first-hand what options you have.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed Helper/FooHelper.php ==== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:80--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Site&lt;br /&gt;
 * @subpackage  mod_breadcrumbs&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
namespace Joomla\Module\Foo\Site\Helper;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Helper for mod_foo&lt;br /&gt;
 *&lt;br /&gt;
 * @since  4.0&lt;br /&gt;
 */&lt;br /&gt;
class FooHelper&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Retrieve foo test&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   Registry        $params  The module parameters&lt;br /&gt;
	 * @param   CMSApplication  $app     The application&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  array&lt;br /&gt;
	 */&lt;br /&gt;
	public static function getText()&lt;br /&gt;
	{&lt;br /&gt;
		return &#039;FooHelpertest&#039;;&lt;br /&gt;
	}&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;&lt;br /&gt;
=== Editing mod_foo.php === &amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:82--&amp;gt; Our new helper class is imported to our current scope at the begin of the file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;use Joomla\Module\Foo\Site\Helper\FooHelper;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:83--&amp;gt; Last use the helper file for testing if it is loaded correctlyː&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$test  = FooHelper::getText($params, $app);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.php file ==== &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:85--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Helper\ModuleHelper;&lt;br /&gt;
use Joomla\Module\Foo\Site\Helper\FooHelper;&lt;br /&gt;
&lt;br /&gt;
$test  = FooHelper::getText();&lt;br /&gt;
&lt;br /&gt;
require ModuleHelper::getLayoutPath(&#039;mod_foo&#039;, $params-&amp;gt;get(&#039;layout&#039;, &#039;default&#039;));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing tmpl/default.php === &amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:87--&amp;gt; In this file you make only a small change to demonstrate in the frontend that your helper file is working properly. You only add the value of the variable at the end of the current output.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed tmpl/default.php ==== &amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:89--&amp;gt; The complete &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing mod_foo.xml === &amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:91--&amp;gt; First you have to add a line, so that the namespace is set automatically in Joomla. After this change, you have to re-install your module. A simple change in an already installed module is not enough. If you are doing local development you can also delete the files libraries/autoload_psr4.php and it will automatically be re-created. After inserting and installing, the namespace is known by the loader &amp;lt;tt&amp;gt;JPATH_LIBRARIES . &#039;/autoload_psr4.php&#039;&amp;lt;/tt&amp;gt;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:92--&amp;gt; Joomla! should copy your helper file when installing the module. So Joomla! needs to know your helper file. For this, you need to add the following line to your XML file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:94--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;3.8&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:96--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:97--&amp;gt; After that you can choose your module in the module manager, when you create a new site module.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:98--&amp;gt; In the frontend you will see your module like displayed in the next image. The text form your helper file is displayed.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial23-&amp;lt;translate&amp;gt;&amp;lt;!--T:99--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:101--&amp;gt; As you can see, once you get a bit into the namespaces, they are not that complicated anymore. In big projects they can bring a lot of benefits. However, we should plan namespaces, as otherwise it will soon be more time-consuming.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:102--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/plugins/system&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:103--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Customizationː Add parameters via form fields - Part 3 == &amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:106--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Customization with form fields and parameters == &amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:108--&amp;gt; Form fields give a great deal of customization in Joomla and for modules are the sole way of allowing the user to tweak the module to the needs of their site.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:109--&amp;gt; In this case we are going to extend our previous example using a url field for inserting a domain that we can use as link in the front end. To allow this to happen we will use the [[S:MyLanguage/URL_form_field_type|URL Form Field]] type.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:110--&amp;gt; After that, we insert parameters that allow to use standard functionality of Joomla.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:111--&amp;gt; Let&#039;s take a look on how to use them in Joomla 4.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:113--&amp;gt; We will change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - This is the file where we add the fields.&lt;br /&gt;
* &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; - In this file demonstrate how the data of a field can be used.&lt;br /&gt;
* &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.ini&amp;lt;/tt&amp;gt; - Here we use a language string so that the field can be labeled correctly in different languages.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing mod_foo.xml === &amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:116--&amp;gt; First we set a custom parameter.&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;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
    type=&amp;quot;url&amp;quot;&lt;br /&gt;
    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:117--&amp;gt; Then we insert Joomla default fields, so that we can use cache, moduleclass-suffix and layouts.&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;field&lt;br /&gt;
    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
    type=&amp;quot;list&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
    default=&amp;quot;0&amp;quot;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
    type=&amp;quot;number&amp;quot;&lt;br /&gt;
    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
    default=&amp;quot;0&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:119--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;3.8&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
    &amp;lt;config&amp;gt;&lt;br /&gt;
        &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
                    type=&amp;quot;url&amp;quot;&lt;br /&gt;
                    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
                    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;advanced&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
                    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
                    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
                    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
                    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
                    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
                    type=&amp;quot;list&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
                    type=&amp;quot;number&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
                    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
                    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
        &amp;lt;/fields&amp;gt;&lt;br /&gt;
    &amp;lt;/config&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing tmpl/default.php === &amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:121--&amp;gt; We can use the value of the parameter for creating an hyperlink in the frontend. We can access the value via the variable via the variable $params.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$domain = $params-&amp;gt;get(&#039;domain&#039;, &#039;https://www.joomla.org&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:122--&amp;gt; Later we set use this value for creating the hyperlink.&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;
&amp;lt;a href=&amp;quot;&amp;lt;?php echo $domain; ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test; ?&amp;gt;&lt;br /&gt;
&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed tmpl/default.php file ==== &amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:124--&amp;gt; The complete &amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
$domain = $params-&amp;gt;get(&#039;domain&#039;, &#039;https://www.joomla.org&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;a href=&amp;quot;&amp;lt;?php echo $domain; ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;?php echo &#039;[PROJECT_NAME]&#039; . $test; ?&amp;gt;&lt;br /&gt;
&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing language/en-GB/en-GB.mod_foo.ini === &amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:126--&amp;gt; Here we can specify the text for the English version of the field label.&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;MOD_FOO_FIELD_URL_LABEL=&amp;quot;Url&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed language/en-GB/en-GB.mod_foo.ini ==== &amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:128--&amp;gt; The complete &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.ini&amp;lt;/tt&amp;gt; file 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;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
MOD_FOO_FIELD_URL_LABEL=&amp;quot;Url&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:130--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:131--&amp;gt; After that you can choose your module in the module manager, when you create a new site module.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:132--&amp;gt; In the backend, you will see your module like displayed in the next image.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:133--&amp;gt; In the basic tab, you will see the custom field where you can insert a domain. The text for the label is fetched from the language file.&amp;lt;/translate&amp;gt; &lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial31-&amp;lt;translate&amp;gt;&amp;lt;!--T:134--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:135--&amp;gt; In the advanced tab, you will see all default options except the cache mode because of this is a hidden field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial32-&amp;lt;translate&amp;gt;&amp;lt;!--T:136--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:137--&amp;gt; In the frontend, you will see your module like displayed in the next image. The text form your helper file is displayed and you should see a hyperlink.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial33-&amp;lt;translate&amp;gt;&amp;lt;!--T:138--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:140--&amp;gt; Form fields give the user an easy way to customize the module to their sites settings. This allows the modules scope to be increased.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:141--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/plugins/system&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:142--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:143--&amp;gt; See this issue for possible future changes:&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla/joomla-cms/pull/23553&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use Install, Update and Uninstall script - Part 4 == &amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:146--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Scripts === &amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:148--&amp;gt; Installing, updating and uninstalling a module may require additional operations that cannot be achieved by the basic operations described in the main XML file. Joomla offers a new approach to solve this problem. It consists in using a PHP script file containing a class using five methods:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:149--&amp;gt;&lt;br /&gt;
* preflight which is executed before install and update&lt;br /&gt;
* install&lt;br /&gt;
* update&lt;br /&gt;
* uninstall&lt;br /&gt;
* postflight which is executed after install and update&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:150--&amp;gt; Let&#039;s take a look how to use them in Joomla 4. We use the helper file for this.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:151--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:152--&amp;gt; We will create/change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:153--&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;script.php&amp;lt;/tt&amp;gt; - This is the file we use here as an example. We have to create it.&lt;br /&gt;
* &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.sys.ini&amp;lt;/tt&amp;gt; - In this file we will add text.&lt;br /&gt;
* &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - We create a new file. This must be installed during the installation. For this we have to specify it in this file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating script.php === &amp;lt;!--T:154--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:155--&amp;gt; Writing an extension script consists in declaring a class whose name is &amp;lt;tt&amp;gt;mod_ModuleNameInstallerScripʈ&amp;lt;/tt&amp;gt; with these 5 methods. See the comments in the file for more information. In this comments I explain when a method is called.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:156--&amp;gt; In this example, I only use text to show when which method will be executed. In addition, I show you how to check the minimum requirements. Of course you can do much more. For example, you can delete files that are no longer needed in a new version of your module. This can be seen in the file. Another idea for this file is to create sample content, to show a success message with the current installed version number or you can redirect after a successful installation to the page with the module settings.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed script.php ==== &amp;lt;!--T:157--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:158--&amp;gt; The complete &amp;lt;tt&amp;gt;script.php&amp;lt;/tt&amp;gt; file 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;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package    [PACKAGE_NAME]&lt;br /&gt;
 *&lt;br /&gt;
 * @author     [AUTHOR] &amp;lt;[AUTHOR_EMAIL]&amp;gt;&lt;br /&gt;
 * @copyright  [COPYRIGHT]&lt;br /&gt;
 * @license    GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 * @link       [AUTHOR_URL]&lt;br /&gt;
 */&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Language\Text;&lt;br /&gt;
use Joomla\CMS\Log\Log;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Script file of Foo module&lt;br /&gt;
 */&lt;br /&gt;
class mod_fooInstallerScript {&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Extension script constructor.&lt;br /&gt;
     *&lt;br /&gt;
     * @return  void&lt;br /&gt;
     */&lt;br /&gt;
    public function __construct() {&lt;br /&gt;
        $this-&amp;gt;minimumJoomla = &#039;4.0&#039;;&lt;br /&gt;
        $this-&amp;gt;minimumPhp = JOOMLA_MINIMUM_PHP;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Method to install the extension&lt;br /&gt;
     *&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function install($parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_UNINSTALL&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Method to uninstall the extension&lt;br /&gt;
     *&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function uninstall($parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_UNINSTALL&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Method to update the extension&lt;br /&gt;
     *&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function update($parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_UPDATE&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Function called before extension installation/update/removal procedure commences&lt;br /&gt;
     *&lt;br /&gt;
     * @param   string            $type    The type of change (install, update or discover_install, not uninstall)&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function preflight($type, $parent) {&lt;br /&gt;
        // Check for the minimum PHP version before continuing&lt;br /&gt;
        if (!empty($this-&amp;gt;minimumPhp) &amp;amp;&amp;amp; version_compare(PHP_VERSION, $this-&amp;gt;minimumPhp, &#039;&amp;lt;&#039;)) {&lt;br /&gt;
            Log::add(Text::sprintf(&#039;JLIB_INSTALLER_MINIMUM_PHP&#039;, $this-&amp;gt;minimumPhp), Log::WARNING, &#039;jerror&#039;);&lt;br /&gt;
&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Check for the minimum Joomla version before continuing&lt;br /&gt;
        if (!empty($this-&amp;gt;minimumJoomla) &amp;amp;&amp;amp; version_compare(JVERSION, $this-&amp;gt;minimumJoomla, &#039;&amp;lt;&#039;)) {&lt;br /&gt;
            Log::add(Text::sprintf(&#039;JLIB_INSTALLER_MINIMUM_JOOMLA&#039;, $this-&amp;gt;minimumJoomla), Log::WARNING, &#039;jerror&#039;);&lt;br /&gt;
&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_PREFLIGHT&#039;);&lt;br /&gt;
        echo $this-&amp;gt;minimumJoomla . &#039; &#039; . $this-&amp;gt;minimumPhp;&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Function called after extension installation/update/removal procedure commences&lt;br /&gt;
     *&lt;br /&gt;
     * @param   string            $type    The type of change (install, update or discover_install, not uninstall)&lt;br /&gt;
     * @param   InstallerAdapter  $parent  The class calling this method&lt;br /&gt;
     *&lt;br /&gt;
     * @return  boolean  True on success&lt;br /&gt;
     */&lt;br /&gt;
    function postflight($type, $parent) {&lt;br /&gt;
        echo Text::_(&#039;MOD_FOO_INSTALLERSCRIPT_POSTFLIGHT&#039;);&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
    }&lt;br /&gt;
&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;&lt;br /&gt;
=== Editing language/en-GB/en-GB.mod_foo.sys.ini === &amp;lt;!--T:159--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:160--&amp;gt; There is not much to explain here. Write the text for the translation into this file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed language/en-GB/en-GB.mod_foo.sys.ini file ==== &amp;lt;!--T:161--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:162--&amp;gt; The complete &amp;lt;tt&amp;gt;language/en-GB/en-GB.mod_foo.sys.ini&amp;lt;/tt&amp;gt; file 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;
MOD_FOO=&amp;quot;[PROJECT_NAME]&amp;quot;&lt;br /&gt;
MOD_FOO_XML_DESCRIPTION=&amp;quot;Foo Module&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_PREFLIGHT=&amp;quot;&amp;lt;p&amp;gt;Anything here happens before the installation/update/uninstallation of the module&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_UPDATE=&amp;quot;&amp;lt;p&amp;gt;The module has been updated&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_UNINSTALL=&amp;quot;&amp;lt;p&amp;gt;The module has been uninstalled&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_INSTALL=&amp;quot;&amp;lt;p&amp;gt;The module has been installed&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
MOD_FOO_INSTALLERSCRIPT_POSTFLIGHT=&amp;quot;&amp;lt;p&amp;gt;Anything here happens after the installation/update/uninstallation of the module&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Editing mod_foo.xml === &amp;lt;!--T:163--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:164--&amp;gt; You have to add a line, so that the script is called automatically in Joomla.&amp;lt;/translate&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;scriptfile&amp;gt;script.php&amp;lt;/scriptfile&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:165--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:166--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;4.0&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;scriptfile&amp;gt;script.php&amp;lt;/scriptfile&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
    &amp;lt;config&amp;gt;&lt;br /&gt;
        &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
                    type=&amp;quot;url&amp;quot;&lt;br /&gt;
                    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
                    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;advanced&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
                    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
                    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
                    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
                    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
                    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
                    type=&amp;quot;list&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
                    type=&amp;quot;number&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
                    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
                    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
        &amp;lt;/fields&amp;gt;&lt;br /&gt;
    &amp;lt;/config&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Test your module == &amp;lt;!--T:167--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:168--&amp;gt; Now you can zip all files and install them via the Joomla Extension Manager.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:169--&amp;gt; Immediately after the installation, you will see the following information. This you had entered in the script so.&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{-}}&lt;br /&gt;
[[File:moduletutorial14-&amp;lt;translate&amp;gt;&amp;lt;!--T:170--&amp;gt; en&amp;lt;/translate&amp;gt;.png|700px|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Conclusion == &amp;lt;!--T:171--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:172--&amp;gt; As you can see, Joomla offers you a lot to make your extension easy to use - right from the start.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:173--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/plugins/system&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:174--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use Joomla Updaterː Adding Auto Update - Part 5 == &amp;lt;!--T:175--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Requirements === &amp;lt;!--T:176--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:177--&amp;gt; You need Joomla! 4.x for this tutorial (as of writing currently Joomla! 4.0.0-alpha6-dev)&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Joomla Updater === &amp;lt;!--T:178--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:179--&amp;gt; The first thing to do is to read the [[S:MyLanguage/J2.5:Managing_Component_Updates|Managing Component Upgrades with Joomla 2.5 - Part 1]] tutorial to give an idea of how the upgrade process works in Joomla. Whilst written for 2.5 the process hasn&#039;t changed. Also read [[S:MyLanguage/Deploying_an_Update_Server|Deploying an update server]] - this is what we&#039;ll be implementing in this tutorial.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== File Structure === &amp;lt;!--T:180--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:181--&amp;gt; We will create/change the following files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:182--&amp;gt; * &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; - The only way to update our existing module is to add in a update server - for example &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/foo_update.xmɭ&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; - into the xml file.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:183--&amp;gt; * &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt; - Then we have to create the XML file for the update server at &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/foo_update.xmɭ&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; to let Joomla know an update is available.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Editing mod_foo.xml ==== &amp;lt;!--T:184--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:185--&amp;gt; To add our update server, we need to insert the following lines in your XML-File&amp;lt;/translate&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&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;[PROJECT_NAME]&amp;quot;&amp;gt;https://www.example.com/mod_foo.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
&amp;lt;/updateservers&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed mod_foo.xml ==== &amp;lt;!--T:186--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:187--&amp;gt; The complete &amp;lt;tt&amp;gt;mod_foo.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;4.0&amp;quot; client=&amp;quot;site&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;name&amp;gt;MOD_FOO&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;[DATE]&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;[AUTHOR]&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorEmail&amp;gt;[AUTHOR_EMAIL]&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;[AUTHOR_URL]&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;[COPYRIGHT]&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GNU General Public License version 2 or later; see LICENSE.txt&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;MOD_FOO_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;namespace&amp;gt;Joomla\Module\Foo&amp;lt;/namespace&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;filename module=&amp;quot;mod_foo&amp;quot;&amp;gt;mod_foo.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;Helper&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;filename&amp;gt;mod_foo.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
    &amp;lt;/files&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;[PROJECT_NAME]&amp;quot;&amp;gt;https://www.example.com/mod_foo.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
    &amp;lt;/updateservers&amp;gt;&lt;br /&gt;
    &amp;lt;config&amp;gt;&lt;br /&gt;
        &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;domain&amp;quot;&lt;br /&gt;
                    type=&amp;quot;url&amp;quot;&lt;br /&gt;
                    label=&amp;quot;MOD_FOO_FIELD_URL_LABEL&amp;quot;&lt;br /&gt;
                    filter=&amp;quot;url&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;advanced&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;layout&amp;quot;&lt;br /&gt;
                    type=&amp;quot;modulelayout&amp;quot;&lt;br /&gt;
                    label=&amp;quot;JFIELD_ALT_LAYOUT_LABEL&amp;quot;&lt;br /&gt;
                    class=&amp;quot;custom-select&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;moduleclass_sfx&amp;quot;&lt;br /&gt;
                    type=&amp;quot;textarea&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_MODULECLASS_SFX_LABEL&amp;quot;&lt;br /&gt;
                    rows=&amp;quot;3&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache&amp;quot;&lt;br /&gt;
                    type=&amp;quot;list&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHING_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JGLOBAL_USE_GLOBAL&amp;lt;/option&amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;COM_MODULES_FIELD_VALUE_NOCACHING&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cache_time&amp;quot;&lt;br /&gt;
                    type=&amp;quot;number&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_MODULES_FIELD_CACHE_TIME_LABEL&amp;quot;&lt;br /&gt;
                    default=&amp;quot;0&amp;quot;&lt;br /&gt;
                /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;field&lt;br /&gt;
                    name=&amp;quot;cachemode&amp;quot;&lt;br /&gt;
                    type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
                    default=&amp;quot;itemid&amp;quot;&lt;br /&gt;
                &amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;itemid&amp;quot;&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
        &amp;lt;/fields&amp;gt;&lt;br /&gt;
    &amp;lt;/config&amp;gt;&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:188--&amp;gt; So now that Joomla is searching for updates to our extension - let&#039;s create one to test out our process. But first we need to create the file &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt;. So far we have only described the update server. We do not know yet if there is an update. In the file &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt; we indicate when a new version is published and where it can be downloaded.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Creating foo_update.xml === &amp;lt;!--T:189--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:190--&amp;gt; Now we have to create the XML file at &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/foo_update.xml&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; to let Joomla know an update is available.&amp;lt;/translate&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==== Completed foo_update.xml ==== &amp;lt;!--T:191--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:192--&amp;gt; The complete &amp;lt;tt&amp;gt;foo_update.xml&amp;lt;/tt&amp;gt; file is as follows:&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;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;updates&amp;gt;&lt;br /&gt;
    &amp;lt;update&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;Foo&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;This is mod_foo 1.0.1&amp;lt;/description&amp;gt;&lt;br /&gt;
        &amp;lt;element&amp;gt;mod_foo&amp;lt;/element&amp;gt;&lt;br /&gt;
        &amp;lt;type&amp;gt;module&amp;lt;/type&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;1.0.1&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;downloads&amp;gt;&lt;br /&gt;
            &amp;lt;downloadurl type=&amp;quot;full&amp;quot; format=&amp;quot;zip&amp;quot;&amp;gt;http://www.example.com/mod_foo_101.zip&amp;lt;/downloadurl&amp;gt;&lt;br /&gt;
        &amp;lt;/downloads&amp;gt;&lt;br /&gt;
        &amp;lt;maintainer&amp;gt;Joomla&amp;lt;/maintainer&amp;gt;&lt;br /&gt;
        &amp;lt;maintainerurl&amp;gt;http://www.example.com&amp;lt;/maintainerurl&amp;gt;&lt;br /&gt;
        &amp;lt;targetplatform name=&amp;quot;joomla&amp;quot; version=&amp;quot;4.0&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;client&amp;gt;site&amp;lt;/client&amp;gt;&lt;br /&gt;
    &amp;lt;/update&amp;gt;&lt;br /&gt;
&amp;lt;/updates&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:193--&amp;gt; After uploading this file to the address &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;https://www.example.com/mod_foo.xml&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; the update will be displayed in the Joomla backend.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Test your module update === &amp;lt;!--T:194--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:195--&amp;gt; Create a copy of the module as it is now. Then let&#039;s update the version number to 1.0.1. Now you can zip all files. After that you should load your zip to the URL &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;http://www.example.com/mod_foo_101.zip&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;. Now you can update your module via the Joomla Updater.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Commercial Modules === &amp;lt;!--T:196--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:197--&amp;gt; Note that in our files we have linked to the extensions updates xml file. And from that xml file we have a location for the zip of the module. This means that if someone was to track this backwards they could find the physical source of your modules zip file. If you don&#039;t do like this, you can find a solution in this PRː https://github.com/joomla/joomla-cms/pull/15185 .&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Conclusion === &amp;lt;!--T:198--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:199--&amp;gt; With the Joomla updater, you can easily reach all users and tell them that there is a new version. Even the update itself is easy.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:200--&amp;gt; Each extension should use an update server. Especially for security reasons.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:201--&amp;gt; You can find boilerplates hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/joomla-extensions/boilerplate/tree/master/plugins/system&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:202--&amp;gt; The sample files for this Tutorial can be found hereː&amp;lt;/translate&amp;gt;&lt;br /&gt;
* https://github.com/astridx/boilerplate/tree/tutorial/tutorial/modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Beginner Development{{#translation:}}]]&lt;br /&gt;
[[Category:Tutorials{{#translation:}}]]&lt;br /&gt;
[[Category:Tutorials in a Series{{#translation:}}]]&lt;br /&gt;
[[Category:Development{{#translation:}}]]&lt;br /&gt;
[[Category:Module Development{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla! 4.x{{#translation:}}]]&lt;br /&gt;
[[Category:Joomla! 4.0{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:User_Action_Logs&amp;diff=591006</id>
		<title>J3.x:User Action Logs</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:User_Action_Logs&amp;diff=591006"/>
		<updated>2019-02-05T05:15:16Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Include namespace&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{Joomla version|version=3.9}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{Top portal heading|color=white-bkgd|icon=magic|icon-color=#5091cd|size=3x|text-color=#333|title=Tutorial&amp;lt;br /&amp;gt;&lt;br /&gt;
How to Use the New Action Logging System}}&lt;br /&gt;
&lt;br /&gt;
As of Joomla 3.9, Joomla introduced an action logging system.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This system is the finalization of the [https://magazine.joomla.org/issues/issue-aug-2016/item/3111-gsoc-recording-actions-logs-accessible-by-super-admin-status-update &amp;quot;Recording Action Logs&amp;quot; project from GSoC 2016]. This system provides an infrastructure to create an audit log of activity performed on a website and can be fine tuned to the site admin&#039;s preferences. Extensions are able to hook into this system to add custom messages or have the system process standard CRUD actions.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this tutorial, you will find information on how to set up this new system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: Only Super Users have access to the Action Logging system.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Component== &lt;br /&gt;
&lt;br /&gt;
===User Actions Log Dashboard=== &lt;br /&gt;
Navigate to {{rarr|Users,User Actions Log}} to access the dashboard.&lt;br /&gt;
&lt;br /&gt;
[[Image:Joomla-39-action-logs-dashboard-en.png|800px]]&lt;br /&gt;
&lt;br /&gt;
From this screen a Super User has a global overview of all activities performed on a site by users and has the ability to review, export, delete and purge entries.&lt;br /&gt;
&lt;br /&gt;
To learn more, please see:&lt;br /&gt;
*[[S:MyLanguage/Help38:Components_Actionlogs|User Actions Log interface]] &lt;br /&gt;
*[[S:MyLanguage/Help38:Components_User_Actionlogs_Options| User Actions Log Options]]&lt;br /&gt;
&lt;br /&gt;
==Plugin== &lt;br /&gt;
&lt;br /&gt;
===System - User Actions Log=== &lt;br /&gt;
Once enabled, this plugin allows to define the number of days after which the logs will be deleted.&lt;br /&gt;
&lt;br /&gt;
===Action Log===&lt;br /&gt;
Once enabled, this plugin allows to record the actions of users for the core extensions.&lt;br /&gt;
&lt;br /&gt;
===Privacy - Action Logs=== &lt;br /&gt;
Once enabled, this plugin allows to export the action log data for a user&#039;s privacy request.&lt;br /&gt;
&lt;br /&gt;
==Module== &lt;br /&gt;
&lt;br /&gt;
===Action Logs - Latest Module=== &lt;br /&gt;
This admin module shows on the control panel a list of the latest actions performed on a site.&lt;br /&gt;
&lt;br /&gt;
[[Image:Joomla-39-action-logs-latest-module-en.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The module is not displayed by default on sites upgrading to Joomla 3.9. In order to display it on your control panel, navigate to {{rarr|Extensions,Manage,Manage,Enable the System - User Actions Log plugin}} and then go to {{rarr|Extensions,Modules,Administrator,New,Action Logs-Latest}}&lt;br /&gt;
&lt;br /&gt;
Please see also: [[S:MyLanguage/Help38:Extensions_Module_Manager_Admin_Latestactions|Latest Actions Admin Module]].&lt;br /&gt;
&lt;br /&gt;
==How to hook an extension to the system== &lt;br /&gt;
I was very keen to utilise this function from within one of my components and so this is my attempt to help others who wish to do the same.  Please feel free to edit this section where my code can be improved or corrected.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Component Installation Script===&lt;br /&gt;
Add the extension to the table (#__action_logs_extensions) so that it will appear in the configuration of User Action Logs.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
        $extension = &#039;com_mycomponent&#039;;&lt;br /&gt;
        $db = \Joomla\CMS\Factory::getDbo();&lt;br /&gt;
        $db-&amp;gt;setQuery(&#039; INSERT into #__action_logs_extensions (extension) VALUES (&#039;.$db-&amp;gt;Quote($extension).&#039;) &#039; );&lt;br /&gt;
	    try {&lt;br /&gt;
	        // If it fails, it will throw a RuntimeException&lt;br /&gt;
	        $result = $db-&amp;gt;execute();&lt;br /&gt;
	    } catch (RuntimeException $e) {&lt;br /&gt;
	        \Joomla\CMS\Factory::getApplication()-&amp;gt;enqueueMessage($e-&amp;gt;getMessage());&lt;br /&gt;
	        return false;&lt;br /&gt;
	    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Add the extension configuration to the table (#__action_log_config) so that your actions data will be captured.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
		$logConf = new stdClass();&lt;br /&gt;
		$logConf-&amp;gt;id = 0;&lt;br /&gt;
		$logConf-&amp;gt;type_title = &#039;transaction&#039;;&lt;br /&gt;
		$logConf-&amp;gt;type_alias = $extension;&lt;br /&gt;
		$logConf-&amp;gt;id_holder = &#039;id&#039;;&lt;br /&gt;
		$logConf-&amp;gt;title_holder = &#039;trans_desc&#039;;&lt;br /&gt;
		$logConf-&amp;gt;table_name = &#039;#__mycomponent_transaction&#039;;&lt;br /&gt;
		$logConf-&amp;gt;text_prefix = &#039;COM_MYCOMPONENT_TRANSACTION&#039;;&lt;br /&gt;
&lt;br /&gt;
	    try {&lt;br /&gt;
	       	// If it fails, it will throw a RuntimeException&lt;br /&gt;
			// Insert the object into the table.&lt;br /&gt;
			$result = Factory::getDbo()-&amp;gt;insertObject(&#039;#__action_log_config&#039;, $logConf);&lt;br /&gt;
	    } catch (RuntimeException $e) {&lt;br /&gt;
	        \Joomla\CMS\Factory::getApplication()-&amp;gt;enqueueMessage($e-&amp;gt;getMessage());&lt;br /&gt;
	        return false;&lt;br /&gt;
	    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Of course it would be best to perform some checking to ensure that the record doesn&#039;t already exist.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
===Component Helper===&lt;br /&gt;
I utilise my component helper to perform the storing of actions.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
	/**&lt;br /&gt;
	 * Record transaction details in log record&lt;br /&gt;
	 * @param   object  $user    Saves getting the current user again.&lt;br /&gt;
	 * @param   int     $tran_id  The transaction id just created or updated&lt;br /&gt;
	 * @param   int     $id  Passed id reference from the form to identify if new record&lt;br /&gt;
	 * @return  boolean	True&lt;br /&gt;
	 */&lt;br /&gt;
    public static function recordActionLog($user = null, $tran_id = 0, $id = 0)&lt;br /&gt;
	{&lt;br /&gt;
			// get the component details such as the id&lt;br /&gt;
		$extension =  MycomponentHelper::getExtensionDetails(&#039;com_mycomponent&#039;);&lt;br /&gt;
		// get the transaction details for use in the log for easy reference&lt;br /&gt;
        $tran = MycomponentHelper::getTransaction($tran_id);&lt;br /&gt;
        $con_type = &amp;quot;transaction&amp;quot;;&lt;br /&gt;
        if ($id === 0) { $type = &#039;New &#039;; } else { $type = &#039;Update &#039;; }&lt;br /&gt;
&lt;br /&gt;
		$message = array();&lt;br /&gt;
		$message[&#039;action&#039;] = $con_type;&lt;br /&gt;
		$message[&#039;type&#039;] = $type . $tran-&amp;gt;tran_type . &#039; - &#039;.$tran-&amp;gt;tran_desc . &#039; $&#039; . $tran-&amp;gt;tran_amount;&lt;br /&gt;
		$message[&#039;id&#039;] = $tran-&amp;gt;id;&lt;br /&gt;
		$message[&#039;title&#039;] = $extension-&amp;gt;name;&lt;br /&gt;
		$message[&#039;extension_name&#039;] = $extension-&amp;gt;name;&lt;br /&gt;
		$message[&#039;itemlink&#039;] = &amp;quot;index.php?option=com_mycomponent&amp;amp;task=transaction.edit&amp;amp;id=&amp;quot;.$tran-&amp;gt;id;&lt;br /&gt;
		$message[&#039;userid&#039;] = $user-&amp;gt;id;&lt;br /&gt;
		$message[&#039;username&#039;] = $user-&amp;gt;username;&lt;br /&gt;
		$message[&#039;accountlink&#039;] = &amp;quot;index.php?option=com_users&amp;amp;task=user.edit&amp;amp;id=&amp;quot;.$user-&amp;gt;id;&lt;br /&gt;
		&lt;br /&gt;
		$messages = array($message);&lt;br /&gt;
		&lt;br /&gt;
		$messageLanguageKey = Text::_(&#039;COM_MYCOMPONENT_TRANSACTION_LINK&#039;);&lt;br /&gt;
		$context = $extension-&amp;gt;name.&#039;.&#039;.$con_type;&lt;br /&gt;
		&lt;br /&gt;
		$fmodel = MycomponentHelper::getForeignModel(&#039;Actionlog&#039;, &#039;ActionlogsModel&#039;);&lt;br /&gt;
&lt;br /&gt;
		$fmodel-&amp;gt;addLog($messages, $messageLanguageKey, $context, $user-&amp;gt;id);&lt;br /&gt;
&lt;br /&gt;
		return true;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the Model from another component for use&lt;br /&gt;
	 * @param   string  $name    The model name. Optional. Default to my own for safety.&lt;br /&gt;
	 * @param   string  $prefix  The class prefix. Optional&lt;br /&gt;
	 * @param   array   $config  Configuration array for model. Optional&lt;br /&gt;
	 * @return object	The model&lt;br /&gt;
	 */&lt;br /&gt;
	public function getForeignModel($name = &#039;Transaction&#039;, $prefix = &#039;MycomponentModel&#039;, $config = array(&#039;ignore_request&#039; =&amp;gt; true))&lt;br /&gt;
	{&lt;br /&gt;
		\Joomla\CMS\MVC\Model\ItemModel::addIncludePath(JPATH_ADMINISTRATOR . &#039;/components/com_actionlogs/models&#039;, &#039;ActionlogsModelActionlog&#039;);&lt;br /&gt;
		$fmodel = \Joomla\CMS\MVC\Model\ItemModel::getInstance($name, $prefix, $config);&lt;br /&gt;
&lt;br /&gt;
		return $fmodel;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
===Front End Transaction Form===&lt;br /&gt;
Now that the foundations are set, we just need to trigger the process.  I&#039;m capturing information about a transaction that is created or update and I have a model called transactionform.php.  It is in the Save method that I want to capture a log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
	// So the code above this point checks and does what it should do and then after the successful save of the record, we check for the parameter setting to see if logging is required, we pass key elements to recordActionLog.&lt;br /&gt;
        $table = $this-&amp;gt;getTable();&lt;br /&gt;
&lt;br /&gt;
        if ($table-&amp;gt;save($data) === true) {&lt;br /&gt;
&lt;br /&gt;
			/* ---------------------------------------------------------------- */&lt;br /&gt;
			// trigger transaction log if required&lt;br /&gt;
			$act_log = $params-&amp;gt;get(&#039;act_log&#039;, 0);&lt;br /&gt;
			if ($act_log &amp;amp;&amp;amp; $table-&amp;gt;id) {&lt;br /&gt;
				// gather information and log in a new action log record&lt;br /&gt;
				MycomponentHelper::recordActionLog($user, $table-&amp;gt;id, $data[&#039;id&#039;]);&lt;br /&gt;
			}&lt;br /&gt;
			/* ---------------------------------------------------------------- */&lt;br /&gt;
&lt;br /&gt;
            return $table-&amp;gt;id;&lt;br /&gt;
        } else {&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
===Language File===&lt;br /&gt;
Finally, to help with the Action Log Listing in the admin side of Joomla!, we want to set some key elements of data to be displayed in the language file en-GB.com_mycomponent.ini.&amp;lt;br /&amp;gt;&lt;br /&gt;
COM_MYCOMPONENT_TRANSACTION_LINK=&amp;quot;User &amp;lt;a href=&#039;{accountlink}&#039;&amp;gt;{username}&amp;lt;/a&amp;gt; created a transaction ( &amp;lt;a href=&#039;{itemlink}&#039;&amp;gt;{type}&amp;lt;/a&amp;gt; )&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Hope this helps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Components]]&lt;br /&gt;
[[Category:Joomla! 3.9]]&lt;br /&gt;
[[Category:Plugins]]&lt;br /&gt;
[[Category:Modules]]&lt;br /&gt;
[[Category:User Action Logs]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:User_Action_Logs&amp;diff=591005</id>
		<title>J3.x:User Action Logs</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:User_Action_Logs&amp;diff=591005"/>
		<updated>2019-02-05T04:35:59Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Sample of Hooking into Action Logs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{Joomla version|version=3.9}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{Top portal heading|color=white-bkgd|icon=magic|icon-color=#5091cd|size=3x|text-color=#333|title=Tutorial&amp;lt;br /&amp;gt;&lt;br /&gt;
How to Use the New Action Logging System}}&lt;br /&gt;
&lt;br /&gt;
As of Joomla 3.9, Joomla introduced an action logging system.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This system is the finalization of the [https://magazine.joomla.org/issues/issue-aug-2016/item/3111-gsoc-recording-actions-logs-accessible-by-super-admin-status-update &amp;quot;Recording Action Logs&amp;quot; project from GSoC 2016]. This system provides an infrastructure to create an audit log of activity performed on a website and can be fine tuned to the site admin&#039;s preferences. Extensions are able to hook into this system to add custom messages or have the system process standard CRUD actions.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this tutorial, you will find information on how to set up this new system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: Only Super Users have access to the Action Logging system.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Component== &lt;br /&gt;
&lt;br /&gt;
===User Actions Log Dashboard=== &lt;br /&gt;
Navigate to {{rarr|Users,User Actions Log}} to access the dashboard.&lt;br /&gt;
&lt;br /&gt;
[[Image:Joomla-39-action-logs-dashboard-en.png|800px]]&lt;br /&gt;
&lt;br /&gt;
From this screen a Super User has a global overview of all activities performed on a site by users and has the ability to review, export, delete and purge entries.&lt;br /&gt;
&lt;br /&gt;
To learn more, please see:&lt;br /&gt;
*[[S:MyLanguage/Help38:Components_Actionlogs|User Actions Log interface]] &lt;br /&gt;
*[[S:MyLanguage/Help38:Components_User_Actionlogs_Options| User Actions Log Options]]&lt;br /&gt;
&lt;br /&gt;
==Plugin== &lt;br /&gt;
&lt;br /&gt;
===System - User Actions Log=== &lt;br /&gt;
Once enabled, this plugin allows to define the number of days after which the logs will be deleted.&lt;br /&gt;
&lt;br /&gt;
===Action Log===&lt;br /&gt;
Once enabled, this plugin allows to record the actions of users for the core extensions.&lt;br /&gt;
&lt;br /&gt;
===Privacy - Action Logs=== &lt;br /&gt;
Once enabled, this plugin allows to export the action log data for a user&#039;s privacy request.&lt;br /&gt;
&lt;br /&gt;
==Module== &lt;br /&gt;
&lt;br /&gt;
===Action Logs - Latest Module=== &lt;br /&gt;
This admin module shows on the control panel a list of the latest actions performed on a site.&lt;br /&gt;
&lt;br /&gt;
[[Image:Joomla-39-action-logs-latest-module-en.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The module is not displayed by default on sites upgrading to Joomla 3.9. In order to display it on your control panel, navigate to {{rarr|Extensions,Manage,Manage,Enable the System - User Actions Log plugin}} and then go to {{rarr|Extensions,Modules,Administrator,New,Action Logs-Latest}}&lt;br /&gt;
&lt;br /&gt;
Please see also: [[S:MyLanguage/Help38:Extensions_Module_Manager_Admin_Latestactions|Latest Actions Admin Module]].&lt;br /&gt;
&lt;br /&gt;
==How to hook an extension to the system== &lt;br /&gt;
I was very keen to utilise this function from within one of my components and so this is my attempt to help others who wish to do the same.  Please feel free to edit this section where my code can be improved or corrected.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Component Installation Script===&lt;br /&gt;
Add the extension to the table (#__action_logs_extensions) so that it will appear in the configuration of User Action Logs.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
        $extension = &#039;com_mycomponent&#039;;&lt;br /&gt;
        $db = Factory::getDbo();&lt;br /&gt;
        $db-&amp;gt;setQuery(&#039; INSERT into #__action_logs_extensions (extension) VALUES (&#039;.$db-&amp;gt;Quote($extension).&#039;) &#039; );&lt;br /&gt;
	    try {&lt;br /&gt;
	        // If it fails, it will throw a RuntimeException&lt;br /&gt;
	        $result = $db-&amp;gt;execute();&lt;br /&gt;
	    } catch (RuntimeException $e) {&lt;br /&gt;
	        Factory::getApplication()-&amp;gt;enqueueMessage($e-&amp;gt;getMessage());&lt;br /&gt;
	        return false;&lt;br /&gt;
	    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Add the extension configuration to the table (#__action_log_config) so that your actions data will be captured.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
		$logConf = new stdClass();&lt;br /&gt;
		$logConf-&amp;gt;id = 0;&lt;br /&gt;
		$logConf-&amp;gt;type_title = &#039;transaction&#039;;&lt;br /&gt;
		$logConf-&amp;gt;type_alias = $extension;&lt;br /&gt;
		$logConf-&amp;gt;id_holder = &#039;id&#039;;&lt;br /&gt;
		$logConf-&amp;gt;title_holder = &#039;trans_desc&#039;;&lt;br /&gt;
		$logConf-&amp;gt;table_name = &#039;#__mycomponent_transaction&#039;;&lt;br /&gt;
		$logConf-&amp;gt;text_prefix = &#039;COM_MYCOMPONENT_TRANSACTION&#039;;&lt;br /&gt;
&lt;br /&gt;
	    try {&lt;br /&gt;
	       	// If it fails, it will throw a RuntimeException&lt;br /&gt;
			// Insert the object into the table.&lt;br /&gt;
			$result = Factory::getDbo()-&amp;gt;insertObject(&#039;#__action_log_config&#039;, $logConf);&lt;br /&gt;
	    } catch (RuntimeException $e) {&lt;br /&gt;
	        Factory::getApplication()-&amp;gt;enqueueMessage($e-&amp;gt;getMessage());&lt;br /&gt;
	        return false;&lt;br /&gt;
	    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Of course it would be best to perform some checking to ensure that the record doesn&#039;t already exist.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
===Component Helper===&lt;br /&gt;
I utilise my component helper to perform the storing of actions.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
	/**&lt;br /&gt;
	 * Record transaction details in log record&lt;br /&gt;
	 * @param   object  $user    Saves getting the current user again.&lt;br /&gt;
	 * @param   int     $tran_id  The transaction id just created or updated&lt;br /&gt;
	 * @param   int     $id  Passed id reference from the form to identify if new record&lt;br /&gt;
	 * @return  boolean	True&lt;br /&gt;
	 */&lt;br /&gt;
    public static function recordActionLog($user = null, $tran_id = 0, $id = 0)&lt;br /&gt;
	{&lt;br /&gt;
			// get the component details such as the id&lt;br /&gt;
		$extension =  MycomponentHelper::getExtensionDetails(&#039;com_mycomponent&#039;);&lt;br /&gt;
		// get the transaction details for use in the log for easy reference&lt;br /&gt;
        $tran = MycomponentHelper::getTransaction($tran_id);&lt;br /&gt;
        $con_type = &amp;quot;transaction&amp;quot;;&lt;br /&gt;
        if ($id === 0) { $type = &#039;New &#039;; } else { $type = &#039;Update &#039;; }&lt;br /&gt;
&lt;br /&gt;
		$message = array();&lt;br /&gt;
		$message[&#039;action&#039;] = $con_type;&lt;br /&gt;
		$message[&#039;type&#039;] = $type . $tran-&amp;gt;tran_type . &#039; - &#039;.$tran-&amp;gt;tran_desc . &#039; $&#039; . $tran-&amp;gt;tran_amount;&lt;br /&gt;
		$message[&#039;id&#039;] = $tran-&amp;gt;id;&lt;br /&gt;
		$message[&#039;title&#039;] = $extension-&amp;gt;name;&lt;br /&gt;
		$message[&#039;extension_name&#039;] = $extension-&amp;gt;name;&lt;br /&gt;
		$message[&#039;itemlink&#039;] = &amp;quot;index.php?option=com_mycomponent&amp;amp;task=transaction.edit&amp;amp;id=&amp;quot;.$tran-&amp;gt;id;&lt;br /&gt;
		$message[&#039;userid&#039;] = $user-&amp;gt;id;&lt;br /&gt;
		$message[&#039;username&#039;] = $user-&amp;gt;username;&lt;br /&gt;
		$message[&#039;accountlink&#039;] = &amp;quot;index.php?option=com_users&amp;amp;task=user.edit&amp;amp;id=&amp;quot;.$user-&amp;gt;id;&lt;br /&gt;
		&lt;br /&gt;
		$messages = array($message);&lt;br /&gt;
		&lt;br /&gt;
		$messageLanguageKey = Text::_(&#039;COM_MYCOMPONENT_TRANSACTION_LINK&#039;);&lt;br /&gt;
		$context = $extension-&amp;gt;name.&#039;.&#039;.$con_type;&lt;br /&gt;
		&lt;br /&gt;
		$fmodel = MycomponentHelper::getForeignModel(&#039;Actionlog&#039;, &#039;ActionlogsModel&#039;);&lt;br /&gt;
&lt;br /&gt;
		$fmodel-&amp;gt;addLog($messages, $messageLanguageKey, $context, $user-&amp;gt;id);&lt;br /&gt;
&lt;br /&gt;
		return true;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the Model from another component for use&lt;br /&gt;
	 * @param   string  $name    The model name. Optional. Default to my own for safety.&lt;br /&gt;
	 * @param   string  $prefix  The class prefix. Optional&lt;br /&gt;
	 * @param   array   $config  Configuration array for model. Optional&lt;br /&gt;
	 * @return object	The model&lt;br /&gt;
	 */&lt;br /&gt;
	public function getForeignModel($name = &#039;Transaction&#039;, $prefix = &#039;MycomponentModel&#039;, $config = array(&#039;ignore_request&#039; =&amp;gt; true))&lt;br /&gt;
	{&lt;br /&gt;
		ItemModel::addIncludePath(JPATH_ADMINISTRATOR . &#039;/components/com_actionlogs/models&#039;, &#039;ActionlogsModelActionlog&#039;);&lt;br /&gt;
		$fmodel = ItemModel::getInstance($name, $prefix, $config);&lt;br /&gt;
&lt;br /&gt;
		return $fmodel;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
===Front End Transaction Form===&lt;br /&gt;
Now that the foundations are set, we just need to trigger the process.  I&#039;m capturing information about a transaction that is created or update and I have a model called transactionform.php.  It is in the Save method that I want to capture a log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
	// So the code above this point checks and does what it should do and then after the successful save of the record, we check for the parameter setting to see if logging is required, we pass key elements to recordActionLog.&lt;br /&gt;
        $table = $this-&amp;gt;getTable();&lt;br /&gt;
&lt;br /&gt;
        if ($table-&amp;gt;save($data) === true) {&lt;br /&gt;
&lt;br /&gt;
			/* ---------------------------------------------------------------- */&lt;br /&gt;
			// trigger transaction log if required&lt;br /&gt;
			$act_log = $params-&amp;gt;get(&#039;act_log&#039;, 0);&lt;br /&gt;
			if ($act_log &amp;amp;&amp;amp; $table-&amp;gt;id) {&lt;br /&gt;
				// gather information and log in a new action log record&lt;br /&gt;
				MycomponentHelper::recordActionLog($user, $table-&amp;gt;id, $data[&#039;id&#039;]);&lt;br /&gt;
			}&lt;br /&gt;
			/* ---------------------------------------------------------------- */&lt;br /&gt;
&lt;br /&gt;
            return $table-&amp;gt;id;&lt;br /&gt;
        } else {&lt;br /&gt;
            return false;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
===Language File===&lt;br /&gt;
Finally, to help with the Action Log Listing in the admin side of Joomla!, we want to set some key elements of data to be displayed in the language file en-GB.com_mycomponent.ini.&amp;lt;br /&amp;gt;&lt;br /&gt;
COM_MYCOMPONENT_TRANSACTION_LINK=&amp;quot;User &amp;lt;a href=&#039;{accountlink}&#039;&amp;gt;{username}&amp;lt;/a&amp;gt; created a transaction ( &amp;lt;a href=&#039;{itemlink}&#039;&amp;gt;{type}&amp;lt;/a&amp;gt; )&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Hope this helps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Components]]&lt;br /&gt;
[[Category:Joomla! 3.9]]&lt;br /&gt;
[[Category:Plugins]]&lt;br /&gt;
[[Category:Modules]]&lt;br /&gt;
[[Category:User Action Logs]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Captcha_form_field_type&amp;diff=262880</id>
		<title>Captcha form field type</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Captcha_form_field_type&amp;diff=262880"/>
		<updated>2015-11-20T04:45:34Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Add namespace but I don&amp;#039;t know what it means.&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;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
Provides the use of a captcha plugin.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;type&#039;&#039;&#039; (mandatory) must be &#039;&#039;captcha&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; (mandatory) is the unique name of the field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;validate&#039;&#039;&#039; (mandatory optional ?) must be &#039;&#039;captcha&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;label&#039;&#039;&#039; (mandatory) (translatable) is the descriptive title of the field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039; (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;namespace&#039;&#039;&#039; (optional) this is used on the com_contact component but I don&#039;t know enough about it to comment.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
Example XML Definition:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source type=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field name=&amp;quot;captcha&amp;quot; type=&amp;quot;captcha&amp;quot; validate=&amp;quot;captcha&amp;quot;&lt;br /&gt;
	namespace=&amp;quot;contact&amp;quot;&lt;br /&gt;
	label=&amp;quot;COM_CONTACT_CAPTCHA_LABEL&amp;quot;&lt;br /&gt;
	description=&amp;quot;COM_CONTACT_CAPTCHA_DESC&amp;quot; &amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;	&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
[[Category:Standard form field types]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Captcha_form_field_type&amp;diff=262879</id>
		<title>Captcha form field type</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Captcha_form_field_type&amp;diff=262879"/>
		<updated>2015-11-20T04:38:51Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Change this to show how to use the captcha formfield rather than how to use the plugin type to select a captcha plugin.&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;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
Provides the use of a captcha plugin.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;type&#039;&#039;&#039; (mandatory) must be &#039;&#039;captcha&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; (mandatory) is the unique name of the field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;validate&#039;&#039;&#039; (mandatory optional ?) must be &#039;&#039;captcha&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;label&#039;&#039;&#039; (mandatory) (translatable) is the descriptive title of the field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039; (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
Example XML Definition:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source type=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field name=&amp;quot;captcha&amp;quot; type=&amp;quot;captcha&amp;quot; validate=&amp;quot;captcha&amp;quot;&lt;br /&gt;
	label=&amp;quot;COM_CONTACT_FIELD_CAPTCHA_LABEL&amp;quot;&lt;br /&gt;
	description=&amp;quot;COM_CONTACT_FIELD_CAPTCHA_DESC&amp;quot; &amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;	&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
[[Category:Standard form field types]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Plugins_form_field_type&amp;diff=262878</id>
		<title>Plugins form field type</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Plugins_form_field_type&amp;diff=262878"/>
		<updated>2015-11-20T04:34:18Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Add captcha example&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;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
Provides a dropdown list of plugin options from the folder.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; (mandatory) is the unique name of the parameter.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;type&#039;&#039;&#039; (mandatory) must be &#039;&#039;plugin&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;folder&#039;&#039;&#039; (mandatory) &#039;&#039;editor&#039;&#039; or &#039;&#039;captcha&#039;&#039;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;label&#039;&#039;&#039; (mandatory) (translatable) is the descriptive title of the field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039; description text for the form field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
Example XML Definition:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source type=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;field name=&amp;quot;editor&amp;quot; type=&amp;quot;plugins&amp;quot; folder=&amp;quot;editors&amp;quot;&lt;br /&gt;
	description=&amp;quot;COM_USERS_USER_FIELD_EDITOR_DESC&amp;quot;&lt;br /&gt;
	label=&amp;quot;COM_USERS_USER_FIELD_EDITOR_LABEL&amp;quot; &amp;gt;&lt;br /&gt;
	&amp;lt;option value=&amp;quot;&amp;quot;&amp;gt;JOPTION_USE_DEFAULT&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&amp;lt;field name=&amp;quot;captcha&amp;quot; type=&amp;quot;plugins&amp;quot; folder=&amp;quot;captcha&amp;quot;&lt;br /&gt;
	label=&amp;quot;COM_CONTACT_FIELD_CAPTCHA_LABEL&amp;quot;&lt;br /&gt;
	description=&amp;quot;COM_CONTACT_FIELD_CAPTCHA_DESC&amp;quot;&lt;br /&gt;
	default=&amp;quot;&amp;quot; &lt;br /&gt;
	filter=&amp;quot;cmd&amp;quot; &amp;gt;&lt;br /&gt;
	&amp;lt;option value=&amp;quot;&amp;quot;&amp;gt;JOPTION_USE_DEFAULT&amp;lt;/option&amp;gt;&lt;br /&gt;
	&amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JOPTION_DO_NOT_USE&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
[[Category:Standard form field types]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Standard_form_field_types&amp;diff=262877</id>
		<title>Standard form field types</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Standard_form_field_types&amp;diff=262877"/>
		<updated>2015-11-20T04:30:27Z</updated>

		<summary type="html">&lt;p&gt;Garkell: &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;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
Numerous types of [[S:MyLanguage/form field|form field]] are built into Joomla!. The following table lists these standard types and their availability. Use the [[S:MyLanguage/Standard_form_field_types/Single-page_reference|single-page reference]] if you want to print all existing form field documentation.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
{{JVer|1.5}} Please note that many of these fields are available as [[S:MyLanguage/Parameter|parameter types]] in Joomla! 1.5. For a list of parameter types, see [[S:MyLanguage/J1.5:Standard parameter types|J1.5:Standard parameter types]]. For a comparison between form field and parameter types, see [[S:MyLanguage/Standard form field and parameter types|Standard form field and parameter types]].&amp;lt;/translate&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;vertical-align:top; border:1px solid Sienna; background-color:Cornsilk;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:Wheat; font-weight:bold; text-align: left;&amp;quot;&lt;br /&gt;
!width=15%|&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
Type&amp;lt;/translate&amp;gt;&lt;br /&gt;
!width=65%|&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
Description&amp;lt;/translate&amp;gt;&lt;br /&gt;
!width=20%|&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Availability&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Accesslevel form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
accesslevel&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
provides a drop down list of viewing access levels.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Cachehandler form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
cachehandler&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
provides a list of available cache handling options.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Calendar form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
calendar&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Captcha form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
captcha&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
provides the use of a captcha plugin.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Category form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
category&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
provides a drop down list of categories for an extension.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Checkbox form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
checkbox&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
provides a single checkbox to be checked or unchecked&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Checkboxes form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
checkboxes&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
provides unlimited checkboxes that can be used for multi-select.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/ChromeStyle form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
Chrome Style&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
provides a list of template chrome style options grouped by template.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.0}} &amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Color form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
color&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
provides a color picker when clicking the input box.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/ContentLanguage form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Content Language&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
Provides a list of content languages.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Contenttype form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Content Type&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Provides a list of content types.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.1}} &amp;lt;translate&amp;gt;&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Combo form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
combo&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
provides a combo box field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Componentlayout form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
componentlayout&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
provides a grouped list of core and template alternate layouts for a component item.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Contentlanguage form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
contentlanguage&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
provides a list of installed content languages for use in conjunction with the language switcher plugin.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/DatabaseConnection form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Database Connection&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Provides a list of available database connections, optionally limiting to a given list.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Editor form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
editor&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
provides an editor area field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|1.6}} &amp;lt;translate&amp;gt;&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Editors form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
editors&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
Provides a drop down list of the available WYSIWYG editors. Since {{JVer|2.5}} use [[S:MyLanguage/Plugins form field type|plugins form field]] instead.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|1.6}}&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Email form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
email&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
provides an email field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/File form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
file&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Provides an input field for files&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Filelist form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
filelist&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
provides a drop down list of files from a specified directory.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Folderlist form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
folderlist&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
provides a drop down list of folders from a specified directory.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Groupedlist form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
groupedlist&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
provides a drop down list of items organized into groups.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/HeaderTag form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
header tag&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
provides a drop down list of the header tags (h1-h6)&amp;lt;/translate&amp;gt;.&lt;br /&gt;
|{{JVer|3.0}} &amp;lt;translate&amp;gt;&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Helpsite form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
helpsite&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
provides a drop down list of the help sites for your Joomla installation.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Hidden form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
hidden&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
provides a hidden field for saving a form field whose value cannot be altered directly by a user in the Administrator (it can be altered in code or by editing the &#039;&#039;params.ini&#039;&#039; file).&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Imagelist form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
imagelist&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
provides a drop down list of image files in a specified directory.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Integer form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
integer&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
provides a drop down list of integers between a minimum and maximum.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Language form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
language&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
provides a drop down list of the installed languages for the Front-end or Back-end.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/List form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
list&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
provides a drop down list of custom-defined entries.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Media form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
media&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
provides modal access to the media manager for insertion of images with upload for users with appropriate permissions.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Menu form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
menu&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
provides a drop down list of the available menus from your Joomla site.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Menuitem form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
Menu Item&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
provides a drop down list of the available menu items from your Joomla site.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[Meter form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
meter&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
Provides a meter to show value in a range.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.2}} &amp;lt;translate&amp;gt;&amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Modulelayout form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
Module Layout&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
provides a list of alternative layout for a module grouped by core and template.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/ModuleOrder form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
Module Order&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
Provides a drop down to set the ordering of module in a given position&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/ModulePosition form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
Module Position&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
provides a text input to set the position of a module.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/ModuleTag form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
Module Tag&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
provides a list of html5 elements (used to wrap a module in).&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.0}} &amp;lt;translate&amp;gt;&amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Note form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
note&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
supports a one line text field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.1}} &amp;lt;translate&amp;gt;&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Number form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
number&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
Provides a one line text box with up-down handles to set a number in the field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.2}} &amp;lt;translate&amp;gt;&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Password form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
password&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
provides a text box for entry of a password.  The password characters will be obscured as they are entered.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Plugins form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
plugins&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
provides a list of plugins from a given folder.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Predefined List form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
predefinedlist&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
Form Field to load a list of predefined values.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.2}} &amp;lt;translate&amp;gt;&amp;lt;!--T:130--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Radio form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
radio&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
provides radio buttons to select different options.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Range form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
range&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Provides a horizontal scroll bar to specify a value in a range.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.2}} &amp;lt;translate&amp;gt;&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Repeatable form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
repeatable&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
Allows form fields which can have as many options as the user desires.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.2}} &amp;lt;translate&amp;gt;&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Rules form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
rules&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
provides a matrix of group by action options for managing access control. Display depends on context.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Sessionhandler form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
sessionhandler&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
provides a drop down list of session handler options.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Spacer form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
spacer&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
provides a visual separator between form fields.  It is purely a visual aid and no value is stored.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:148--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/SQL form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:149--&amp;gt;&lt;br /&gt;
sql&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:150--&amp;gt;&lt;br /&gt;
provides a drop down list of entries obtained by running a query on the Joomla Database.  The first results column returned by the query provides the values for the drop down box.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:151--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Tag form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:152--&amp;gt;&lt;br /&gt;
tag&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:153--&amp;gt;&lt;br /&gt;
provides an entry point for tags (either AJAX or Nested).&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.1}} &amp;lt;translate&amp;gt;&amp;lt;!--T:154--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Tel form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:155--&amp;gt;&lt;br /&gt;
tel&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:156--&amp;gt;&lt;br /&gt;
provides an input field for a telephone number.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:157--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Templatestyle form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:158--&amp;gt;&lt;br /&gt;
templatestyle&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:159--&amp;gt;&lt;br /&gt;
provides a drop down list of template styles.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:160--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Text form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:161--&amp;gt;&lt;br /&gt;
text&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:162--&amp;gt;&lt;br /&gt;
provides a text box for data entry.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:163--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Textarea form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:164--&amp;gt;&lt;br /&gt;
textarea&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:165--&amp;gt;&lt;br /&gt;
provides a text area for entry of multi-line text.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:166--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Timezone form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:167--&amp;gt;&lt;br /&gt;
timezone&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:168--&amp;gt;&lt;br /&gt;
provides a drop down list of time zones.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:169--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/URL form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:170--&amp;gt;&lt;br /&gt;
URL&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:171--&amp;gt;&lt;br /&gt;
provides a URL text input field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:172--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/User form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:173--&amp;gt;&lt;br /&gt;
user&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:174--&amp;gt;&lt;br /&gt;
Field to select a user from a modal list. Displays User Name and stores User ID&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|1.6}} &amp;lt;translate&amp;gt;&amp;lt;!--T:175--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/UserActive form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:176--&amp;gt;&lt;br /&gt;
useractive&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:177--&amp;gt;&lt;br /&gt;
Field to show a list of available user active statuses.&amp;lt;/translate&amp;gt; &lt;br /&gt;
|{{JVer|3.2}} &amp;lt;translate&amp;gt;&amp;lt;!--T:178--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Usergroup form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:179--&amp;gt;&lt;br /&gt;
usergroup&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:180--&amp;gt;&lt;br /&gt;
provides a drop down list of user groups. Since {{JVer|3.2}} use [[S:MyLanguage/User Group List form field type|usergrouplist]] instead.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:181--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/User Group List form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:182--&amp;gt;&lt;br /&gt;
usergrouplist&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:183--&amp;gt;&lt;br /&gt;
Field to load a drop down list of available user groups. Replaces usergroup form field type.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.2}} &amp;lt;translate&amp;gt;&amp;lt;!--T:184--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/User State form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:185--&amp;gt;&lt;br /&gt;
userstate&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:186--&amp;gt;&lt;br /&gt;
Field to load a list of available users statuses.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.2}} &amp;lt;translate&amp;gt;&amp;lt;!--T:187--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:188--&amp;gt;&lt;br /&gt;
[[Category:Form fields]]&lt;br /&gt;
[[Category:Development Reference]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Standard_form_field_types&amp;diff=262876</id>
		<title>Standard form field types</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Standard_form_field_types&amp;diff=262876"/>
		<updated>2015-11-20T04:29:07Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Changed the captcha formfield to be &amp;quot;use a captcha plugin&amp;quot; rather than a dropdown list to choose a captcha plugin.&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;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
Numerous types of [[S:MyLanguage/form field|form field]] are built into Joomla!. The following table lists these standard types and their availability. Use the [[S:MyLanguage/Standard_form_field_types/Single-page_reference|single-page reference]] if you want to print all existing form field documentation.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
{{JVer|1.5}} Please note that many of these fields are available as [[S:MyLanguage/Parameter|parameter types]] in Joomla! 1.5. For a list of parameter types, see [[S:MyLanguage/J1.5:Standard parameter types|J1.5:Standard parameter types]]. For a comparison between form field and parameter types, see [[S:MyLanguage/Standard form field and parameter types|Standard form field and parameter types]].&amp;lt;/translate&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;vertical-align:top; border:1px solid Sienna; background-color:Cornsilk;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:Wheat; font-weight:bold; text-align: left;&amp;quot;&lt;br /&gt;
!width=15%|&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
Type&amp;lt;/translate&amp;gt;&lt;br /&gt;
!width=65%|&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
Description&amp;lt;/translate&amp;gt;&lt;br /&gt;
!width=20%|&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Availability&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Accesslevel form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
accesslevel&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
provides a drop down list of viewing access levels.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Cachehandler form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
cachehandler&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
provides a list of available cache handling options.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Calendar form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
calendar&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Captcha form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
captcha&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
provides a the use of a captcha plugin.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Category form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
category&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
provides a drop down list of categories for an extension.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Checkbox form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
checkbox&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
provides a single checkbox to be checked or unchecked&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Checkboxes form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
checkboxes&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
provides unlimited checkboxes that can be used for multi-select.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/ChromeStyle form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
Chrome Style&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
provides a list of template chrome style options grouped by template.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.0}} &amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Color form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
color&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
provides a color picker when clicking the input box.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/ContentLanguage form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Content Language&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
Provides a list of content languages.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Contenttype form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Content Type&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Provides a list of content types.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.1}} &amp;lt;translate&amp;gt;&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Combo form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
combo&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
provides a combo box field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Componentlayout form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
componentlayout&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
provides a grouped list of core and template alternate layouts for a component item.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Contentlanguage form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
contentlanguage&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
provides a list of installed content languages for use in conjunction with the language switcher plugin.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/DatabaseConnection form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Database Connection&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Provides a list of available database connections, optionally limiting to a given list.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Editor form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
editor&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
provides an editor area field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|1.6}} &amp;lt;translate&amp;gt;&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Editors form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
editors&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
Provides a drop down list of the available WYSIWYG editors. Since {{JVer|2.5}} use [[S:MyLanguage/Plugins form field type|plugins form field]] instead.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|1.6}}&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Email form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
email&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
provides an email field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/File form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
file&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Provides an input field for files&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Filelist form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
filelist&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
provides a drop down list of files from a specified directory.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Folderlist form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
folderlist&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
provides a drop down list of folders from a specified directory.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Groupedlist form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
groupedlist&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
provides a drop down list of items organized into groups.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/HeaderTag form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
header tag&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
provides a drop down list of the header tags (h1-h6)&amp;lt;/translate&amp;gt;.&lt;br /&gt;
|{{JVer|3.0}} &amp;lt;translate&amp;gt;&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Helpsite form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
helpsite&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
provides a drop down list of the help sites for your Joomla installation.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Hidden form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
hidden&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
provides a hidden field for saving a form field whose value cannot be altered directly by a user in the Administrator (it can be altered in code or by editing the &#039;&#039;params.ini&#039;&#039; file).&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Imagelist form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
imagelist&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
provides a drop down list of image files in a specified directory.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Integer form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
integer&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
provides a drop down list of integers between a minimum and maximum.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Language form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
language&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
provides a drop down list of the installed languages for the Front-end or Back-end.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/List form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
list&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
provides a drop down list of custom-defined entries.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Media form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:92--&amp;gt;&lt;br /&gt;
media&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
provides modal access to the media manager for insertion of images with upload for users with appropriate permissions.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Menu form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:95--&amp;gt;&lt;br /&gt;
menu&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:96--&amp;gt;&lt;br /&gt;
provides a drop down list of the available menus from your Joomla site.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Menuitem form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
Menu Item&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
provides a drop down list of the available menu items from your Joomla site.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[Meter form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
meter&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
Provides a meter to show value in a range.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.2}} &amp;lt;translate&amp;gt;&amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Modulelayout form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
Module Layout&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
provides a list of alternative layout for a module grouped by core and template.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:106--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/ModuleOrder form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
Module Order&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
Provides a drop down to set the ordering of module in a given position&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:109--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/ModulePosition form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:110--&amp;gt;&lt;br /&gt;
Module Position&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:111--&amp;gt;&lt;br /&gt;
provides a text input to set the position of a module.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/ModuleTag form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
Module Tag&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
provides a list of html5 elements (used to wrap a module in).&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.0}} &amp;lt;translate&amp;gt;&amp;lt;!--T:115--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Note form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:116--&amp;gt;&lt;br /&gt;
note&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
supports a one line text field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.1}} &amp;lt;translate&amp;gt;&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Number form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:119--&amp;gt;&lt;br /&gt;
number&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:120--&amp;gt;&lt;br /&gt;
Provides a one line text box with up-down handles to set a number in the field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.2}} &amp;lt;translate&amp;gt;&amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Password form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
password&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:123--&amp;gt;&lt;br /&gt;
provides a text box for entry of a password.  The password characters will be obscured as they are entered.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:124--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Plugins form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:125--&amp;gt;&lt;br /&gt;
plugins&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:126--&amp;gt;&lt;br /&gt;
provides a list of plugins from a given folder.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:127--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Predefined List form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:128--&amp;gt;&lt;br /&gt;
predefinedlist&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:129--&amp;gt;&lt;br /&gt;
Form Field to load a list of predefined values.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.2}} &amp;lt;translate&amp;gt;&amp;lt;!--T:130--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Radio form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:131--&amp;gt;&lt;br /&gt;
radio&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:132--&amp;gt;&lt;br /&gt;
provides radio buttons to select different options.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:133--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Range form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
range&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Provides a horizontal scroll bar to specify a value in a range.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.2}} &amp;lt;translate&amp;gt;&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Repeatable form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
repeatable&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
Allows form fields which can have as many options as the user desires.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.2}} &amp;lt;translate&amp;gt;&amp;lt;!--T:139--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Rules form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:140--&amp;gt;&lt;br /&gt;
rules&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:141--&amp;gt;&lt;br /&gt;
provides a matrix of group by action options for managing access control. Display depends on context.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:142--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Sessionhandler form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:143--&amp;gt;&lt;br /&gt;
sessionhandler&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:144--&amp;gt;&lt;br /&gt;
provides a drop down list of session handler options.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Spacer form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
spacer&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
provides a visual separator between form fields.  It is purely a visual aid and no value is stored.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:148--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/SQL form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:149--&amp;gt;&lt;br /&gt;
sql&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:150--&amp;gt;&lt;br /&gt;
provides a drop down list of entries obtained by running a query on the Joomla Database.  The first results column returned by the query provides the values for the drop down box.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:151--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Tag form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:152--&amp;gt;&lt;br /&gt;
tag&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:153--&amp;gt;&lt;br /&gt;
provides an entry point for tags (either AJAX or Nested).&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.1}} &amp;lt;translate&amp;gt;&amp;lt;!--T:154--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Tel form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:155--&amp;gt;&lt;br /&gt;
tel&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:156--&amp;gt;&lt;br /&gt;
provides an input field for a telephone number.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:157--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Templatestyle form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:158--&amp;gt;&lt;br /&gt;
templatestyle&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:159--&amp;gt;&lt;br /&gt;
provides a drop down list of template styles.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:160--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Text form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:161--&amp;gt;&lt;br /&gt;
text&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:162--&amp;gt;&lt;br /&gt;
provides a text box for data entry.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:163--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Textarea form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:164--&amp;gt;&lt;br /&gt;
textarea&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:165--&amp;gt;&lt;br /&gt;
provides a text area for entry of multi-line text.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:166--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Timezone form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:167--&amp;gt;&lt;br /&gt;
timezone&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:168--&amp;gt;&lt;br /&gt;
provides a drop down list of time zones.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:169--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/URL form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:170--&amp;gt;&lt;br /&gt;
URL&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:171--&amp;gt;&lt;br /&gt;
provides a URL text input field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:172--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/User form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:173--&amp;gt;&lt;br /&gt;
user&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:174--&amp;gt;&lt;br /&gt;
Field to select a user from a modal list. Displays User Name and stores User ID&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|1.6}} &amp;lt;translate&amp;gt;&amp;lt;!--T:175--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/UserActive form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:176--&amp;gt;&lt;br /&gt;
useractive&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:177--&amp;gt;&lt;br /&gt;
Field to show a list of available user active statuses.&amp;lt;/translate&amp;gt; &lt;br /&gt;
|{{JVer|3.2}} &amp;lt;translate&amp;gt;&amp;lt;!--T:178--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/Usergroup form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:179--&amp;gt;&lt;br /&gt;
usergroup&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:180--&amp;gt;&lt;br /&gt;
provides a drop down list of user groups. Since {{JVer|3.2}} use [[S:MyLanguage/User Group List form field type|usergrouplist]] instead.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|2.5}} &amp;lt;translate&amp;gt;&amp;lt;!--T:181--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/User Group List form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:182--&amp;gt;&lt;br /&gt;
usergrouplist&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:183--&amp;gt;&lt;br /&gt;
Field to load a drop down list of available user groups. Replaces usergroup form field type.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.2}} &amp;lt;translate&amp;gt;&amp;lt;!--T:184--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[S:MyLanguage/User State form field type|&amp;lt;translate&amp;gt;&amp;lt;!--T:185--&amp;gt;&lt;br /&gt;
userstate&amp;lt;/translate&amp;gt;]]&lt;br /&gt;
|&amp;lt;translate&amp;gt;&amp;lt;!--T:186--&amp;gt;&lt;br /&gt;
Field to load a list of available users statuses.&amp;lt;/translate&amp;gt;&lt;br /&gt;
|{{JVer|3.2}} &amp;lt;translate&amp;gt;&amp;lt;!--T:187--&amp;gt;&lt;br /&gt;
and newer&amp;lt;/translate&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:188--&amp;gt;&lt;br /&gt;
[[Category:Form fields]]&lt;br /&gt;
[[Category:Development Reference]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Using_JLog&amp;diff=126861</id>
		<title>Using JLog</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Using_JLog&amp;diff=126861"/>
		<updated>2014-10-06T06:20:34Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Added comma in the addLogger array.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version|2.5,3.2|platform=11.1}}{{RightTOC}}&lt;br /&gt;
Using JLog can be very useful in components when analysing the performance of custom extensions - or analysing where extensions are giving issues. Note this should be used in tandem with php exceptions - not as a replacement. See [[Exceptions and Logging in Joomla 1.7 and Joomla Platform 11.1]] for more information on this&lt;br /&gt;
&lt;br /&gt;
== Calling the class ==&lt;br /&gt;
&lt;br /&gt;
To use JLog you need to call the JLog class. Done through the following code:&lt;br /&gt;
&lt;br /&gt;
    jimport(&#039;joomla.log.log&#039;);&lt;br /&gt;
&lt;br /&gt;
== Basic File Logging ==&lt;br /&gt;
&lt;br /&gt;
Often you may wish to display an error log message and log to an error file. Joomla allows this natively through the [[JLog::add]] function. For example:&lt;br /&gt;
&lt;br /&gt;
    JLog::add(JText::_(&#039;JTEXT_ERROR_MESSAGE&#039;), JLog::WARNING, &#039;jerror&#039;);&lt;br /&gt;
&lt;br /&gt;
Adding the category of jerror means that this message will also be displayed to users. To only write to file you can easily drop that parameter and simply use &lt;br /&gt;
&lt;br /&gt;
    JLog::add(JText::_(&#039;JTEXT_ERROR_MESSAGE&#039;), JLog::WARNING);&lt;br /&gt;
&lt;br /&gt;
== Logging a specific extension ==&lt;br /&gt;
Sometimes it may be useful to log the errors to a specific file. In this case you can &lt;br /&gt;
&lt;br /&gt;
    JLog::addLogger(&lt;br /&gt;
        array(&lt;br /&gt;
             // Sets file name&lt;br /&gt;
             &#039;text_file&#039; =&amp;gt; &#039;com_helloworld.errors.php&#039;&lt;br /&gt;
        ),&lt;br /&gt;
        // Sets messages of all log levels to be sent to the file&lt;br /&gt;
        JLog::ALL,&lt;br /&gt;
        // The log category/categories which should be recorded in this file&lt;br /&gt;
        // In this case, it&#039;s just the one category from our extension, still&lt;br /&gt;
        // we need to put it inside an array&lt;br /&gt;
        array(&#039;com_helloworld&#039;)&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
Now remember to change the category when you add a log message. Such as in the example below.&lt;br /&gt;
&lt;br /&gt;
    JLog::add(JText::_(&#039;JTEXT_ERROR_MESSAGE&#039;), JLog::WARNING, &#039;com_helloworld&#039;);&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You may wish to combine this with the [[Display error messages and notices]] section to display visable error notifications to users.&lt;br /&gt;
&lt;br /&gt;
== Logging specific priorities ==&lt;br /&gt;
&lt;br /&gt;
You can also add an additional logger to capture only critical and emergency log notifications:&lt;br /&gt;
&lt;br /&gt;
    JLog::addLogger(&lt;br /&gt;
        array(&lt;br /&gt;
             // Sets file name&lt;br /&gt;
             &#039;text_file&#039; =&amp;gt; &#039;com_helloworld.critical_emergency.php&#039;&lt;br /&gt;
        ),&lt;br /&gt;
        // Sets critical and emergency log level messages to be sent to the file&lt;br /&gt;
        JLog::CRITICAL + JLog::EMERGENCY,&lt;br /&gt;
        // The log category which should be recorded in this file&lt;br /&gt;
        array(&#039;com_helloworld&#039;)&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
You can also exclude a specific category from being included. For example, to log all but DEBUG messages:&lt;br /&gt;
&lt;br /&gt;
    JLog::addLogger(&lt;br /&gt;
        array(&lt;br /&gt;
             // Sets file name&lt;br /&gt;
             &#039;text_file&#039; =&amp;gt; &#039;com_helloworld.all_but_debug.php&#039;&lt;br /&gt;
        ),&lt;br /&gt;
        // Sets all but DEBUG log level messages to be sent to the file&lt;br /&gt;
        JLog::ALL &amp;amp; ~JLog::DEBUG,&lt;br /&gt;
        // The log category which should be recorded in this file&lt;br /&gt;
        array(&#039;com_helloworld&#039;)&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
Notice how bitwise operations (bitwise AND, &amp;amp;; and bitwise NOT, ~)&lt;br /&gt;
are used to calculate the accepted log levels.&lt;br /&gt;
&lt;br /&gt;
== Formatting the logfile ==&lt;br /&gt;
&lt;br /&gt;
The first parameter to addLogger can have a few optional additional settings&lt;br /&gt;
in addition to the &#039;text_file&#039; entry.&lt;br /&gt;
&lt;br /&gt;
There is for example the entry &#039;&#039;&#039;text_entry_format&#039;&#039;&#039;, specifying the format&lt;br /&gt;
of each line in your logfile.&lt;br /&gt;
&lt;br /&gt;
The default format is&lt;br /&gt;
&lt;br /&gt;
    &#039;{DATETIME} {PRIORITY}      {CATEGORY}      {MESSAGE}&#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of a different format which shows how to omit the category:&lt;br /&gt;
&lt;br /&gt;
    JLog::addLogger(&lt;br /&gt;
        array(&lt;br /&gt;
             // Sets file name&lt;br /&gt;
             &#039;text_file&#039; =&amp;gt; &#039;com_helloworld.critical_emergency.php&#039;,&lt;br /&gt;
             // Sets the format of each line&lt;br /&gt;
             &#039;text_entry_format&#039; =&amp;gt; &#039;{DATETIME} {PRIORITY} {MESSAGE}&#039;&lt;br /&gt;
        ),&lt;br /&gt;
        // Sets all but DEBUG log level messages to be sent to the file&lt;br /&gt;
        JLog::ALL &amp;amp; ~JLog::DEBUG,&lt;br /&gt;
        // The log category which should be recorded in this file&lt;br /&gt;
        array(&#039;com_helloworld&#039;)&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
In addition to the placeholders shown above in the default string, the following&lt;br /&gt;
values are available:&lt;br /&gt;
&lt;br /&gt;
    {CLIENTIP}&lt;br /&gt;
    {TIME}&lt;br /&gt;
    {DATE}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There is an additional optional boolean parameter &#039;&#039;&#039;text_file_no_php&#039;&#039;&#039;, which specifies&lt;br /&gt;
whether the log file is prepended with the usual prefix of&lt;br /&gt;
&lt;br /&gt;
    #&lt;br /&gt;
    #&amp;lt;?php die(&#039;Forbidden.&#039;);?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Usually you should not set this setting to false. Log files should not be readable&lt;br /&gt;
from the outside, since they can provide valuable information about your system for attackers.&lt;br /&gt;
Only dabble with this if you know what you&#039;re doing!&lt;br /&gt;
&lt;br /&gt;
Furthermore, if you want to store the log file somewhere else than the logging path configured&lt;br /&gt;
in the Joomla! settings, you can there is the &#039;&#039;&#039;text_file_path&#039;&#039;&#039; setting.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[category:Joomla! 1.7]]&lt;br /&gt;
[[category:Joomla! 2.5]]&lt;br /&gt;
[[category:Joomla! 3.0]]&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Editor_form_field_type&amp;diff=120279</id>
		<title>Editor form field type</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Editor_form_field_type&amp;diff=120279"/>
		<updated>2014-06-15T06:01:13Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Add example for buttons and hiding specific ones&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Editor&#039;&#039;&#039; field type provides a WYSIWYG editor.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;type&#039;&#039;&#039; (mandatory) must be &#039;&#039;editor&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; (mandatory) is the unique name of the parameter.&lt;br /&gt;
* &#039;&#039;&#039;label&#039;&#039;&#039; (mandatory) (translatable) is the descriptive title of the field.&lt;br /&gt;
* &#039;&#039;&#039;width&#039;&#039;&#039; (optional) defines the width (in pixels) of the wysiwyg editor and defaults to 100%.&lt;br /&gt;
* &#039;&#039;&#039;height&#039;&#039;&#039; (optional) defines the height (in pixels) of the wysiwyg editor and defaults to 250px.&lt;br /&gt;
* &#039;&#039;&#039;cols&#039;&#039;&#039; (optional) defines the width of the editor (in columns).&lt;br /&gt;
* &#039;&#039;&#039;rows&#039;&#039;&#039; (optional) defines the height of the editor (in rows).&lt;br /&gt;
* &#039;&#039;&#039;buttons&#039;&#039;&#039; (optional) can be an array of plugin buttons to be excluded or set to false. The default editors-xtd are: article, image, pagebreak and readmore.&lt;br /&gt;
* &#039;&#039;&#039;hide&#039;&#039;&#039; (optional) array of plugin buttons to be hidden. eg... set buttons=&amp;quot;true&amp;quot; hide=&amp;quot;readmore,pagebreak&amp;quot;&lt;br /&gt;
* &#039;&#039;&#039;editor&#039;&#039;&#039; specifies the editor to be used and can include two options (editor=&amp;quot;desired|alternative&amp;quot;)&lt;br /&gt;
* &#039;&#039;&#039;filter&#039;&#039;&#039; (optional) allow the system to save certain html tags or raw data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example XML Definition&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;field name=&amp;quot;test1&amp;quot; label =&amp;quot;Test Field&amp;quot; type=&amp;quot;editor&amp;quot; width=&amp;quot;300&amp;quot; filter=&amp;quot;safehtml&amp;quot; /&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
* [[Textarea parameter type]]&lt;br /&gt;
* [[Standard form field types|Table of all standard form field types]]&lt;br /&gt;
[[Category:Standard form field types]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_model_to_the_site_part&amp;diff=118240</id>
		<title>J3.x:Developing an MVC Component/Adding a model to the site part</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_model_to_the_site_part&amp;diff=118240"/>
		<updated>2014-05-18T01:01:48Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Added &amp;quot;/&amp;quot; at the end of &amp;lt;schemapath&amp;gt; text&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component | Developing a MVC Component for Joomla! 3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Adding a model ==&lt;br /&gt;
In the Joomla framework, models are responsible for managing the data. The first function that has to be written for a model is a &#039;&#039;get&#039;&#039; function. It returns data to the caller. In our case, the caller will be the &#039;&#039;HelloWorldViewHelloWorld&#039;&#039; view. By default, the model named &#039;&#039;HelloWorldModelHelloWorld&#039;&#039; residing in &#039;&#039;site/models/helloworld.php&#039;&#039; is the main model associated to this view. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So let&#039;s have a quick look at the naming conventions with an example, since the naming convention are the actual magic, that make everything work:&lt;br /&gt;
&lt;br /&gt;
The class &#039;&#039;HelloWorldView&#039;&#039;&#039;HelloWorld&#039;&#039;&#039;&#039;&#039; resides in &#039;&#039;site/views/&#039;&#039;&#039;helloworld&#039;&#039;&#039;/view.html.php&#039;&#039; and will make use of the class &#039;&#039;HelloWorldModel&#039;&#039;&#039;HelloWorld&#039;&#039;&#039;&#039;&#039; in the file &#039;&#039;site/models/&#039;&#039;&#039;helloworld&#039;&#039;&#039;.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So let&#039;s just assume we want to use an imaginary view &#039;&#039;fluffy&#039;&#039;, you would have to have:&lt;br /&gt;
&lt;br /&gt;
The class &#039;&#039;HelloWorldView&#039;&#039;&#039;Fluffy&#039;&#039;&#039;&#039;&#039; which resides in &#039;&#039;site/views/&#039;&#039;&#039;fluffy&#039;&#039;&#039;/view.html.php&#039;&#039;. The view will make use of &#039;&#039;HelloWorldModel&#039;&#039;&#039;Fluffy&#039;&#039;&#039;&#039;&#039; in the file &#039;&#039;site/models/&#039;&#039;&#039;fluffy&#039;&#039;&#039;.php&#039;&#039;. Note: the actual screen of the view: &#039;&#039;site/views/&#039;&#039;&#039;fluffy&#039;&#039;&#039;/tmpl/default.php&#039;&#039; is required as well to make this example work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Breaking any of these bold conventions will lead to errors or a blank page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So back to the actual implementation of the single classes:&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a &#039;&#039;site/models/helloworld.php&#039;&#039; file containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/models/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import Joomla modelitem library&lt;br /&gt;
jimport(&#039;joomla.application.component.modelitem&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var string msg&lt;br /&gt;
	 */&lt;br /&gt;
	protected $msg;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 * @return string The message to be displayed to the user&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg() &lt;br /&gt;
	{&lt;br /&gt;
		if (!isset($this-&amp;gt;msg)) &lt;br /&gt;
		{&lt;br /&gt;
			$this-&amp;gt;msg = &#039;Hello World!&#039;;&lt;br /&gt;
		}&lt;br /&gt;
		return $this-&amp;gt;msg;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;HelloWorldViewHelloWorld&#039;&#039; class asks the model for data using the &#039;&#039;get&#039;&#039; method of the &#039;&#039;JViewLegacy&#039;&#039; class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/view.html.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/helloworld/view.html.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import Joomla view library&lt;br /&gt;
jimport(&#039;joomla.application.component.view&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HTML View class for the HelloWorld Component&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorld extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	// Overwriting JView display method&lt;br /&gt;
	function display($tpl = null) &lt;br /&gt;
	{&lt;br /&gt;
		// Assign data to the view&lt;br /&gt;
		$this-&amp;gt;msg = $this-&amp;gt;get(&#039;Msg&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Check for errors.&lt;br /&gt;
		if (count($errors = $this-&amp;gt;get(&#039;Errors&#039;))) &lt;br /&gt;
		{&lt;br /&gt;
			JLog::add(implode(&#039;&amp;lt;br /&amp;gt;&#039;, $errors), JLog::WARNING, &#039;jerror&#039;);&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: $this-&amp;gt;get() is a member of JViewLegacy::get which is a proxy to get* methods of the default model where * is populated with the value of the first parameter passed to get()&lt;br /&gt;
&lt;br /&gt;
Also modify your &#039;&#039;helloworld.xml&#039;&#039; file to indicate use of models and the new version:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.4&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New in 2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql/&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_menu_type_to_the_site_part#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-4-adding-a-site-model.zip archive] and install it using the extension manager of Joomla. You can add a menu item of this component using the menu manager in the backend.&lt;br /&gt;
&lt;br /&gt;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Adding a menu type to the site part &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
|next=Adding a variable request in the menu type &amp;lt;!-- next article subpage name --&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User:Jossnaz|Lukas Meier]]&lt;br /&gt;
*[[User:betweenbrain|Matt Thomas]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_menu_type_to_the_site_part&amp;diff=118239</id>
		<title>J3.x:Developing an MVC Component/Adding a menu type to the site part</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_menu_type_to_the_site_part&amp;diff=118239"/>
		<updated>2014-05-18T00:57:26Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Added &amp;quot;/&amp;quot; at the end of &amp;lt;schemapath&amp;gt; text&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:J3.1:Developing a MVC Component}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing a MVC Component|Developing a MVC Component for Joomla!3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
Generally speaking, this article describes how to get a link on your joomla page to open a specific page of your component. This gets simply done by adding an xml file to your specific page into your view folder. &lt;br /&gt;
&lt;br /&gt;
E.g.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;site/views/helloworld/tmpl/&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Contains your view page &#039;&#039;default.php&#039;&#039; that we want to open.&lt;br /&gt;
&lt;br /&gt;
A file &#039;&#039;default.xml&#039;&#039; is placed next to this file with some xml. This makes joomla able to recognize the view file &#039;&#039;default.php&#039;&#039; as a menu item.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a menu item type ==&lt;br /&gt;
In the Joomla framework, components are executed using menu items. If you go in the menu manager of your Joomla installation a &#039;&#039;HelloWorld&#039;&#039; menu item type does not yet exist. Adding this functionality is easy in Joomla. Simply put a &#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039; file containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;&lt;br /&gt;
			&amp;lt;![CDATA[COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC]]&amp;gt;&lt;br /&gt;
		&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
For the moment the strings won&#039;t be translated in the administrator interface. We will see in a later article how translation is performed.&lt;br /&gt;
&lt;br /&gt;
Also modify your &#039;&#039;helloworld.xml&#039;&#039; file to indicate a new version:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.3&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New in 2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql/&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
[[File:Com_helloworld_v3-0.0.3.png|thumb|right|400px|Selecting the Menu Item Type]] Create a compressed file of this directory or directly download the [https://github.com/joomla/Joomla-3.2-Hello-World-Component/archive/step-3-adding-a-site-menu.zip archive] and install it using the extension manager of Joomla. You can add a menu item of this component using the menu manager in the backend. To do so select &amp;quot;Add New Menu Item&amp;quot; from the one of the menus in the &amp;quot;Menus&amp;quot; menu; then you can select COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE for Menu Item Type. Once selected you can see the Link information is populated with the URL for the view.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Adding a view to the site part &amp;lt;!-- previous article subpage name --&amp;gt;&lt;br /&gt;
|next=Adding a model to the site part &amp;lt;!-- next article subpage name --&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User:Jossnaz|Lukas Meier]]&lt;br /&gt;
*[[User:betweenbrain|Matt Thomas]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part&amp;diff=118238</id>
		<title>J3.x:Developing an MVC Component/Adding a view to the site part</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part&amp;diff=118238"/>
		<updated>2014-05-18T00:56:41Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Added &amp;quot;/&amp;quot; at the end of &amp;lt;schemapath&amp;gt; text&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|3.2}}&lt;br /&gt;
{{Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!3.1 - Contents}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[J3.2:Developing_a_MVC_Component|Developing a Model-View-Controller (MVC) Component for Joomla! 3.x]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
In the Joomla!3.x framework, third party component authors divide their code into three main parts:&lt;br /&gt;
* &#039;&#039;models&#039;&#039; They manage the data &lt;br /&gt;
* &#039;&#039;controllers&#039;&#039; They perform tasks, set and get the states of the models and ask the views to display&lt;br /&gt;
* &#039;&#039;views&#039;&#039; They display the content according to the type (&#039;&#039;error&#039;&#039;, &#039;&#039;feed&#039;&#039;, &#039;&#039;html&#039;&#039;, &#039;&#039;json&#039;&#039;, &#039;&#039;raw&#039;&#039;, &#039;&#039;xml&#039;&#039;) and the layout chosen by the controllers&lt;br /&gt;
&lt;br /&gt;
== Setting the controller ==&lt;br /&gt;
In the core code of Joomla, there is a class able to manage controllers: &#039;&#039;[http://api.joomla.org/cms-3/classes/JControllerLegacy.html JControllerLegacy]&#039;&#039;. This class has to be extended to be used in our component. In the file &#039;&#039;yoursite/components/com_helloworld/helloworld.php&#039;&#039; (entry point of our &#039;&#039;Hello World&#039;&#039; component), put these lines:&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/helloworld.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import joomla controller library&lt;br /&gt;
jimport(&#039;joomla.application.component.controller&#039;);&lt;br /&gt;
&lt;br /&gt;
// Get an instance of the controller prefixed by HelloWorld&lt;br /&gt;
$controller = JControllerLegacy::getInstance(&#039;HelloWorld&#039;);&lt;br /&gt;
&lt;br /&gt;
// Perform the Request task&lt;br /&gt;
$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
$controller-&amp;gt;execute($input-&amp;gt;getCmd(&#039;task&#039;));&lt;br /&gt;
&lt;br /&gt;
// Redirect if set by the controller&lt;br /&gt;
$controller-&amp;gt;redirect();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;[http://api.joomla.org/cms-3/classes/JControllerLegacy.html#method_getInstance getInstance]&#039;&#039; static method of the &#039;&#039;JControllerLegacy&#039;&#039; class will create a controller. In the code above, it will instantiate a controller object of a class named &#039;&#039;HelloWorldController&#039;&#039;. Joomla will look for the declaration of that class in an aptly named file called &#039;&#039;yoursite/components/com_helloworld/controller.php&#039;&#039; (it&#039;s a default behavior).&lt;br /&gt;
&lt;br /&gt;
Now, &#039;&#039;controller.php&#039;&#039; needs to be created and &#039;&#039;HelloWorldController&#039;&#039; needs to be declared and defined. So with your favorite file manager and editor, create a &#039;&#039;yoursite/components/com_helloworld/controller.php&#039;&#039; file containing&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/controller.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import Joomla controller library&lt;br /&gt;
jimport(&#039;joomla.application.component.controller&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello World Component Controller&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldController extends JControllerLegacy&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When no task is given in the request variables, the default task will be executed. It&#039;s the &#039;&#039;display&#039;&#039; task by default. The &#039;&#039;JControllerLegacy&#039;&#039; class has such a task. In our example, it will display a view named &#039;&#039;HelloWorld&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
So with &#039;&#039;task&#039;&#039; simply a public function display() of &#039;&#039;JControllerLegacy&#039;&#039; is refered to.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{tip|Just a side note for completion, you could call another function aside from &#039;&#039;display()&#039;&#039; by using an URL like this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;http://localhost/index.php?option=com_helloworld&amp;amp;task=insert&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would try to call a function &#039;&#039;insert()&#039;&#039; of our controller (which we would actually have to implement in &#039;&#039;HelloWorldController&#039;&#039; ).}}&lt;br /&gt;
&lt;br /&gt;
== Setting the view ==&lt;br /&gt;
&lt;br /&gt;
When JControllerLegacy wants to display a view, it will look for certain files in the &#039;&#039;yoursite/components/com_[component_name]/views/[name of view]/&#039;&#039; folder. &lt;br /&gt;
&lt;br /&gt;
The name of the folder of the default view is the name of the component itself. In our case the path is &#039;&#039;yoursite/components/com_helloworld/views/helloworld/&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The file that will contain the code of the view is called &#039;&#039;view.[view_mode].php&#039;&#039;. The default view mode, and probably the only view a component might need is the &#039;&#039;html&#039;&#039; mode. So this give us our file name which is &#039;&#039;view.html.php&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, create a file &#039;&#039;yoursite/components/com_helloworld/views/helloworld/view.html.php&#039;&#039; able to display the default view and containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import Joomla view library&lt;br /&gt;
jimport(&#039;joomla.application.component.view&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HTML View class for the HelloWorld Component&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorld extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	// Overwriting JView display method&lt;br /&gt;
	function display($tpl = null) &lt;br /&gt;
	{&lt;br /&gt;
		// Assign data to the view&lt;br /&gt;
		$this-&amp;gt;msg = &#039;Hello World&#039;;&lt;br /&gt;
&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;display&#039;&#039; method of the &#039;&#039;[http://api.joomla.org/cms-3/classes/JViewLegacy.html JViewLegacy]&#039;&#039; class is called with the &#039;&#039;display&#039;&#039; task of the JControllerLegacy class. In our case, this method will display data using the &#039;&#039;tmpl/default.php&#039;&#039; file. With your favorite file manager and editor, create a file &#039;&#039;yoursite/components/com_helloworld/views/helloworld/tmpl/default.php&#039;&#039; able to display the default view and containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;&amp;lt;?php echo $this-&amp;gt;msg; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This template file will be included by the JViewLegacy class. Therefore, here, $this refers to the HelloWorldViewHelloWorld class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So to give an example, one could call the view inside the &#039;&#039;yoursite/components/com_[component_name]/views/[name of view]/&#039;&#039; folder by calling &amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;lt;/code&amp;gt; (this would default to the &#039;&#039;yoursite/components/com_helloworld/views/helloworld/&#039;&#039; folder) or we could explicitly call the folder by calling: &amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;amp;view=helloworld&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if we change &amp;lt;code&amp;gt;&amp;amp;view=helloworld&amp;lt;/code&amp;gt; to something else, e.g. &amp;lt;code&amp;gt;&amp;amp;view=fluffy&amp;lt;/code&amp;gt; we would have to create a folder &amp;lt;code&amp;gt;components/com_helloworld/views/fluffy/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Copy the contents of &amp;lt;code&amp;gt;views/helloworld&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;views/fluffy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The classname of the file &amp;lt;code&amp;gt;view.html.php&amp;lt;/code&amp;gt; of the fluffy folder would be &#039;&#039;HelloWorldViewFluffy&#039;&#039;. Afterwards you can customize the contents of &#039;&#039;default.php&#039;&#039; of the &#039;&#039;fluffy&#039;&#039; subfolder for custom output and see the output by calling &amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;amp;view=fluffy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_a_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [http://joomlacode.org/gf/download/frsrelease/11394/58226/com_helloworld-1.6-part02.zip archive] and install it using the extension manager of Joomla. You can test this basic component by putting &#039;&#039;index.php?option=com_helloworld&#039;&#039; in your browser address.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;2.5.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;November 2009&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.2&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New in 2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql/&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Result:&#039;&#039;&#039;&lt;br /&gt;
You will see by default the message contained in the variable &#039;&#039;$this-&amp;gt;msg&#039;&#039; in the &#039;&#039;view.html.php&#039;&#039; file.&lt;br /&gt;
&lt;br /&gt;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate|prev=Developing a Basic Component|next=Adding a menu type to the site part}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Component Development]] [[Category:Joomla! 3.0]] [[Category:Joomla! 3.1]][[Category:Joomla! 3.2]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Developing_a_Basic_Component&amp;diff=118237</id>
		<title>J3.x:Developing an MVC Component/Developing a Basic Component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Developing_a_Basic_Component&amp;diff=118237"/>
		<updated>2014-05-18T00:53:52Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Added &amp;quot;/&amp;quot; at the end of &amp;lt;schemapath&amp;gt; text&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{:Developing a Model-View-Controller Component/3.0}}&lt;br /&gt;
&lt;br /&gt;
== The first basic component ==&lt;br /&gt;
Let&#039;s create a &#039;&#039;Hello World!&#039;&#039; component.&lt;br /&gt;
=== Public display ===&lt;br /&gt;
With your favorite file manager and editor, create a file &#039;&#039;yoursite/components/com_helloworld/helloworld.php&#039;&#039; containing &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
Hello world&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can test this basic component by putting &#039;&#039;index.php?option=com_helloworld&#039;&#039; in your browser address (don&#039;t forget to prefix this address with your Joomla! 3.x installation path) after installing this component.&lt;br /&gt;
&lt;br /&gt;
=== Administrator management ===&lt;br /&gt;
With your favorite file manager and editor, create a file &#039;&#039;yoursite/administrator/components/com_helloworld/helloworld.php&#039;&#039; containing &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
Hello world administration&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can test this basic component by putting &#039;&#039;administrator/index.php?option=com_helloworld&#039;&#039; in your browser address after installing the component.&lt;br /&gt;
&lt;br /&gt;
=== Packaging an installation zip file ===&lt;br /&gt;
If you have used Joomla before reading this tutorial, you have noticed that extensions are installed using a compressed file containing all the things which are needed for installing and uninstalling them.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager, create a directory (outside your Joomla installation directory) containing&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [http://joomlacode.org/gf/download/frsrelease/11394/58225/com_helloworld-1.6-part01.zip archive] and install it using the extension manager of Joomla. You can test this basic component by putting &#039;&#039;index.php?option=com_helloworld&#039;&#039; or &#039;&#039;administrator/index.php?option=com_helloworld&#039;&#039; in your browser address. You can also notice that the &#039;&#039;Hello World!&#039;&#039; component is visible in the administrator site of your Joomla installation under the &#039;&#039;Components&#039;&#039; menu.&lt;br /&gt;
&lt;br /&gt;
==File Details==&lt;br /&gt;
{{vanchor|admin/sql/updates/mysql/0.0.1.sql}}&lt;br /&gt;
is an empty file allowing to initialise schema version of the com_helloworld component.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|helloworld.xml}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;December 2013&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.1&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql/&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/helloworld.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
Hello World&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|admin/helloworld.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
Hello World administration&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|index.html}}&lt;br /&gt;
common to all folders&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&amp;lt;body bgcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{notice|Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.}}&lt;br /&gt;
&lt;br /&gt;
{{:J3.2:Developing a MVC Component/Navigate&lt;br /&gt;
|prev=Introduction&lt;br /&gt;
|next=Adding a view to the site part}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Component Development]] [[Category:Joomla! 3.0]] [[Category:Joomla! 3.1]][[Category:Joomla! 3.2]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Git_for_Coders&amp;diff=82966</id>
		<title>Git for Coders</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Git_for_Coders&amp;diff=82966"/>
		<updated>2013-03-17T08:01:21Z</updated>

		<summary type="html">&lt;p&gt;Garkell: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
This article shows you how to use Git and Github to code and submit changes to the Joomla CMS. If you are not familiar with Git, you may wish to read the tutorial [[Git_for_Testers_and_Trackers | Git for Testers and Trackers]] first. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IMPORTANT NOTE: Git is a very powerful system and there is usually more than one way to accomplish the same thing in Git. This tutorial does not try to cover all of the different ways you could do these tasks. Instead, it covers one (hopefully simple) way to do it. As you become more familiar with Git, you may find other ways that work better for you.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The first step is to set up the remote and local Git repositories. You do this once. Once it is set up, the normal workflow is:&lt;br /&gt;
# Update your local and remote repositories with changes others have committed to the main Joomla CMS repository.&lt;br /&gt;
# Create a branch for each issue or feature you are working on and commit your changes to the branch in your local repository.&lt;br /&gt;
# Update your remote repository on Github with your branches.&lt;br /&gt;
# Create a pull request from your Github branch. Alternatively, you can create a patch or diff file from your local branch and post that to the tracker.&lt;br /&gt;
# Update the Joomla Issue tracker or Joomla Feature tracker so that others can test your code.&lt;br /&gt;
&lt;br /&gt;
Each of these steps is explained below. Note that you can use Git from the command line, from an IDE such as Eclipse (with the eGit plugin), or from a stand-alone tool, such as TortoiseGit. Here we will use the command line and, where applicable, show the equivalent command in Eclipse eGit.&lt;br /&gt;
&lt;br /&gt;
NOTE: If you want to propose a simple code change, you can do it directly from Github.com, without setting up anything on your local PC. See [[Using_the_Github_UI_to_Make_Pull_Requests|Using the Github UI to Make Pull Requests]].&lt;br /&gt;
&lt;br /&gt;
=Setup=&lt;br /&gt;
== Create Your Forked Repository on Github==&lt;br /&gt;
Github allows you to create your own copy of any public repository, including the Joomla CMS. This is your personal copy of the repository and is called a &amp;quot;fork&amp;quot;. To create a fork of the Joomla CMS:&lt;br /&gt;
# If you haven&#039;t already, register on Github.com and log in.&lt;br /&gt;
# Navigate to [https://github.com/joomla/joomla-cms https://github.com/joomla/joomla-cms]&lt;br /&gt;
# Click on the Fork button in the upper right part of the screen.&lt;br /&gt;
&lt;br /&gt;
Note that you can only create one fork of any given repository. However, as we will see, you can create as many branches (versions) of your repository as you like.&lt;br /&gt;
&lt;br /&gt;
== Clone Your Github Repository To Your PC ==&lt;br /&gt;
At this point, you have your own repository on Github.com. Now you need to create a local repository that is a copy (called a &amp;quot;clone&amp;quot;) of the Github repository. To do this:&lt;br /&gt;
===CLI (command line) Commands===&lt;br /&gt;
# Change directory to the directory where you want the Joomla files to be stored (for example, &amp;lt;code&amp;gt;C:\xampp\htdocs\joomla\my-project&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/opt/lampp/htdocs/joomla/my-project&amp;lt;/code&amp;gt;).&lt;br /&gt;
# Enter the command: &amp;lt;code&amp;gt;git clone &amp;lt;nowiki&amp;gt;https://github.com/&amp;lt;your Github user name&amp;gt;/joomla-cms.git&amp;lt;/nowiki&amp;gt; .&amp;lt;/code&amp;gt; For example, if your Github user name is &amp;quot;joomla-coder&amp;quot;, the command would be: &amp;lt;code&amp;gt;git clone &amp;lt;nowiki&amp;gt;https://github.com/joomla-coder/joomla-cms.git&amp;lt;/nowiki&amp;gt;  .&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
You can get the URL for the command above from your repository at Github.com as shown below. [[File:git-coders-tutorial-20121009-03.png|frame|none]]&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;quot;.&amp;quot; dot just tells Git to put the new repository in the current directory. The system will work for a few minutes while it downloads all of the files. When it is finished, you will have a complete set of Joomla files under version control in the current directory.&lt;br /&gt;
&lt;br /&gt;
=== Eclipse Commands ===&lt;br /&gt;
# If you like, you can get the URL from Github as shown below. [[File:git-coders-tutorial-20121009-03.png|frame|none]] You will use this later on.&lt;br /&gt;
# In Eclipse, open the Git Repositories view and click the button called &amp;quot;Clone a Git Repository and add the clone to this view&amp;quot; as shown below. [[File:git-coders-tutorial-20121009-01.png|frame|none]]. &lt;br /&gt;
# The window below will show. [[File:git-coders-tutorial-20121009-02.png|frame|none]] Select URI and click Next.&lt;br /&gt;
# The window below will show. [[File:git-coders-tutorial-20121009-04.png|frame|none]] Enter the Github URL for your repository (from step (1) above). Enter your Github user name and password and check the box called &amp;quot;Store in Secure Store&amp;quot;. &lt;br /&gt;
# Click Next and the window below will show. [[File:git-coders-tutorial-20121009-05.png|frame|none]]&lt;br /&gt;
# Click Next to select all branches. The window below will show. [[File:git-coders-tutorial-20121009-06.png|frame|none]]&lt;br /&gt;
# In Directory, enter the folder where you want the Joomla files to be copied. Keep the default values for Initial branch (&amp;quot;master&amp;quot;) and Remote name (&amp;quot;origin&amp;quot;) as shown.&lt;br /&gt;
# Click Finish. The system will work for a few minutes. When it finishes you will have a clone of the remote repository.&lt;br /&gt;
&lt;br /&gt;
== Create an Upstream Remote==&lt;br /&gt;
Now we have our local repository. This has a remote called &amp;quot;origin&amp;quot; that points to our personal fork of Joomla on Github. &lt;br /&gt;
&lt;br /&gt;
In a project like Joomla, many users are submitting bug fixes and features. These changes are committed to the main Joomla CMS repository frequently. It is up to each coder to keep their personal repositories up to date with these changes. Fortunately, as we will see, this is easy to do.&lt;br /&gt;
&lt;br /&gt;
The last step in the setup is to create a second remote called &amp;quot;upstream&amp;quot; that points to the main Joomla CMS repository. We will use this remote to pull changes that others make to the main Joomla repository so we can keep our personal repositories up to date.&lt;br /&gt;
&lt;br /&gt;
===CLI Command ===&lt;br /&gt;
To create a remote called &amp;quot;upstream&amp;quot; that points to the main CMS repository, enter this command: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;git remote add upstream &amp;lt;nowiki&amp;gt;https://github.com/joomla/joomla-cms.git&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Eclipse Command===&lt;br /&gt;
&#039;&#039;Unknown at this time.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At this point, you have your personal remote repository (created by &amp;quot;forking&amp;quot; the Joomla CMS project) and your personal local repository (created with CLI or Eclipse). Now you are ready to code patches and features.&lt;br /&gt;
&lt;br /&gt;
=Normal Workflow=&lt;br /&gt;
Now that we have done our one-time setup, we are ready to start our normal workflow. This is outlined below.&lt;br /&gt;
&lt;br /&gt;
== Create a New Feature or Bug Fix Change==&lt;br /&gt;
Let&#039;s say you are ready to start working on a new bug fix or a new feature. Here are the steps you would normally follow.&lt;br /&gt;
# Update your master branches. Update the master branch of your local and Github repositories with the latest CMS changes.&lt;br /&gt;
# Create a branch for writing the new code&lt;br /&gt;
# In the new branch, code the changes and commit them. Depending on the length of time, you can make multiple commits to the branch.&lt;br /&gt;
# When you are ready to propose your code for testing (or when you want others to be able to see it), push the branch to your Github repository.&lt;br /&gt;
# When you are ready to submit the code, either:&lt;br /&gt;
## Create a pull request on Github, or&lt;br /&gt;
## Create a patch or diff file and post to the Joomlacode tracker.&lt;br /&gt;
&lt;br /&gt;
Each of these steps is explained in more detail below.&lt;br /&gt;
&lt;br /&gt;
=== Update Your Master Branches ===&lt;br /&gt;
You need to keep your repositories up to date with changes made by others in the main CMS repository. It&#039;s easy to do, and here are the steps. These are done more easily with the CLI than with Eclipse.&lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE: Make sure you never commit your own code changes to the master branch. If you do, you won&#039;t be able to keep it synchronized with the master branch on the main CMS repository.&lt;br /&gt;
&lt;br /&gt;
====CLI Commands====&lt;br /&gt;
* Make sure you are in your master branch of your local repository (&amp;lt;code&amp;gt;git checkout master&amp;lt;/code&amp;gt;). If you aren&#039;t sure, you can use the command &amp;lt;code&amp;gt;git status&amp;lt;/code&amp;gt; to see what branch you are on.&lt;br /&gt;
* Enter the command: &amp;lt;code&amp;gt;git pull upstream master&amp;lt;/code&amp;gt;. You should get a message showing the changes, similar to this:&lt;br /&gt;
 $ git pull upstream master&lt;br /&gt;
 From &amp;lt;nowiki&amp;gt;https://github.com/joomla/joomla-cms&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  * branch            master     -&amp;gt; FETCH_HEAD&lt;br /&gt;
 Updating 76feee8..294c62c&lt;br /&gt;
 Fast-forward&lt;br /&gt;
  installation/CHANGELOG                |    3 +++&lt;br /&gt;
  installation/language/fr-FR/fr-FR.ini |    2 +-&lt;br /&gt;
  2 files changed, 4 insertions(+), 1 deletion(-)&lt;br /&gt;
 Mark@MARK2009 /c/xampp/htdocs/joomla-coder/joomla-cms (master)&lt;br /&gt;
:If your local repository was already up to date, you will get a message like this:&lt;br /&gt;
 $ git pull upstream master&lt;br /&gt;
 From &amp;lt;nowiki&amp;gt;https://github.com/joomla/joomla-cms&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  * branch            master     -&amp;gt; FETCH_HEAD&lt;br /&gt;
 Already up-to-date.&lt;br /&gt;
&lt;br /&gt;
* At this point, your local master branch is up to date with the main CMS repository. Now you need to update the master branch of your Github repository. Enter the command: &amp;lt;code&amp;gt;git push origin master&amp;lt;/code&amp;gt;. You should see a message like this:&lt;br /&gt;
 $ git push origin master&lt;br /&gt;
 To &amp;lt;nowiki&amp;gt;https://github.com/joomla-coder/joomla-cms.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    76feee8..294c62c  master -&amp;gt; master&lt;br /&gt;
&lt;br /&gt;
NOTE: If you haven&#039;t stored your user name and password, you will be prompted for them after you enter the push command. See below for how to store your credentials so you don&#039;t have to type them each time.&lt;br /&gt;
&lt;br /&gt;
At this point, your master branches on your local and Github repositories are up to date with the main CMS repository. Now, when you create a new branch, it will start at this point and be based on the latest code.&lt;br /&gt;
&lt;br /&gt;
===Create a Branch for the Code===&lt;br /&gt;
In Git, the best practice is to use a branch for each bug fix or feature. (In fact, experienced Git users will often create more than one branch for an individual project, perhaps trying different approaches to the problem.) It is super easy to create, delete, and even combine branches. Use a naming convention that allows you to keep track. For example, you could incorporate the tracker issue number into the branch name (for example, &amp;quot;php-notice-12345&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
When you create a new branch, it starts from the branch you are currently on. For this reason, you will normally want to make sure you are in your master branch when creating a new one.&lt;br /&gt;
&lt;br /&gt;
====CLI Commands====&lt;br /&gt;
&amp;lt;code&amp;gt;git branch xxx&amp;lt;/code&amp;gt; where &amp;quot;xxx&amp;quot; is the new branch name. Note: If you already have a branch you are working on, use the command: &amp;lt;code&amp;gt;git checkout xxx&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Eclipse Commands====&lt;br /&gt;
#Left-click on the PHP project and select Team&amp;amp;rarr;Switch To&amp;amp;rarr;New Branch as shown below. [[File:Git-coders-tutorial-20121009-07.png|frame|none]]. The screen below will show. [[File:Git-coders-tutorial-20121009-08.png|frame|none]]&lt;br /&gt;
#Fill in the name of the new branch and click finish. &lt;br /&gt;
&lt;br /&gt;
===Code and Commit to the Branch===&lt;br /&gt;
Finally, we are to the fun part! Here we are actually coding and testing our feature or bug fix. The normal workflow is as follows:&lt;br /&gt;
# Do some coding.&lt;br /&gt;
# Commit your work to your branch.&lt;br /&gt;
# Repeat until you are done.&lt;br /&gt;
&lt;br /&gt;
Here are the commands to commit your work to your branch. Make sure you are in the right branch before committing! (Use &amp;lt;code&amp;gt;git status&amp;lt;/code&amp;gt; to check.)&lt;br /&gt;
&lt;br /&gt;
====CLI Commands====&lt;br /&gt;
* To commit all of the changes since the last commit: &amp;lt;code&amp;gt;git commit -m &amp;quot;My commit message&amp;quot; -a&amp;lt;/code&amp;gt;&lt;br /&gt;
* To undo any file changes since the last commit: &amp;lt;code&amp;gt;git reset --hard&amp;lt;/code&amp;gt;&lt;br /&gt;
* To remove any added files and folder since the last commit: &amp;lt;code&amp;gt;git clean -d -f&amp;lt;/code&amp;gt;&lt;br /&gt;
* To change the last commit: &amp;lt;code&amp;gt;git commit --amend&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Eclipse Commands====&lt;br /&gt;
* To commit all changes, right-click on project, select Team&amp;amp;rarr;Commit to show this window. [[File:Git-coders-tutorial-20121009-09.png|frame|none]]&lt;br /&gt;
* To undo any file changes since the last commit, select Team&amp;amp;rarr;Reset and check the Hard Reset Type as shown below. [[File:Git-coders-tutorial-20121009-10.png|frame|none]]&lt;br /&gt;
* To change the last commit, select Team&amp;amp;rarr;Commit and check the Amend Previous Commit button (as shown in the Commit Changes screenshot above).&lt;br /&gt;
&lt;br /&gt;
===Push Branch to Github===&lt;br /&gt;
In the previous workflow, we created the branch and committed changes to our local repository. If we want others to be able to see the branch or to create a pull request, we need to push the branch to our personal repository on Github.&lt;br /&gt;
&lt;br /&gt;
====CLI Command====&lt;br /&gt;
To push a branch to your personal Github repository: &amp;lt;code&amp;gt;git push origin xxx&amp;lt;/code&amp;gt; (where &amp;quot;xxx&amp;quot; is the name of your branch).&lt;br /&gt;
&lt;br /&gt;
===Submit Pull Request or Patch File===&lt;br /&gt;
There are two ways you can submit a proposed code change to the Joomla CMS project. One is to submit a pull request via Github, the other is to create a patch or diff file. In general, pull requests are preferred for very large changes, whereas both work fine for smaller changes.&lt;br /&gt;
&lt;br /&gt;
====Create a Pull Request====&lt;br /&gt;
# Navigate to your personal Github repository.&lt;br /&gt;
# Select the branch that has the changes for the pull request as shown below. [[File:Git-coders-tutorial-20121009-11.png|frame|none]]&lt;br /&gt;
# Click the Pull Request button on the top of the screen. The screen will show as below. [[File:Git-coders-tutorial-20121009-12.png|frame|none]]&lt;br /&gt;
# The left side shows the base repository and base branch. This will normally be the master branch of the &amp;quot;joomla/joomla-cms&amp;quot; repository. The right side shows the head repository and branch. This will normally be your repository and the branch that has the desired code changes. If you like you can change the commit message and enter in a comment describing this pull request.&lt;br /&gt;
# You can review the pull request using the tabs across the top. Clicking the Commits tab shows the commit history for the branch, as shown below.[[File:Git-coders-tutorial-20121009-13.png|frame|none]]&lt;br /&gt;
# Clicking the Files Changed tab shows all of the changes made in this branch, as shown here. [[File:Git-coders-tutorial-20121009-14.png|frame|none]]&lt;br /&gt;
# When you are ready to submit the pull request, click the Send Pull Request button at the bottom right of the screen. Github will process the request and then display it as shown below. [[File:Git-coders-tutorial-20121009-15.png|frame|none]]&lt;br /&gt;
# At this point, you should update the Joomlacode tracker. For example, if this code is a fix for a Confirmed issue, you should change the issue status to Pending and add a comment with a link to the pull request (for example, &amp;lt;nowiki&amp;gt;https://github.com/joomla/joomla-cms/pull/494&amp;lt;/nowiki&amp;gt;). Also, make sure there are good test instructions so people can test the proposed code.&lt;br /&gt;
&lt;br /&gt;
====Create a Patch File====&lt;br /&gt;
It is not necessary to create a pull request to submit code changes to Joomla. Another alternative is to create a patch file. This can be done on your local system from the command line as follows:&lt;br /&gt;
# In your local system, change to the desired branch.&lt;br /&gt;
# Enter the command: &amp;lt;code&amp;gt;git diff master &amp;gt; my-new-patch.patch&amp;lt;/code&amp;gt;&lt;br /&gt;
This will create a patch file in that same folder. (Note that you may want to have Git automatically ignore all patch files. See the section called Git Tips below.) Upload that file to the Joomlacode tracker and add a comment and change the issue status as needed. &lt;br /&gt;
To include changes to binary files in the diff add the &amp;lt;code&amp;gt;--binary&amp;lt;/code&amp;gt; option to the command line as follows:&lt;br /&gt;
# Enter the command: &amp;lt;code&amp;gt;git diff --binary master &amp;gt; my-new-patch.patch&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this method does not require you to push your local branches to Github.&lt;br /&gt;
&lt;br /&gt;
== Keep Your Repositories Up to Date==&lt;br /&gt;
As discussed earlier, the main CMS repository on Github is being changed frequently. It is possible that one or more of these changes could conflict with (or otherwise affect) our work. For this reason, it is very important that we keep our repositories up to date. Otherwise, our patch files and pull requests may not work. As discussed earlier, the way we will do this is by keeping our master branch synchronized with the main CMS repository and then using that to update our working branches.&lt;br /&gt;
&lt;br /&gt;
In this tutorial we are using the git merge command. The merge command merges the changes from a different branch into the current branch. Here we use the merge to merge changes from the master branch into our working branch. For example, say we created a branch (my-branch) on day 1. On day 2, someone does 5 commits to the master branch in the main CMS repository. Now, on day 3 we want to update our branch to be current with these 5 commits. The merge command tries to do this automatically. It looks to see what was changed in the master branch since our last merge and applies those same changes to our current branch (&amp;quot;my-branch&amp;quot;). This will work automatically unless we have made changes that conflict with changes made in the same files in the main repository. In that case, we need to resolve these conflicts before we can finish updating our branch.&lt;br /&gt;
&lt;br /&gt;
To update a working branch with changes to the main CMS repository, follow these steps.&lt;br /&gt;
# Update your local master branch.&lt;br /&gt;
#* Make sure you are on the master branch in your local repository: &amp;lt;code&amp;gt;git checkout master&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Pull changes from the main CMS repository: &amp;lt;code&amp;gt;git pull upstream master&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Push those changes to your Github repository: &amp;lt;code&amp;gt;git push origin master&amp;lt;/code&amp;gt;&lt;br /&gt;
# Now your local master branch is up to date. Next, change to your working branch: &amp;lt;code&amp;gt;git checkout my-branch&amp;lt;/code&amp;gt;&lt;br /&gt;
# Make sure your remote repository &amp;quot;my-branch&amp;quot; is up to date with your local repository. Use the command: &amp;lt;code&amp;gt;git push origin my-branch&amp;lt;/code&amp;gt;. If the remote repository was already up to date, no harm is done. You will just get a message saying it was already up to date.&lt;br /&gt;
# Finally, merge the new changes to the master branch with your working branch. The command is as follows: &amp;lt;code&amp;gt;git merge master&amp;lt;/code&amp;gt;&lt;br /&gt;
# The system will work for a short time and then indicate whether or not the merge was successful. If you don&#039;t have any changes that conflict with changes from the main CMS repository, the merge will be successful. If one or more of your changes conflicts with the changes that were made in the main repository, any affected files will be flagged as being in conflict. See the Fixing Conflicts section below for more information about this.&lt;br /&gt;
&lt;br /&gt;
You can also use Eclipse for the merge by changing to the working branch and selecting Team&amp;amp;rarr;Merge&amp;amp;rarr;. This will show the following screen. [[File:Git-coders-tutorial-20121027-01.png|frame|none]] Select Local-&amp;gt;master as shown above and click Merge.&lt;br /&gt;
&lt;br /&gt;
== Fixing Conflicts ==&lt;br /&gt;
A conflict occurs during a merge (or rebase) if the same file has been changed in the local branch and in the master branch in a way that conflicts. If this happens, the file is flagged as being in conflict and the merge process is suspended. To complete the process, you need to:&lt;br /&gt;
# Manually edit each of the flagged. You will see the changes from your branch and the changes from the main repository highlighted in the file. You need to figure out what should be in the file.&lt;br /&gt;
# Once you have edited each flagged file, enter the command &amp;lt;code&amp;gt;git add xxx&amp;lt;/code&amp;gt; where &amp;quot;xxx&amp;quot; is the name of the flagged file.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at a simple example. Here we have added a line of code to a file in our branch and someone has added a different line to the same file in the master branch. When we do the merge command, we get the following message.&lt;br /&gt;
&lt;br /&gt;
 $ git merge master&lt;br /&gt;
 Removing administrator/templates/hathor/html/mod_submenu/default.php&lt;br /&gt;
 Auto-merging administrator/components/com_admin/script.php&lt;br /&gt;
 CONFLICT (content): Merge conflict in administrator/components/com_admin/script&lt;br /&gt;
 php&lt;br /&gt;
 Automatic merge failed; fix conflicts and then commit the result.&lt;br /&gt;
&lt;br /&gt;
So this tells us we have a conflict in the file &amp;lt;code&amp;gt;administrator/components/com_admin/script.php&amp;lt;/code&amp;gt;. If we look at this file in our text editor, we see the following: [[File:Git-coders-tutorial-20121009-17.png|frame|none]] The line under &amp;quot;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; HEAD&amp;quot; is from the master branch of the main repository. The line after the &amp;quot;=======&amp;quot; is from our working branch.&lt;br /&gt;
&lt;br /&gt;
At this point, we need to correct the file and remove the &amp;quot;marker&amp;quot; lines. Then we do the command &amp;lt;code&amp;gt;git add administrator/components/com_admin/script.php&amp;lt;/code&amp;gt; to tell Git that the conflict is resolved.&lt;br /&gt;
&lt;br /&gt;
Finally, we do the command &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;git commit -a&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
to finish the merge. This commits all of the changes that were applied automatically by the merge as well as the changes we have done manually in fixing the conflicts.&lt;br /&gt;
&lt;br /&gt;
If we want to abandon the merge instead of fixing the conflicts, we can use the following commands to reset our branch back to its state before the merge:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;git reset --hard&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;git clean -f -d&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using Eclipse For Conflicts===&lt;br /&gt;
Eclipse is very handy for resolving commits. When you do the command Team&amp;amp;rarr;Merge and there is a conflict, you get the following window. [[File:Git-coders-tutorial-20121027-02.png|frame|none]] You will also see a red square annotation in the PHP Explorer window next to each file with a conflict.&lt;br /&gt;
&lt;br /&gt;
To see all of the files in conflict you can use the Merge Tool. Right click on the PHP project and select Team&amp;amp;rarr;Merge Tool. You will see the following option. [[File:Git-coders-tutorial-20121009-20.png|frame|none]]&lt;br /&gt;
&lt;br /&gt;
This gives you the option of having Git put in the changes from both sources in the file or letting you compare the changes side by side. If you select Use HEAD version you get a file compare similar to the following. [[File:Git-coders-tutorial-20121009-21.png|frame|none]]&lt;br /&gt;
&lt;br /&gt;
The left shows the change from the master branch, and the right shows the change from your working branch. At this point, you can either edit the file in the left side (for example, by pulling in the change from the right side) or you can just manually edit the file in conflict. &lt;br /&gt;
&lt;br /&gt;
Once the file has been fixed, select the file (either by right-clicking in the PHP Explorer view or in the editor) and select Team&amp;amp;rarr;Add to Index as shown below. [[File:Git-coders-tutorial-20121009-22.png|frame|none]]When you do this, the red square annotation will disappear. &lt;br /&gt;
&lt;br /&gt;
Once all the conflicts are resolved, you can finish the merge by right-clicking on the project and selecting Team&amp;amp;rarr;Commit. The normal commit screen will show as follows. [[File:Git-coders-tutorial-20121027-03.png|frame|none]] Notice that the files that were in conflict are automatically added to the commit message. Edit the commit message as desired and click the Commit button. At this point, the merge is complete.&lt;br /&gt;
&lt;br /&gt;
== Saving Your User Name and Password ==&lt;br /&gt;
When you push changes to Github, it must authenticate you based on your Github user name and password. Normally, the system will simply prompt you for your user name and password each time you do a push. &lt;br /&gt;
&lt;br /&gt;
There are a number of ways you can save your credentials so you don&#039;t have to enter them each time. One very simple method is to use the git &amp;quot;store&amp;quot; feature. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IMPORTANT NOTE: This feature stores your password in plain text on your local computer. If this is not acceptable, do not use this method.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If it is OK to store your credentials on your PC, at the command line enter the command: &amp;lt;code&amp;gt;git config --global credential.helper store&amp;lt;/code&amp;gt; This tells Git to store your credentials in a file called .git-credentials in your home folder (&amp;quot;for example, C:\users\user-name&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
The next time you do a push and enter your credentials, they will be stored in that file. After that, you will not need to enter them. Git will use them automatically.&lt;br /&gt;
&lt;br /&gt;
If you want to change your password, simple delete the file and then change your password on Github. The next time you enter your credentials, the new password will be saved.&lt;br /&gt;
&lt;br /&gt;
== Git Tips ==&lt;br /&gt;
&lt;br /&gt;
=== Ignoring Files ===&lt;br /&gt;
Some files we don&#039;t want Git to track. One way to have Git ignore files is to use the &amp;quot;exclude&amp;quot; file. An advantage of this approach is that this file sits outside of your Git project and doesn&#039;t get committed to the repository. This is handy when you want your master branch to be identical to the CMS master branch, even if you want to add some file types to ignore.&lt;br /&gt;
&lt;br /&gt;
To use this feature, follow these steps:&lt;br /&gt;
# Create a folder called &amp;lt;code&amp;gt;info&amp;lt;/code&amp;gt; under your &amp;lt;code&amp;gt;.git&amp;lt;/code&amp;gt; folder. (The .git folder will be at the root of your Joomla project.)&lt;br /&gt;
# Create a text file in this folder called &amp;lt;code&amp;gt;exclude&amp;lt;/code&amp;gt; and enter in the desired file types to exclude.&lt;br /&gt;
&lt;br /&gt;
Here is an example of a file.&lt;br /&gt;
 *~&lt;br /&gt;
 .buildpath&lt;br /&gt;
 .project&lt;br /&gt;
 .settings/&lt;br /&gt;
 tests/system/servers/configdef.php&lt;br /&gt;
 tests/system/screenshots&lt;br /&gt;
 configuration.php&lt;br /&gt;
 logs/error.php&lt;br /&gt;
 cache/*&lt;br /&gt;
 administrator/cache/*&lt;br /&gt;
 *.patch&lt;br /&gt;
 *.diff&lt;br /&gt;
As you can see from the example, we can exclude specific file names or use wild cards.&lt;br /&gt;
&lt;br /&gt;
Once you have this file created, Git will ignore any of these files.&lt;br /&gt;
[[Category:Bug Squad]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Creating_a_toolbar_for_your_component&amp;diff=79154</id>
		<title>Creating a toolbar for your component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Creating_a_toolbar_for_your_component&amp;diff=79154"/>
		<updated>2012-12-18T21:15:25Z</updated>

		<summary type="html">&lt;p&gt;Garkell: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: This applies when using the MVC structure.&lt;br /&gt;
&lt;br /&gt;
By default the Joomla Toolbar uses a Delete, Edit, New, Publish, Unpublish and Parameters buttons. To use them in your component you must write the following code in the view.html.php of your view file (below your display function).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
      JToolBarHelper::title( &#039;your_component_view_page_title&#039;, &#039;generic.png&#039; );&lt;br /&gt;
      JToolBarHelper::deleteList(); // Will call the task/function &amp;quot;remove&amp;quot; in your controller&lt;br /&gt;
      JToolBarHelper::editListX(); // Will call the task/function &amp;quot;edit&amp;quot; in your controller&lt;br /&gt;
      JToolBarHelper::addNewX(); // Will call the task/function &amp;quot;add&amp;quot; in your controller&lt;br /&gt;
      JToolBarHelper::publishList(); // Will call the task/function &amp;quot;publish&amp;quot; in your controller&lt;br /&gt;
      JToolBarHelper::unpublishList(); // Will call the task/function &amp;quot;unpublish&amp;quot; in your controller&lt;br /&gt;
      JToolBarHelper::preferences(&#039;your_component_xml_file&#039;, &#039;height&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
So (i.e.) your code would look like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 class HelloViewHellos extends JView&lt;br /&gt;
 {&lt;br /&gt;
   function display($tpl = null) {&lt;br /&gt;
      global $mainframe, $option;&lt;br /&gt;
      JToolBarHelper::title( &#039;Hello Component&#039;, &#039;generic.png&#039; );&lt;br /&gt;
      JToolBarHelper::deleteList();&lt;br /&gt;
      JToolBarHelper::editListX();&lt;br /&gt;
      JToolBarHelper::addNewX();&lt;br /&gt;
      JToolBarHelper::publishList();&lt;br /&gt;
      JToolBarHelper::unpublishList();&lt;br /&gt;
      JToolBarHelper::preferences(&#039;com_hello&#039;, &#039;500&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
An example of creating a custom button in the admin list of records of your component {{JVer|3.0}} could be:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
administrator/views/hellos/view.html.php&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
	public function display($tpl = null)&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
		$this-&amp;gt;state		= $this-&amp;gt;get(&#039;State&#039;);&lt;br /&gt;
		$this-&amp;gt;items		= $this-&amp;gt;get(&#039;Items&#039;);&lt;br /&gt;
		$this-&amp;gt;pagination	= $this-&amp;gt;get(&#039;Pagination&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Check for errors.&lt;br /&gt;
		if (count($errors = $this-&amp;gt;get(&#039;Errors&#039;))) {&lt;br /&gt;
			JError::raiseError(500, implode(&amp;quot;\n&amp;quot;, $errors));&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$this-&amp;gt;addToolbar();&lt;br /&gt;
        &lt;br /&gt;
        	$this-&amp;gt;sidebar = JHtmlSidebar::render();&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	protected function addToolbar()&lt;br /&gt;
	{&lt;br /&gt;
		// assuming you have other toolbar buttons ...&lt;br /&gt;
&lt;br /&gt;
		JToolBarHelper::custom(&#039;hellos.extrahello&#039;, &#039;extrahello.png&#039;, &#039;extrahello_f2.png&#039;, &#039;Extra Hello&#039;, true);&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
administrator/controllers/hellos.php&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
    public function extrahello()&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
		// Get the input&lt;br /&gt;
		$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
		$pks = $input-&amp;gt;post-&amp;gt;get(&#039;cid&#039;, array(), &#039;array&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Sanitize the input&lt;br /&gt;
		JArrayHelper::toInteger($pks);&lt;br /&gt;
&lt;br /&gt;
		// Get the model&lt;br /&gt;
		$model = $this-&amp;gt;getModel();&lt;br /&gt;
&lt;br /&gt;
		$return = $model-&amp;gt;extrahello($pks);&lt;br /&gt;
&lt;br /&gt;
		// Redirect to the list screen.&lt;br /&gt;
		$this-&amp;gt;setRedirect(JRoute::_(&#039;index.php?option=com_hello&amp;amp;view=hellos&#039;, false));&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
administrator/models/hello.php	(note: the singular model)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
    public function extrahello($pks)&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
		// perform whatever you want on each item checked in the list&lt;br /&gt;
&lt;br /&gt;
		return true;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Helpful explanation of JToolBarHelper/custom here - http://docs.joomla.org/JToolBarHelper/custom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Creating_a_toolbar_for_your_component&amp;diff=79153</id>
		<title>Creating a toolbar for your component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Creating_a_toolbar_for_your_component&amp;diff=79153"/>
		<updated>2012-12-18T21:13:34Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Added extra example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: This applies when using the MVC structure.&lt;br /&gt;
&lt;br /&gt;
By default the Joomla Toolbar uses a Delete, Edit, New, Publish, Unpublish and Parameters buttons. To use them in your component you must write the following code in the view.html.php of your view file (below your display function).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
      JToolBarHelper::title( &#039;your_component_view_page_title&#039;, &#039;generic.png&#039; );&lt;br /&gt;
      JToolBarHelper::deleteList(); // Will call the task/function &amp;quot;remove&amp;quot; in your controller&lt;br /&gt;
      JToolBarHelper::editListX(); // Will call the task/function &amp;quot;edit&amp;quot; in your controller&lt;br /&gt;
      JToolBarHelper::addNewX(); // Will call the task/function &amp;quot;add&amp;quot; in your controller&lt;br /&gt;
      JToolBarHelper::publishList(); // Will call the task/function &amp;quot;publish&amp;quot; in your controller&lt;br /&gt;
      JToolBarHelper::unpublishList(); // Will call the task/function &amp;quot;unpublish&amp;quot; in your controller&lt;br /&gt;
      JToolBarHelper::preferences(&#039;your_component_xml_file&#039;, &#039;height&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
So (i.e.) your code would look like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 class HelloViewHellos extends JView&lt;br /&gt;
 {&lt;br /&gt;
   function display($tpl = null) {&lt;br /&gt;
      global $mainframe, $option;&lt;br /&gt;
      JToolBarHelper::title( &#039;Hello Component&#039;, &#039;generic.png&#039; );&lt;br /&gt;
      JToolBarHelper::deleteList();&lt;br /&gt;
      JToolBarHelper::editListX();&lt;br /&gt;
      JToolBarHelper::addNewX();&lt;br /&gt;
      JToolBarHelper::publishList();&lt;br /&gt;
      JToolBarHelper::unpublishList();&lt;br /&gt;
      JToolBarHelper::preferences(&#039;com_hello&#039;, &#039;500&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
An example of creating a custom button in the admin list of records of your component {{JVer|3.0}} could be:&lt;br /&gt;
WIP&lt;br /&gt;
&lt;br /&gt;
administrator/views/hellos/view.html.php&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
	public function display($tpl = null)&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
		$this-&amp;gt;state		= $this-&amp;gt;get(&#039;State&#039;);&lt;br /&gt;
		$this-&amp;gt;items		= $this-&amp;gt;get(&#039;Items&#039;);&lt;br /&gt;
		$this-&amp;gt;pagination	= $this-&amp;gt;get(&#039;Pagination&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Check for errors.&lt;br /&gt;
		if (count($errors = $this-&amp;gt;get(&#039;Errors&#039;))) {&lt;br /&gt;
			JError::raiseError(500, implode(&amp;quot;\n&amp;quot;, $errors));&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$this-&amp;gt;addToolbar();&lt;br /&gt;
        &lt;br /&gt;
        	$this-&amp;gt;sidebar = JHtmlSidebar::render();&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	protected function addToolbar()&lt;br /&gt;
	{&lt;br /&gt;
		// assuming you have other toolbar buttons ...&lt;br /&gt;
&lt;br /&gt;
		JToolBarHelper::custom(&#039;hellos.extrahello&#039;, &#039;extrahello.png&#039;, &#039;extrahello_f2.png&#039;, &#039;Extra Hello&#039;, true);&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
administrator/controllers/hellos.php&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
    public function extrahello()&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
		// Get the input&lt;br /&gt;
		$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
		$pks = $input-&amp;gt;post-&amp;gt;get(&#039;cid&#039;, array(), &#039;array&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Sanitize the input&lt;br /&gt;
		JArrayHelper::toInteger($pks);&lt;br /&gt;
&lt;br /&gt;
		// Get the model&lt;br /&gt;
		$model = $this-&amp;gt;getModel();&lt;br /&gt;
&lt;br /&gt;
		$return = $model-&amp;gt;extrahello($pks);&lt;br /&gt;
&lt;br /&gt;
		// Redirect to the list screen.&lt;br /&gt;
		$this-&amp;gt;setRedirect(JRoute::_(&#039;index.php?option=com_hello&amp;amp;view=hellos&#039;, false));&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
administrator/models/hello.php	(note: the singular model)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
    public function extrahello($pks)&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
		// perform whatever you want on each item checked in the list&lt;br /&gt;
&lt;br /&gt;
		return true;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Helpful explanation of JToolBarHelper/custom here - http://docs.joomla.org/JToolBarHelper/custom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Example_of_menu_parameters_and_stylesheets&amp;diff=67236</id>
		<title>Archived:Developing a MVC Component/Example of menu parameters and stylesheets</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Example_of_menu_parameters_and_stylesheets&amp;diff=67236"/>
		<updated>2012-05-12T23:10:26Z</updated>

		<summary type="html">&lt;p&gt;Garkell: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial is for {{JVer|1.6}} {{JVer|1.7}} {{JVer|2.5}}&lt;br /&gt;
== Warning - this article needs to be reviewed by someone who knows what they&#039;re doing ==&lt;br /&gt;
&lt;br /&gt;
== Articles in this series ==&lt;br /&gt;
{{Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Contents}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Update the view ==&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, update the file &#039;&#039;site/views/updhelloworld/view.html.php&#039;&#039; to include setting the state.  For the stylesheet, include the import of the html class, and add a new function for including the stylesheet file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/view.html.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/view.html.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 &lt;br /&gt;
// import Joomla view library&lt;br /&gt;
jimport(&#039;joomla.application.component.view&#039;);&lt;br /&gt;
// import Joomla html for use with stylesheets&lt;br /&gt;
jimport(&#039;joomla.html.html&#039;);&lt;br /&gt;
 &lt;br /&gt;
/**&lt;br /&gt;
 * HTML View class for the UpdHelloWorld Component&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewUpdHelloWorld extends JView&lt;br /&gt;
{&lt;br /&gt;
	// Overwriting JView display method&lt;br /&gt;
	function display($tpl = null) &lt;br /&gt;
	{&lt;br /&gt;
		$app		= JFactory::getApplication();&lt;br /&gt;
		$params		= $app-&amp;gt;getParams();&lt;br /&gt;
		$dispatcher = JDispatcher::getInstance();&lt;br /&gt;
&lt;br /&gt;
		// Get some data from the models&lt;br /&gt;
		$state		= $this-&amp;gt;get(&#039;State&#039;);&lt;br /&gt;
		$item		= $this-&amp;gt;get(&#039;Item&#039;);&lt;br /&gt;
		$this-&amp;gt;form	= $this-&amp;gt;get(&#039;Form&#039;);&lt;br /&gt;
		$this-&amp;gt;state = $this-&amp;gt;get(&#039;State&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Check for errors.&lt;br /&gt;
		if (count($errors = $this-&amp;gt;get(&#039;Errors&#039;))) &lt;br /&gt;
		{&lt;br /&gt;
			JError::raiseError(500, implode(&#039;&amp;lt;br /&amp;gt;&#039;, $errors));&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		// get the stylesheet and/or other document values such as title&lt;br /&gt;
        	$this-&amp;gt;addDocStyle();&lt;br /&gt;
&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Add the stylesheet to the document.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function addDocStyle()&lt;br /&gt;
	{&lt;br /&gt;
        $doc = JFactory::getDocument();&lt;br /&gt;
        $doc-&amp;gt;addStyleSheet(&#039;media/com_helloworld/css/site.stylesheet.css&#039;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Update the layout ==&lt;br /&gt;
&lt;br /&gt;
In Joomla, views display data using a layout. With your favorite file manager and editor, edit your file &#039;&#039;site/views/updhelloworld/tmpl/default.php&#039;&#039; to get the parameter values&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/tmpl/default.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/tmpl/default.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JHtml::_(&#039;behavior.keepalive&#039;);&lt;br /&gt;
JHtml::_(&#039;behavior.formvalidation&#039;);&lt;br /&gt;
JHtml::_(&#039;behavior.tooltip&#039;);&lt;br /&gt;
&lt;br /&gt;
// get the menu parameters for use&lt;br /&gt;
$menuparams = $this-&amp;gt;state-&amp;gt;get(&amp;quot;menuparams&amp;quot;);&lt;br /&gt;
$headingtxtcolor = $menuparams-&amp;gt;get(&amp;quot;headingtxtcolor&amp;quot;);&lt;br /&gt;
$headingbgcolor = $menuparams-&amp;gt;get(&amp;quot;headingbgcolor&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
    &amp;lt;h2 style=&amp;quot;color:&amp;lt;?php echo $headingtxtcolor; ?&amp;gt;; background-color:&amp;lt;?php echo $headingbgcolor; ?&amp;gt;;&amp;quot;&amp;gt;Update the Hello World greeting&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;form class=&amp;quot;form-validate&amp;quot; action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php&#039;); ?&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot; id=&amp;quot;updhelloworld&amp;quot; name=&amp;quot;updhelloworld&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset&amp;gt;&lt;br /&gt;
        	&amp;lt;dl&amp;gt;&lt;br /&gt;
          	    &amp;lt;dt&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getLabel(&#039;id&#039;); ?&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
             	&amp;lt;dd&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getInput(&#039;id&#039;); ?&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
        	    &amp;lt;dt&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getLabel(&#039;greeting&#039;); ?&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
        	    &amp;lt;dd&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getInput(&#039;greeting&#039;); ?&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
            	&amp;lt;dd&amp;gt;&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;option&amp;quot; value=&amp;quot;com_helloworld&amp;quot; /&amp;gt;&lt;br /&gt;
            	    &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;updhelloworld.submit&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
                &amp;lt;dd&amp;gt;&amp;lt;button type=&amp;quot;submit&amp;quot; class=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Submit&#039;); ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
			                &amp;lt;?php echo JHtml::_(&#039;form.token&#039;); ?&amp;gt;&lt;br /&gt;
                &amp;lt;/dd&amp;gt;&lt;br /&gt;
        	&amp;lt;/dl&amp;gt;&lt;br /&gt;
        &amp;lt;fieldset&amp;gt;&lt;br /&gt;
    &amp;lt;/form&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;clr&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This layout utilises the forms design which resides with the related model.  The getLabel and getInput will pickup the xml fields defined and display appropriately.  More on the xml file within the models section of this tutorial.&lt;br /&gt;
&lt;br /&gt;
Update the file &#039;&#039;site/views/updhelloworld/tmpl/default.xml&#039;&#039; to include the definitions of the parameter fields.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/tmpl/default.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
    &amp;lt;layout title=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;message&amp;gt;COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
    &amp;lt;/layout&amp;gt;&lt;br /&gt;
    &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;field name=&amp;quot;headingtxtcolor&amp;quot; type=&amp;quot;text&amp;quot; default=&amp;quot;#ff0000&amp;quot; size=&amp;quot;40&amp;quot;&lt;br /&gt;
                label=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGTXTCOLOR_LABEL&amp;quot;&lt;br /&gt;
                description=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGTXTCOLOR_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;field name=&amp;quot;headingbgcolor&amp;quot; type=&amp;quot;text&amp;quot; default=&amp;quot;#0000ff&amp;quot; size=&amp;quot;40&amp;quot;&lt;br /&gt;
                label=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGBGCOLOR_LABEL&amp;quot;&lt;br /&gt;
                description=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGBGCOLOR_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
    &amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the parameter fields and allows for default values to be set amongst any other JForms elements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Update the model ==&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;UpdHelloWorld&#039;&#039; model sets up the data sent from the related form and allows for saving the data from the form into the database.  In the getItem method we will get the values from the parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/updhelloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/models/updhelloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 &lt;br /&gt;
// Include dependancy of the main model form&lt;br /&gt;
jimport(&#039;joomla.application.component.modelform&#039;);&lt;br /&gt;
// import Joomla modelitem library&lt;br /&gt;
jimport(&#039;joomla.application.component.modelitem&#039;);&lt;br /&gt;
// Include dependancy of the dispatcher&lt;br /&gt;
jimport(&#039;joomla.event.dispatcher&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * UpdHelloWorld Model&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelUpdHelloWorld extends JModelForm&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var object item&lt;br /&gt;
	 */&lt;br /&gt;
	protected $item;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the data for a new qualification&lt;br /&gt;
	 */&lt;br /&gt;
	public function getForm($data = array(), $loadData = true)&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
        $app = JFactory::getApplication(&#039;site&#039;);&lt;br /&gt;
&lt;br /&gt;
        // Get the form.&lt;br /&gt;
		$form = $this-&amp;gt;loadForm(&#039;com_helloworld.updhelloworld&#039;, &#039;updhelloworld&#039;, array(&#039;control&#039; =&amp;gt; &#039;jform&#039;, &#039;load_data&#039; =&amp;gt; true));&lt;br /&gt;
		if (empty($form)) {&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		return $form;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 * @return object The message to be displayed to the user&lt;br /&gt;
	 */&lt;br /&gt;
	function &amp;amp;getItem()&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;_item))&lt;br /&gt;
		{&lt;br /&gt;
			$cache = JFactory::getCache(&#039;com_helloworld&#039;, &#039;&#039;);&lt;br /&gt;
			$id = $this-&amp;gt;getState(&#039;helloworld.id&#039;);&lt;br /&gt;
			$this-&amp;gt;_item =  $cache-&amp;gt;get($id);&lt;br /&gt;
			if ($this-&amp;gt;_item === false) {&lt;br /&gt;
&lt;br /&gt;
                // Menu parameters&lt;br /&gt;
                $menuitemid = JRequest::getInt( &#039;Itemid&#039; );  // this returns the menu id number so you can reference parameters&lt;br /&gt;
                $menu = JSite::getMenu();&lt;br /&gt;
                if ($menuitemid) {&lt;br /&gt;
                   $menuparams = $menu-&amp;gt;getParams( $menuitemid );&lt;br /&gt;
                   $headingtxtcolor = $menuparams-&amp;gt;get(&#039;headingtxtcolor&#039;);  // This shows how to get an individual parameter for use&lt;br /&gt;
                   $headingbgcolor = $menuparams-&amp;gt;get(&#039;headingbgcolor&#039;);  // This shows how to get an individual parameter for use&lt;br /&gt;
                }&lt;br /&gt;
                $this-&amp;gt;setState(&#039;menuparams&#039;, $menuparams);  // this sets the parameter values to the state for later use&lt;br /&gt;
&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		return $this-&amp;gt;_item;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public function updItem($data)&lt;br /&gt;
	{&lt;br /&gt;
        // set the variables from the passed data&lt;br /&gt;
        $id = $data[&#039;id&#039;];&lt;br /&gt;
        $greeting = $data[&#039;greeting&#039;];&lt;br /&gt;
&lt;br /&gt;
        // set the data into a query to update the record&lt;br /&gt;
		$db		= $this-&amp;gt;getDbo();&lt;br /&gt;
		$query	= $db-&amp;gt;getQuery(true);&lt;br /&gt;
        $query-&amp;gt;clear();&lt;br /&gt;
		$query-&amp;gt;update(&#039; #__helloworld &#039;);&lt;br /&gt;
		$query-&amp;gt;set(&#039; greeting = &#039;.$db-&amp;gt;Quote($greeting) );&lt;br /&gt;
		$query-&amp;gt;where(&#039; id = &#039; . (int) $id );&lt;br /&gt;
&lt;br /&gt;
		$db-&amp;gt;setQuery((string)$query);&lt;br /&gt;
&lt;br /&gt;
        if (!$db-&amp;gt;query()) {&lt;br /&gt;
            JError::raiseError(500, $db-&amp;gt;getErrorMsg());&lt;br /&gt;
        	return false;&lt;br /&gt;
        } else {&lt;br /&gt;
        	return true;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add a stylesheet file ==&lt;br /&gt;
&lt;br /&gt;
Create a new stylesheet file to contain the css code you want to use on your component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;media/css/site.stylesheet.css&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;media/css/site.stylesheet.css&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
p {&lt;br /&gt;
   color: #000000;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding some language keys ==&lt;br /&gt;
&lt;br /&gt;
Add the last 4 lines to the &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.ini&#039;&#039; file to provide the text link for the parameter type display.  And being for the backend, it resides in the admin language folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/language/en-GB/en-GB.com_helloworld.sys.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.ini&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
COM_HELLOWORLD=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_DESCRIPTION=&amp;quot;This is the Hello World description&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC=&amp;quot;This view displays a selected message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE=&amp;quot;Hello World&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_INSTALL_TEXT=&amp;quot;HelloWorld Install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MENU=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_DISCOVER_INSTALL_TEXT=&amp;quot;HelloWorld postlight discover install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_INSTALL_TEXT=&amp;quot;HelloWorld postflight install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_UNINSTALL_TEXT=&amp;quot;HelloWorld postflight uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_UPDATE_TEXT=&amp;quot;HelloWorld postflight update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_DISCOVER_INSTALL_TEXT=&amp;quot;HelloWorld preflight discover install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_INSTALL_TEXT=&amp;quot;HelloWorld preflight install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_UNINSTALL_TEXT=&amp;quot;HelloWorld preflight uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_UPDATE_TEXT=&amp;quot;HelloWorld preflight update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UNINSTALL_TEXT=&amp;quot;HelloWorld Uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDATE_TEXT=&amp;quot;HelloWorld Update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_TITLE=&amp;quot;Update the Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_DESC=&amp;quot;Update greeting here&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGTXTCOLOR_LABEL=&amp;quot;Colour of Text&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGTXTCOLOR_DESC=&amp;quot;Set the colour of the text on the heading&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGBGCOLOR_LABEL=&amp;quot;Colour of Background&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGBGCOLOR_DESC=&amp;quot;Set the colour of the background on the heading&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;_populateState&#039;&#039; method is, by default, automatically called when a state is read by the &#039;&#039;getState&#039;&#039; method.&lt;br /&gt;
&lt;br /&gt;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory-&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#script.php|script.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/updhelloworld.php|site/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/controllers/updhelloworld.php|site/controllers/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/controllers/index.html|site/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/views/updhelloworld/view.html.php|site/views/updhelloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/updhelloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/views/updhelloworld/tmpl/default.xml|site/views/updhelloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/views/updhelloworld/tmpl/default.php|site/views/updhelloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/models/updhelloworld.php|site/models/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/models/forms/updhelloworld.xml|site/models/forms/updhelloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#site/language/en-GB/en-GB.com_helloworld.ini|site/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/access.xml|admin/access.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/config.xml|admin/config.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_12#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_12#admin/sql/updates/mysql/0.0.12.sql|admin/sql/updates/mysql/0.0.12.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/sql/updates/mysql/0.0.13.sql|admin/sql/updates/mysql/0.0.13.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_12#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/models/forms/helloworld.xml|admin/models/forms/helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/forms/helloworld.js|admin/models/forms/helloworld.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/rules/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/rules/greeting.php|admin/models/rules/greeting.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/models/helloworld.php|admin/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_09#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/views/helloworld/view.html.php|admin/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworld/submitbutton.js|admin/views/helloworld/submitbutton.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/views/helloworld/tmpl/edit.php|admin/views/helloworld/tmpl/edit.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/helpers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/helpers/helloworld.php|admin/helpers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/language/en-GB/en-GB.com_helloworld.ini|admin/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/language/en-GB/en-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/controllers/helloworld.php|admin/controllers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/controllers/helloworlds.php|admin/controllers/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#language/en-GB/en-GB.ini|language/en-GB/en-GB.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/images/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-16x16.png&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-48x48.png&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [http://www.glennarkell.com/joomlaorg/com_helloworld_0.0.19.zip] and install it using the extension manager of Joomla. You can add a menu item of this component using the menu manager in the backend.&lt;br /&gt;
&lt;br /&gt;
Be sure to update your manifest to include the stylesheet folder within the media section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;2.5.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;name&amp;gt;COM_HELLOWORLD&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting conttraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;November 2009&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.19&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;COM_HELLOWORLD_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- Runs on install/uninstall/update; New in 2.5 --&amp;gt;&lt;br /&gt;
	&amp;lt;scriptfile&amp;gt;script.php&amp;lt;/scriptfile&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New in 2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;updhelloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;media destination=&amp;quot;com_helloworld&amp;quot; folder=&amp;quot;media&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;css&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;images&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/media&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu img=&amp;quot;../media/com_helloworld/images/tux-16x16.png&amp;quot;&amp;gt;COM_HELLOWORLD_MENU&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;config.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;access.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- views files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- controllers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- helpers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;helpers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		&amp;lt;languages folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;/languages&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- UPDATESERVER DEFINITION --&amp;gt;&lt;br /&gt;
	&amp;lt;updateservers&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note: No spaces or linebreaks allowed between the server tags --&amp;gt;&lt;br /&gt;
		&amp;lt;server type=&amp;quot;extension&amp;quot; priority=&amp;quot;1&amp;quot; name=&amp;quot;HelloWorld Update Site&amp;quot;&amp;gt;http://yourdomain.com/update/helloworld-update.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
	&amp;lt;/updateservers&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when you view your &#039;&#039;&#039;hello-world&#039;&#039;&#039; update function via the front-end menu option, you will see the colours of the text and background being utilised.&lt;br /&gt;
&lt;br /&gt;
== Zips ==&lt;br /&gt;
Download the zip file for this Part:&lt;br /&gt;
[http://www.glennarkell.com/joomlaorg/com_helloworld_0.0.19.zip]&lt;br /&gt;
&lt;br /&gt;
== Navigate ==&lt;br /&gt;
&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 18|Prev: Example of a Frontend Update Function]]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:garkell|Glenn Arkell]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[category:Joomla! 1.6]]&lt;br /&gt;
[[category:Joomla! 1.7]]&lt;br /&gt;
[[category:Joomla! 2.5]]&lt;br /&gt;
[[category:Manual]]&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Example_of_a_frontend_update_function&amp;diff=67235</id>
		<title>Archived:Developing a MVC Component/Example of a frontend update function</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Example_of_a_frontend_update_function&amp;diff=67235"/>
		<updated>2012-05-12T23:04:30Z</updated>

		<summary type="html">&lt;p&gt;Garkell: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial is for {{JVer|1.6}} {{JVer|1.7}} {{JVer|2.5}}&lt;br /&gt;
== Warning - this article needs to be reviewed by someone who knows what they&#039;re doing ==&lt;br /&gt;
&lt;br /&gt;
== Articles in this series ==&lt;br /&gt;
{{Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Contents}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Basic frontend form ==&lt;br /&gt;
Designing the frontend interface leads us to create a Model-View-Controller triptych similar to the backend in Part 7.&lt;br /&gt;
&lt;br /&gt;
== Create the specific controller ==&lt;br /&gt;
The entry point now gets an instance of an &#039;&#039;UpdHelloWorld&#039;&#039; prefixed controller which extends the function of JControllerForm. Let&#039;s create a basic controllerform for the site part:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/controllers/updhelloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/controllers/updhelloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
// No direct access.&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
// Include dependancy of the main controllerform class&lt;br /&gt;
jimport(&#039;joomla.application.component.controllerform&#039;);&lt;br /&gt;
&lt;br /&gt;
class HelloWorldControllerUpdHelloWorld extends JControllerForm&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
	public function getModel($name = &#039;&#039;, $prefix = &#039;&#039;, $config = array(&#039;ignore_request&#039; =&amp;gt; true))&lt;br /&gt;
	{&lt;br /&gt;
		return parent::getModel($name, $prefix, array(&#039;ignore_request&#039; =&amp;gt; false));&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public function submit()&lt;br /&gt;
	{&lt;br /&gt;
		// Check for request forgeries.&lt;br /&gt;
		JRequest::checkToken() or jexit(JText::_(&#039;JINVALID_TOKEN&#039;));&lt;br /&gt;
&lt;br /&gt;
		// Initialise variables.&lt;br /&gt;
		$app	= JFactory::getApplication();&lt;br /&gt;
		$model	= $this-&amp;gt;getModel(&#039;updhelloworld&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Get the data from the form POST&lt;br /&gt;
		$data = JRequest::getVar(&#039;jform&#039;, array(), &#039;post&#039;, &#039;array&#039;);&lt;br /&gt;
&lt;br /&gt;
        // Now update the loaded data to the database via a function in the model&lt;br /&gt;
        $upditem	= $model-&amp;gt;updItem($data);&lt;br /&gt;
&lt;br /&gt;
    	// check if ok and display appropriate message.  This can also have a redirect if desired.&lt;br /&gt;
        if ($upditem) {&lt;br /&gt;
            echo &amp;quot;&amp;lt;h2&amp;gt;Updated Greeting has been saved&amp;lt;/h2&amp;gt;&amp;quot;;&lt;br /&gt;
        } else {&lt;br /&gt;
            echo &amp;quot;&amp;lt;h2&amp;gt;Updated Greeting failed to be saved&amp;lt;/h2&amp;gt;&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		return true;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This controller will display the appropriate message after the form is submitted.&lt;br /&gt;
&lt;br /&gt;
== Create the view ==&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, create a file &#039;&#039;site/views/updhelloworld/view.html.php&#039;&#039; containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/view.html.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/view.html.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 &lt;br /&gt;
// import Joomla view library&lt;br /&gt;
jimport(&#039;joomla.application.component.view&#039;);&lt;br /&gt;
 &lt;br /&gt;
/**&lt;br /&gt;
 * HTML View class for the UpdHelloWorld Component&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewUpdHelloWorld extends JView&lt;br /&gt;
{&lt;br /&gt;
	// Overwriting JView display method&lt;br /&gt;
	function display($tpl = null) &lt;br /&gt;
	{&lt;br /&gt;
		$app		= JFactory::getApplication();&lt;br /&gt;
		$params		= $app-&amp;gt;getParams();&lt;br /&gt;
		$dispatcher = JDispatcher::getInstance();&lt;br /&gt;
&lt;br /&gt;
		// Get some data from the models&lt;br /&gt;
		$state		= $this-&amp;gt;get(&#039;State&#039;);&lt;br /&gt;
		$item		= $this-&amp;gt;get(&#039;Item&#039;);&lt;br /&gt;
		$this-&amp;gt;form	= $this-&amp;gt;get(&#039;Form&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Check for errors.&lt;br /&gt;
		if (count($errors = $this-&amp;gt;get(&#039;Errors&#039;))) &lt;br /&gt;
		{&lt;br /&gt;
			JError::raiseError(500, implode(&#039;&amp;lt;br /&amp;gt;&#039;, $errors));&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Joomla, views display data using a layout. With your favorite file manager and editor, put a file &#039;&#039;site/views/updhelloworld/tmpl/default.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/tmpl/default.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/tmpl/default.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JHtml::_(&#039;behavior.keepalive&#039;);&lt;br /&gt;
JHtml::_(&#039;behavior.formvalidation&#039;);&lt;br /&gt;
JHtml::_(&#039;behavior.tooltip&#039;);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
    &amp;lt;h2&amp;gt;Update the Hello World greeting&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;form class=&amp;quot;form-validate&amp;quot; action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php&#039;); ?&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot; id=&amp;quot;updhelloworld&amp;quot; name=&amp;quot;updhelloworld&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset&amp;gt;&lt;br /&gt;
        	&amp;lt;dl&amp;gt;&lt;br /&gt;
          	    &amp;lt;dt&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getLabel(&#039;id&#039;); ?&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
             	&amp;lt;dd&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getInput(&#039;id&#039;); ?&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
        	    &amp;lt;dt&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getLabel(&#039;greeting&#039;); ?&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
        	    &amp;lt;dd&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getInput(&#039;greeting&#039;); ?&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
            	&amp;lt;dd&amp;gt;&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;option&amp;quot; value=&amp;quot;com_helloworld&amp;quot; /&amp;gt;&lt;br /&gt;
            	    &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;updhelloworld.submit&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
                &amp;lt;dd&amp;gt;&amp;lt;button type=&amp;quot;submit&amp;quot; class=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Submit&#039;); ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
			                &amp;lt;?php echo JHtml::_(&#039;form.token&#039;); ?&amp;gt;&lt;br /&gt;
                &amp;lt;/dd&amp;gt;&lt;br /&gt;
        	&amp;lt;/dl&amp;gt;&lt;br /&gt;
        &amp;lt;fieldset&amp;gt;&lt;br /&gt;
    &amp;lt;/form&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;clr&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This layout utilises the forms design which resides with the related model.  The getLabel and getInput will pickup the xml fields defined and display appropriately.  More on the xml file within the models section of this tutorial.&lt;br /&gt;
&lt;br /&gt;
Create a file &#039;&#039;site/views/updhelloworld/tmpl/default.xml&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/tmpl/default.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This enables a menu option to be allocated to the frontend form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the model ==&lt;br /&gt;
The &#039;&#039;UpdHelloWorld&#039;&#039; model sets up the data through from the related form and allows the mechanism to save the subsequent data loaded into the form into the database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/updhelloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/models/updhelloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 &lt;br /&gt;
// Include dependancy of the main model form&lt;br /&gt;
jimport(&#039;joomla.application.component.modelform&#039;);&lt;br /&gt;
// import Joomla modelitem library&lt;br /&gt;
jimport(&#039;joomla.application.component.modelitem&#039;);&lt;br /&gt;
// Include dependancy of the dispatcher&lt;br /&gt;
jimport(&#039;joomla.event.dispatcher&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * UpdHelloWorld Model&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelUpdHelloWorld extends JModelForm&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var object item&lt;br /&gt;
	 */&lt;br /&gt;
	protected $item;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the data for a new qualification&lt;br /&gt;
	 */&lt;br /&gt;
	public function getForm($data = array(), $loadData = true)&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
        $app = JFactory::getApplication(&#039;site&#039;);&lt;br /&gt;
&lt;br /&gt;
        // Get the form.&lt;br /&gt;
		$form = $this-&amp;gt;loadForm(&#039;com_helloworld.updhelloworld&#039;, &#039;updhelloworld&#039;, array(&#039;control&#039; =&amp;gt; &#039;jform&#039;, &#039;load_data&#039; =&amp;gt; true));&lt;br /&gt;
		if (empty($form)) {&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		return $form;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 * @return object The message to be displayed to the user&lt;br /&gt;
	 */&lt;br /&gt;
	function &amp;amp;getItem()&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;_item))&lt;br /&gt;
		{&lt;br /&gt;
			$cache = JFactory::getCache(&#039;com_helloworld&#039;, &#039;&#039;);&lt;br /&gt;
			$id = $this-&amp;gt;getState(&#039;helloworld.id&#039;);&lt;br /&gt;
			$this-&amp;gt;_item =  $cache-&amp;gt;get($id);&lt;br /&gt;
			if ($this-&amp;gt;_item === false) {&lt;br /&gt;
&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		return $this-&amp;gt;_item;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public function updItem($data)&lt;br /&gt;
	{&lt;br /&gt;
        // set the variables from the passed data&lt;br /&gt;
        $id = $data[&#039;id&#039;];&lt;br /&gt;
        $greeting = $data[&#039;greeting&#039;];&lt;br /&gt;
&lt;br /&gt;
        // set the data into a query to update the record&lt;br /&gt;
		$db		= $this-&amp;gt;getDbo();&lt;br /&gt;
		$query	= $db-&amp;gt;getQuery(true);&lt;br /&gt;
        $query-&amp;gt;clear();&lt;br /&gt;
		$query-&amp;gt;update(&#039; #__helloworld &#039;);&lt;br /&gt;
		$query-&amp;gt;set(&#039; greeting = &#039;.$db-&amp;gt;Quote($greeting) );&lt;br /&gt;
		$query-&amp;gt;where(&#039; id = &#039; . (int) $id );&lt;br /&gt;
&lt;br /&gt;
		$db-&amp;gt;setQuery((string)$query);&lt;br /&gt;
&lt;br /&gt;
        if (!$db-&amp;gt;query()) {&lt;br /&gt;
            JError::raiseError(500, $db-&amp;gt;getErrorMsg());&lt;br /&gt;
        	return false;&lt;br /&gt;
        } else {&lt;br /&gt;
        	return true;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following file &#039;&#039;updhelloworld.xml&#039;&#039; should be created using your favourite editor and saved in the forms folder under the models directory.  The first of the fields being referenced id using the sql type so that I returns the results from the query into a dropdown list form to be selected.&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/forms/updhelloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/models/forms/updhelloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;form name=&amp;quot;updhelloworld&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset name=&amp;quot;updhelloworld&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;field&lt;br /&gt;
            name=&amp;quot;id&amp;quot;&lt;br /&gt;
            type=&amp;quot;sql&amp;quot;&lt;br /&gt;
            multiple=&amp;quot;false&amp;quot;&lt;br /&gt;
            size=&amp;quot;1&amp;quot;&lt;br /&gt;
            label=&amp;quot;COM_HELLOWORLD_FORM_LBL_UPDHELLOWORLD_ID&amp;quot;&lt;br /&gt;
            description=&amp;quot;COM_HELLOWORLD_FORM_DESC_UPDHELLOWORLD_ID&amp;quot;&lt;br /&gt;
            query=&amp;quot;select id, greeting from #__helloworld&amp;quot;&lt;br /&gt;
            key_field=&amp;quot;id&amp;quot;&lt;br /&gt;
            value_field=&amp;quot;greeting&amp;quot;&lt;br /&gt;
            default=&amp;quot;0&amp;quot;&lt;br /&gt;
	    required=&amp;quot;true&amp;quot;&lt;br /&gt;
            &amp;gt;&lt;br /&gt;
                &amp;lt;option value=&amp;quot;&amp;quot;&amp;gt;JOPTION_SELECT_ID&amp;lt;/option&amp;gt;&lt;br /&gt;
        &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;field&lt;br /&gt;
            name=&amp;quot;greeting&amp;quot;&lt;br /&gt;
            type=&amp;quot;text&amp;quot;&lt;br /&gt;
	    description=&amp;quot;COM_HELLOWORLD_FORM_DESC_UPDHELLOWORLD_GREETING&amp;quot;&lt;br /&gt;
	    label=&amp;quot;COM_HELLOWORLD_FORM_LBL_UPDHELLOWORLD_GREETING&amp;quot;&lt;br /&gt;
	    required=&amp;quot;true&amp;quot;&lt;br /&gt;
	    size=&amp;quot;50&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding some language keys ==&lt;br /&gt;
&lt;br /&gt;
This file provides the text link between the label in the model form definition to be displayed in the view.  And being for the frontend, it resides in the site folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/language/en-GB/en-GB.com_helloworld.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/language/en-GB/en-GB.com_helloworld.ini&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
COM_HELLOWORLD_FORM_LBL_UPDHELLOWORLD_ID=&amp;quot;Greeting ID&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_FORM_DESC_UPDHELLOWORLD_ID=&amp;quot;This is the ID of the Greeting record&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_FORM_LBL_UPDHELLOWORLD_GREETING=&amp;quot;Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_FORM_DESC_UPDHELLOWORLD_GREETING=&amp;quot;Greeting description&amp;quot;&lt;br /&gt;
JOPTION_SELECT_ID=&amp;quot; -- Select Greeting to Update -- &amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the last 2 lines to the &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.ini&#039;&#039; file to provide the text link for the menu type display.  And being for the backend, it resides in the admin language folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/language/en-GB/en-GB.com_helloworld.sys.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.ini&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
COM_HELLOWORLD=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_DESCRIPTION=&amp;quot;This is the Hello World description&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC=&amp;quot;This view displays a selected message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE=&amp;quot;Hello World&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_INSTALL_TEXT=&amp;quot;HelloWorld Install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MENU=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_DISCOVER_INSTALL_TEXT=&amp;quot;HelloWorld postlight discover install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_INSTALL_TEXT=&amp;quot;HelloWorld postflight install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_UNINSTALL_TEXT=&amp;quot;HelloWorld postflight uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_UPDATE_TEXT=&amp;quot;HelloWorld postflight update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_DISCOVER_INSTALL_TEXT=&amp;quot;HelloWorld preflight discover install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_INSTALL_TEXT=&amp;quot;HelloWorld preflight install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_UNINSTALL_TEXT=&amp;quot;HelloWorld preflight uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_UPDATE_TEXT=&amp;quot;HelloWorld preflight update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UNINSTALL_TEXT=&amp;quot;HelloWorld Uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDATE_TEXT=&amp;quot;HelloWorld Update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_TITLE=&amp;quot;Update the Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_DESC=&amp;quot;Update greeting here&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;_populateState&#039;&#039; method is, by default, automatically called when a state is read by the &#039;&#039;getState&#039;&#039; method.&lt;br /&gt;
&lt;br /&gt;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory-&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#script.php|script.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/updhelloworld.php|site/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/controllers/updhelloworld.php|site/controllers/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/controllers/index.html|site/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/views/updhelloworld/view.html.php|site/views/updhelloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/updhelloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/views/updhelloworld/tmpl/default.xml|site/views/updhelloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/views/updhelloworld/tmpl/default.php|site/views/updhelloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/models/updhelloworld.php|site/models/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/models/forms/updhelloworld.xml|site/models/forms/updhelloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#site/language/en-GB/en-GB.com_helloworld.ini|site/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/access.xml|admin/access.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/config.xml|admin/config.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_12#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_12#admin/sql/updates/mysql/0.0.12.sql|admin/sql/updates/mysql/0.0.12.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/sql/updates/mysql/0.0.13.sql|admin/sql/updates/mysql/0.0.13.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_12#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/models/forms/helloworld.xml|admin/models/forms/helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/forms/helloworld.js|admin/models/forms/helloworld.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/rules/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/rules/greeting.php|admin/models/rules/greeting.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/models/helloworld.php|admin/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_09#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/views/helloworld/view.html.php|admin/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworld/submitbutton.js|admin/views/helloworld/submitbutton.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/views/helloworld/tmpl/edit.php|admin/views/helloworld/tmpl/edit.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/helpers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/helpers/helloworld.php|admin/helpers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/language/en-GB/en-GB.com_helloworld.ini|admin/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/language/en-GB/en-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/controllers/helloworld.php|admin/controllers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/controllers/helloworlds.php|admin/controllers/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#language/en-GB/en-GB.ini|language/en-GB/en-GB.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/images/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-16x16.png&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-48x48.png&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [http://joomlacode.org/gf/download/frsrelease/11394/58397/com_helloworld-1.6-part07.zip archive] and install it using the extension manager of Joomla. You can add a menu item of this component using the menu manager in the backend.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;2.5.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;name&amp;gt;COM_HELLOWORLD&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting conttraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;November 2009&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.18&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;COM_HELLOWORLD_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- Runs on install/uninstall/update; New in 2.5 --&amp;gt;&lt;br /&gt;
	&amp;lt;scriptfile&amp;gt;script.php&amp;lt;/scriptfile&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New in 2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;updhelloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;media destination=&amp;quot;com_helloworld&amp;quot; folder=&amp;quot;media&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;images&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/media&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu img=&amp;quot;../media/com_helloworld/images/tux-16x16.png&amp;quot;&amp;gt;COM_HELLOWORLD_MENU&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;config.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;access.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- views files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- controllers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- helpers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;helpers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		&amp;lt;languages folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;/languages&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- UPDATESERVER DEFINITION --&amp;gt;&lt;br /&gt;
	&amp;lt;updateservers&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note: No spaces or linebreaks allowed between the server tags --&amp;gt;&lt;br /&gt;
		&amp;lt;server type=&amp;quot;extension&amp;quot; priority=&amp;quot;1&amp;quot; name=&amp;quot;HelloWorld Update Site&amp;quot;&amp;gt;http://yourdomain.com/update/helloworld-update.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
	&amp;lt;/updateservers&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can see in your component &#039;&#039;&#039;hello-world&#039;&#039;&#039; an array with two colums, two rows and checkboxes. You can click the checkboxes in order to select the different options you want.&lt;br /&gt;
&lt;br /&gt;
== Zips ==&lt;br /&gt;
Download the zip file for this Part:&lt;br /&gt;
[http://www.glennarkell.com/joomlaorg/com_helloworld_0.0.18.zip]&lt;br /&gt;
&lt;br /&gt;
== Navigate ==&lt;br /&gt;
&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 17|Prev: Adding an update server]]&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 19|Next: Example of Menu Parameters &amp;amp; Stylesheets]]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:garkell|Glenn Arkell]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[category:Joomla! 1.6]]&lt;br /&gt;
[[category:Joomla! 1.7]]&lt;br /&gt;
[[category:Joomla! 2.5]]&lt;br /&gt;
[[category:Manual]]&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Example_of_menu_parameters_and_stylesheets&amp;diff=67234</id>
		<title>Archived:Developing a MVC Component/Example of menu parameters and stylesheets</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Example_of_menu_parameters_and_stylesheets&amp;diff=67234"/>
		<updated>2012-05-12T23:01:22Z</updated>

		<summary type="html">&lt;p&gt;Garkell: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial is for {{JVer|1.6}} {{JVer|1.7}} {{JVer|2.5}}&lt;br /&gt;
== Warning - this article needs to be reviewed by someone who knows what they&#039;re doing ==&lt;br /&gt;
&lt;br /&gt;
== Articles in this series ==&lt;br /&gt;
{{Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Contents}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Update the view ==&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, update the file &#039;&#039;site/views/updhelloworld/view.html.php&#039;&#039; to include setting the state.  For the stylesheet, include the import of the html class, and add a new function for including the stylesheet file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/view.html.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/view.html.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 &lt;br /&gt;
// import Joomla view library&lt;br /&gt;
jimport(&#039;joomla.application.component.view&#039;);&lt;br /&gt;
// import Joomla html for use with stylesheets&lt;br /&gt;
jimport(&#039;joomla.html.html&#039;);&lt;br /&gt;
 &lt;br /&gt;
/**&lt;br /&gt;
 * HTML View class for the UpdHelloWorld Component&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewUpdHelloWorld extends JView&lt;br /&gt;
{&lt;br /&gt;
	// Overwriting JView display method&lt;br /&gt;
	function display($tpl = null) &lt;br /&gt;
	{&lt;br /&gt;
		$app		= JFactory::getApplication();&lt;br /&gt;
		$params		= $app-&amp;gt;getParams();&lt;br /&gt;
		$dispatcher = JDispatcher::getInstance();&lt;br /&gt;
&lt;br /&gt;
		// Get some data from the models&lt;br /&gt;
		$state		= $this-&amp;gt;get(&#039;State&#039;);&lt;br /&gt;
		$item		= $this-&amp;gt;get(&#039;Item&#039;);&lt;br /&gt;
		$this-&amp;gt;form	= $this-&amp;gt;get(&#039;Form&#039;);&lt;br /&gt;
		$this-&amp;gt;state = $this-&amp;gt;get(&#039;State&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Check for errors.&lt;br /&gt;
		if (count($errors = $this-&amp;gt;get(&#039;Errors&#039;))) &lt;br /&gt;
		{&lt;br /&gt;
			JError::raiseError(500, implode(&#039;&amp;lt;br /&amp;gt;&#039;, $errors));&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		// get the stylesheet and/or other document values such as title&lt;br /&gt;
        	$this-&amp;gt;addDocStyle();&lt;br /&gt;
&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Add the stylesheet to the document.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function addDocStyle()&lt;br /&gt;
	{&lt;br /&gt;
        $doc = JFactory::getDocument();&lt;br /&gt;
        $doc-&amp;gt;addStyleSheet(&#039;media/com_helloworld/css/site.stylesheet.css&#039;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Update the layout ==&lt;br /&gt;
&lt;br /&gt;
In Joomla, views display data using a layout. With your favorite file manager and editor, edit your file &#039;&#039;site/views/updhelloworld/tmpl/default.php&#039;&#039; to get the parameter values&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/tmpl/default.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/tmpl/default.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JHtml::_(&#039;behavior.keepalive&#039;);&lt;br /&gt;
JHtml::_(&#039;behavior.formvalidation&#039;);&lt;br /&gt;
JHtml::_(&#039;behavior.tooltip&#039;);&lt;br /&gt;
&lt;br /&gt;
// get the menu parameters for use&lt;br /&gt;
$menuparams = $this-&amp;gt;state-&amp;gt;get(&amp;quot;menuparams&amp;quot;);&lt;br /&gt;
$headingtxtcolor = $menuparams-&amp;gt;get(&amp;quot;headingtxtcolor&amp;quot;);&lt;br /&gt;
$headingbgcolor = $menuparams-&amp;gt;get(&amp;quot;headingbgcolor&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
    &amp;lt;h2 style=&amp;quot;color:&amp;lt;?php echo $headingtxtcolor; ?&amp;gt;; background-color:&amp;lt;?php echo $headingbgcolor; ?&amp;gt;;&amp;quot;&amp;gt;Update the Hello World greeting&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;form class=&amp;quot;form-validate&amp;quot; action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php&#039;); ?&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot; id=&amp;quot;updhelloworld&amp;quot; name=&amp;quot;updhelloworld&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset&amp;gt;&lt;br /&gt;
        	&amp;lt;dl&amp;gt;&lt;br /&gt;
          	    &amp;lt;dt&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getLabel(&#039;id&#039;); ?&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
             	&amp;lt;dd&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getInput(&#039;id&#039;); ?&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
        	    &amp;lt;dt&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getLabel(&#039;greeting&#039;); ?&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
        	    &amp;lt;dd&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getInput(&#039;greeting&#039;); ?&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
            	&amp;lt;dd&amp;gt;&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;option&amp;quot; value=&amp;quot;com_helloworld&amp;quot; /&amp;gt;&lt;br /&gt;
            	    &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;updhelloworld.submit&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
                &amp;lt;dd&amp;gt;&amp;lt;button type=&amp;quot;submit&amp;quot; class=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Submit&#039;); ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
			                &amp;lt;?php echo JHtml::_(&#039;form.token&#039;); ?&amp;gt;&lt;br /&gt;
                &amp;lt;/dd&amp;gt;&lt;br /&gt;
        	&amp;lt;/dl&amp;gt;&lt;br /&gt;
        &amp;lt;fieldset&amp;gt;&lt;br /&gt;
    &amp;lt;/form&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;clr&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This layout utilises the forms design which resides with the related model.  The getLabel and getInput will pickup the xml fields defined and display appropriately.  More on the xml file within the models section of this tutorial.&lt;br /&gt;
&lt;br /&gt;
Update the file &#039;&#039;site/views/updhelloworld/tmpl/default.xml&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/tmpl/default.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
    &amp;lt;layout title=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;message&amp;gt;COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
    &amp;lt;/layout&amp;gt;&lt;br /&gt;
    &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;field name=&amp;quot;headingtxtcolor&amp;quot; type=&amp;quot;text&amp;quot; default=&amp;quot;#ff0000&amp;quot; size=&amp;quot;40&amp;quot;&lt;br /&gt;
                label=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGTXTCOLOR_LABEL&amp;quot;&lt;br /&gt;
                description=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGTXTCOLOR_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;field name=&amp;quot;headingbgcolor&amp;quot; type=&amp;quot;text&amp;quot; default=&amp;quot;#0000ff&amp;quot; size=&amp;quot;40&amp;quot;&lt;br /&gt;
                label=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGBGCOLOR_LABEL&amp;quot;&lt;br /&gt;
                description=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGBGCOLOR_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
    &amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the parameter fields and allows for default values to be set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Update the model ==&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;UpdHelloWorld&#039;&#039; model sets up the data sent from the related form and allows for saving the data from the form into the database.  In the getItem method we will get the values from the parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/updhelloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/models/updhelloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 &lt;br /&gt;
// Include dependancy of the main model form&lt;br /&gt;
jimport(&#039;joomla.application.component.modelform&#039;);&lt;br /&gt;
// import Joomla modelitem library&lt;br /&gt;
jimport(&#039;joomla.application.component.modelitem&#039;);&lt;br /&gt;
// Include dependancy of the dispatcher&lt;br /&gt;
jimport(&#039;joomla.event.dispatcher&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * UpdHelloWorld Model&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelUpdHelloWorld extends JModelForm&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var object item&lt;br /&gt;
	 */&lt;br /&gt;
	protected $item;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the data for a new qualification&lt;br /&gt;
	 */&lt;br /&gt;
	public function getForm($data = array(), $loadData = true)&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
        $app = JFactory::getApplication(&#039;site&#039;);&lt;br /&gt;
&lt;br /&gt;
        // Get the form.&lt;br /&gt;
		$form = $this-&amp;gt;loadForm(&#039;com_helloworld.updhelloworld&#039;, &#039;updhelloworld&#039;, array(&#039;control&#039; =&amp;gt; &#039;jform&#039;, &#039;load_data&#039; =&amp;gt; true));&lt;br /&gt;
		if (empty($form)) {&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		return $form;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 * @return object The message to be displayed to the user&lt;br /&gt;
	 */&lt;br /&gt;
	function &amp;amp;getItem()&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;_item))&lt;br /&gt;
		{&lt;br /&gt;
			$cache = JFactory::getCache(&#039;com_helloworld&#039;, &#039;&#039;);&lt;br /&gt;
			$id = $this-&amp;gt;getState(&#039;helloworld.id&#039;);&lt;br /&gt;
			$this-&amp;gt;_item =  $cache-&amp;gt;get($id);&lt;br /&gt;
			if ($this-&amp;gt;_item === false) {&lt;br /&gt;
&lt;br /&gt;
                // Menu parameters&lt;br /&gt;
                $menuitemid = JRequest::getInt( &#039;Itemid&#039; );  // this returns the menu id number so you can reference parameters&lt;br /&gt;
                $menu = JSite::getMenu();&lt;br /&gt;
                if ($menuitemid) {&lt;br /&gt;
                   $menuparams = $menu-&amp;gt;getParams( $menuitemid );&lt;br /&gt;
                   $headingtxtcolor = $menuparams-&amp;gt;get(&#039;headingtxtcolor&#039;);  // This shows how to get an individual parameter for use&lt;br /&gt;
                   $headingbgcolor = $menuparams-&amp;gt;get(&#039;headingbgcolor&#039;);  // This shows how to get an individual parameter for use&lt;br /&gt;
                }&lt;br /&gt;
                $this-&amp;gt;setState(&#039;menuparams&#039;, $menuparams);  // this sets the parameter values to the state for later use&lt;br /&gt;
&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		return $this-&amp;gt;_item;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public function updItem($data)&lt;br /&gt;
	{&lt;br /&gt;
        // set the variables from the passed data&lt;br /&gt;
        $id = $data[&#039;id&#039;];&lt;br /&gt;
        $greeting = $data[&#039;greeting&#039;];&lt;br /&gt;
&lt;br /&gt;
        // set the data into a query to update the record&lt;br /&gt;
		$db		= $this-&amp;gt;getDbo();&lt;br /&gt;
		$query	= $db-&amp;gt;getQuery(true);&lt;br /&gt;
        $query-&amp;gt;clear();&lt;br /&gt;
		$query-&amp;gt;update(&#039; #__helloworld &#039;);&lt;br /&gt;
		$query-&amp;gt;set(&#039; greeting = &#039;.$db-&amp;gt;Quote($greeting) );&lt;br /&gt;
		$query-&amp;gt;where(&#039; id = &#039; . (int) $id );&lt;br /&gt;
&lt;br /&gt;
		$db-&amp;gt;setQuery((string)$query);&lt;br /&gt;
&lt;br /&gt;
        if (!$db-&amp;gt;query()) {&lt;br /&gt;
            JError::raiseError(500, $db-&amp;gt;getErrorMsg());&lt;br /&gt;
        	return false;&lt;br /&gt;
        } else {&lt;br /&gt;
        	return true;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add a stylesheet file ==&lt;br /&gt;
&lt;br /&gt;
Create a new stylesheet file to contain the css code you want to use on your component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;media/css/site.stylesheet.css&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;media/css/site.stylesheet.css&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
p {&lt;br /&gt;
   color: #000000;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding some language keys ==&lt;br /&gt;
&lt;br /&gt;
Add the last 4 lines to the &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.ini&#039;&#039; file to provide the text link for the parameter type display.  And being for the backend, it resides in the admin language folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/language/en-GB/en-GB.com_helloworld.sys.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.ini&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
COM_HELLOWORLD=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_DESCRIPTION=&amp;quot;This is the Hello World description&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC=&amp;quot;This view displays a selected message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE=&amp;quot;Hello World&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_INSTALL_TEXT=&amp;quot;HelloWorld Install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MENU=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_DISCOVER_INSTALL_TEXT=&amp;quot;HelloWorld postlight discover install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_INSTALL_TEXT=&amp;quot;HelloWorld postflight install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_UNINSTALL_TEXT=&amp;quot;HelloWorld postflight uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_UPDATE_TEXT=&amp;quot;HelloWorld postflight update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_DISCOVER_INSTALL_TEXT=&amp;quot;HelloWorld preflight discover install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_INSTALL_TEXT=&amp;quot;HelloWorld preflight install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_UNINSTALL_TEXT=&amp;quot;HelloWorld preflight uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_UPDATE_TEXT=&amp;quot;HelloWorld preflight update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UNINSTALL_TEXT=&amp;quot;HelloWorld Uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDATE_TEXT=&amp;quot;HelloWorld Update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_TITLE=&amp;quot;Update the Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_DESC=&amp;quot;Update greeting here&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGTXTCOLOR_LABEL=&amp;quot;Colour of Text&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGTXTCOLOR_DESC=&amp;quot;Set the colour of the text on the heading&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGBGCOLOR_LABEL=&amp;quot;Colour of Background&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGBGCOLOR_DESC=&amp;quot;Set the colour of the background on the heading&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;_populateState&#039;&#039; method is, by default, automatically called when a state is read by the &#039;&#039;getState&#039;&#039; method.&lt;br /&gt;
&lt;br /&gt;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory-&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#script.php|script.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/updhelloworld.php|site/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/controllers/updhelloworld.php|site/controllers/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/controllers/index.html|site/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/views/updhelloworld/view.html.php|site/views/updhelloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/updhelloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/views/updhelloworld/tmpl/default.xml|site/views/updhelloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/views/updhelloworld/tmpl/default.php|site/views/updhelloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/models/updhelloworld.php|site/models/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/models/forms/updhelloworld.xml|site/models/forms/updhelloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#site/language/en-GB/en-GB.com_helloworld.ini|site/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/access.xml|admin/access.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/config.xml|admin/config.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_12#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_12#admin/sql/updates/mysql/0.0.12.sql|admin/sql/updates/mysql/0.0.12.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/sql/updates/mysql/0.0.13.sql|admin/sql/updates/mysql/0.0.13.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_12#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/models/forms/helloworld.xml|admin/models/forms/helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/forms/helloworld.js|admin/models/forms/helloworld.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/rules/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/rules/greeting.php|admin/models/rules/greeting.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/models/helloworld.php|admin/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_09#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/views/helloworld/view.html.php|admin/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworld/submitbutton.js|admin/views/helloworld/submitbutton.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/views/helloworld/tmpl/edit.php|admin/views/helloworld/tmpl/edit.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/helpers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/helpers/helloworld.php|admin/helpers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/language/en-GB/en-GB.com_helloworld.ini|admin/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/language/en-GB/en-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/controllers/helloworld.php|admin/controllers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/controllers/helloworlds.php|admin/controllers/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#language/en-GB/en-GB.ini|language/en-GB/en-GB.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/images/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-16x16.png&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-48x48.png&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [http://www.glennarkell.com/joomlaorg/com_helloworld_0.0.19.zip] and install it using the extension manager of Joomla. You can add a menu item of this component using the menu manager in the backend.&lt;br /&gt;
&lt;br /&gt;
Be sure to update your manifest to include the stylesheet folder within the media section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;2.5.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;name&amp;gt;COM_HELLOWORLD&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting conttraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;November 2009&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.19&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;COM_HELLOWORLD_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- Runs on install/uninstall/update; New in 2.5 --&amp;gt;&lt;br /&gt;
	&amp;lt;scriptfile&amp;gt;script.php&amp;lt;/scriptfile&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New in 2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;updhelloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;media destination=&amp;quot;com_helloworld&amp;quot; folder=&amp;quot;media&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;css&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;images&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/media&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu img=&amp;quot;../media/com_helloworld/images/tux-16x16.png&amp;quot;&amp;gt;COM_HELLOWORLD_MENU&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;config.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;access.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- views files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- controllers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- helpers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;helpers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		&amp;lt;languages folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;/languages&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- UPDATESERVER DEFINITION --&amp;gt;&lt;br /&gt;
	&amp;lt;updateservers&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note: No spaces or linebreaks allowed between the server tags --&amp;gt;&lt;br /&gt;
		&amp;lt;server type=&amp;quot;extension&amp;quot; priority=&amp;quot;1&amp;quot; name=&amp;quot;HelloWorld Update Site&amp;quot;&amp;gt;http://yourdomain.com/update/helloworld-update.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
	&amp;lt;/updateservers&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when you view your &#039;&#039;&#039;hello-world&#039;&#039;&#039; update function via the front-end menu option, you will see the colours of the text and background being utilised.&lt;br /&gt;
&lt;br /&gt;
== Zips ==&lt;br /&gt;
Download the zip file for this Part:&lt;br /&gt;
[http://www.glennarkell.com/joomlaorg/com_helloworld_0.0.19.zip]&lt;br /&gt;
&lt;br /&gt;
== Navigate ==&lt;br /&gt;
&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 18|Prev: Example of a Frontend Update Function]]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:garkell|Glenn Arkell]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[category:Joomla! 1.6]]&lt;br /&gt;
[[category:Joomla! 1.7]]&lt;br /&gt;
[[category:Joomla! 2.5]]&lt;br /&gt;
[[category:Manual]]&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Example_of_menu_parameters_and_stylesheets&amp;diff=67233</id>
		<title>Archived:Developing a MVC Component/Example of menu parameters and stylesheets</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Example_of_menu_parameters_and_stylesheets&amp;diff=67233"/>
		<updated>2012-05-12T22:59:59Z</updated>

		<summary type="html">&lt;p&gt;Garkell: /* Add a stylesheet file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial is for {{JVer|1.6}} {{JVer|1.7}} {{JVer|2.5}}&lt;br /&gt;
== Warning - this article needs to be reviewed by someone who knows what they&#039;re doing ==&lt;br /&gt;
&lt;br /&gt;
== Articles in this series ==&lt;br /&gt;
{{Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Contents}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Update the view ==&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, update the file &#039;&#039;site/views/updhelloworld/view.html.php&#039;&#039; to include setting the state.  For the stylesheet, include the import of the html class, and add a new function for including the stylesheet file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/view.html.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/view.html.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 &lt;br /&gt;
// import Joomla view library&lt;br /&gt;
jimport(&#039;joomla.application.component.view&#039;);&lt;br /&gt;
// import Joomla html for use with stylesheets&lt;br /&gt;
jimport(&#039;joomla.html.html&#039;);&lt;br /&gt;
 &lt;br /&gt;
/**&lt;br /&gt;
 * HTML View class for the UpdHelloWorld Component&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewUpdHelloWorld extends JView&lt;br /&gt;
{&lt;br /&gt;
	// Overwriting JView display method&lt;br /&gt;
	function display($tpl = null) &lt;br /&gt;
	{&lt;br /&gt;
		$app		= JFactory::getApplication();&lt;br /&gt;
		$params		= $app-&amp;gt;getParams();&lt;br /&gt;
		$dispatcher = JDispatcher::getInstance();&lt;br /&gt;
&lt;br /&gt;
		// Get some data from the models&lt;br /&gt;
		$state		= $this-&amp;gt;get(&#039;State&#039;);&lt;br /&gt;
		$item		= $this-&amp;gt;get(&#039;Item&#039;);&lt;br /&gt;
		$this-&amp;gt;form	= $this-&amp;gt;get(&#039;Form&#039;);&lt;br /&gt;
		$this-&amp;gt;state = $this-&amp;gt;get(&#039;State&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Check for errors.&lt;br /&gt;
		if (count($errors = $this-&amp;gt;get(&#039;Errors&#039;))) &lt;br /&gt;
		{&lt;br /&gt;
			JError::raiseError(500, implode(&#039;&amp;lt;br /&amp;gt;&#039;, $errors));&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		// get the stylesheet and/or other document values such as title&lt;br /&gt;
        	$this-&amp;gt;addDocStyle();&lt;br /&gt;
&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Add the stylesheet to the document.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function addDocStyle()&lt;br /&gt;
	{&lt;br /&gt;
        $doc = JFactory::getDocument();&lt;br /&gt;
        $doc-&amp;gt;addStyleSheet(&#039;media/com_helloworld/css/site.stylesheet.css&#039;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Update the layout ==&lt;br /&gt;
&lt;br /&gt;
In Joomla, views display data using a layout. With your favorite file manager and editor, edit your file &#039;&#039;site/views/updhelloworld/tmpl/default.php&#039;&#039; to get the parameter values&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/tmpl/default.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/tmpl/default.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JHtml::_(&#039;behavior.keepalive&#039;);&lt;br /&gt;
JHtml::_(&#039;behavior.formvalidation&#039;);&lt;br /&gt;
JHtml::_(&#039;behavior.tooltip&#039;);&lt;br /&gt;
&lt;br /&gt;
// get the menu parameters for use&lt;br /&gt;
$menuparams = $this-&amp;gt;state-&amp;gt;get(&amp;quot;menuparams&amp;quot;);&lt;br /&gt;
$headingtxtcolor = $menuparams-&amp;gt;get(&amp;quot;headingtxtcolor&amp;quot;);&lt;br /&gt;
$headingbgcolor = $menuparams-&amp;gt;get(&amp;quot;headingbgcolor&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
    &amp;lt;h2 style=&amp;quot;color:&amp;lt;?php echo $headingtxtcolor; ?&amp;gt;; background-color:&amp;lt;?php echo $headingbgcolor; ?&amp;gt;;&amp;quot;&amp;gt;Update the Hello World greeting&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;form class=&amp;quot;form-validate&amp;quot; action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php&#039;); ?&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot; id=&amp;quot;updhelloworld&amp;quot; name=&amp;quot;updhelloworld&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset&amp;gt;&lt;br /&gt;
        	&amp;lt;dl&amp;gt;&lt;br /&gt;
          	    &amp;lt;dt&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getLabel(&#039;id&#039;); ?&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
             	&amp;lt;dd&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getInput(&#039;id&#039;); ?&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
        	    &amp;lt;dt&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getLabel(&#039;greeting&#039;); ?&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
        	    &amp;lt;dd&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getInput(&#039;greeting&#039;); ?&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
            	&amp;lt;dd&amp;gt;&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;option&amp;quot; value=&amp;quot;com_helloworld&amp;quot; /&amp;gt;&lt;br /&gt;
            	    &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;updhelloworld.submit&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
                &amp;lt;dd&amp;gt;&amp;lt;button type=&amp;quot;submit&amp;quot; class=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Submit&#039;); ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
			                &amp;lt;?php echo JHtml::_(&#039;form.token&#039;); ?&amp;gt;&lt;br /&gt;
                &amp;lt;/dd&amp;gt;&lt;br /&gt;
        	&amp;lt;/dl&amp;gt;&lt;br /&gt;
        &amp;lt;fieldset&amp;gt;&lt;br /&gt;
    &amp;lt;/form&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;clr&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This layout utilises the forms design which resides with the related model.  The getLabel and getInput will pickup the xml fields defined and display appropriately.  More on the xml file within the models section of this tutorial.&lt;br /&gt;
&lt;br /&gt;
Update the file &#039;&#039;site/views/updhelloworld/tmpl/default.xml&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/tmpl/default.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
    &amp;lt;layout title=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;message&amp;gt;COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
    &amp;lt;/layout&amp;gt;&lt;br /&gt;
    &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;field name=&amp;quot;headingtxtcolor&amp;quot; type=&amp;quot;text&amp;quot; default=&amp;quot;#ff0000&amp;quot; size=&amp;quot;40&amp;quot;&lt;br /&gt;
                label=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGTXTCOLOR_LABEL&amp;quot;&lt;br /&gt;
                description=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGTXTCOLOR_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;field name=&amp;quot;headingbgcolor&amp;quot; type=&amp;quot;text&amp;quot; default=&amp;quot;#0000ff&amp;quot; size=&amp;quot;40&amp;quot;&lt;br /&gt;
                label=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGBGCOLOR_LABEL&amp;quot;&lt;br /&gt;
                description=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGBGCOLOR_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
    &amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the parameter fields and allows for default values to be set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Update the model ==&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;UpdHelloWorld&#039;&#039; model sets up the data sent from the related form and allows for saving the data from the form into the database.  In the getItem method we will get the values from the parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/updhelloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/models/updhelloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 &lt;br /&gt;
// Include dependancy of the main model form&lt;br /&gt;
jimport(&#039;joomla.application.component.modelform&#039;);&lt;br /&gt;
// import Joomla modelitem library&lt;br /&gt;
jimport(&#039;joomla.application.component.modelitem&#039;);&lt;br /&gt;
// Include dependancy of the dispatcher&lt;br /&gt;
jimport(&#039;joomla.event.dispatcher&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * UpdHelloWorld Model&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelUpdHelloWorld extends JModelForm&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var object item&lt;br /&gt;
	 */&lt;br /&gt;
	protected $item;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the data for a new qualification&lt;br /&gt;
	 */&lt;br /&gt;
	public function getForm($data = array(), $loadData = true)&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
        $app = JFactory::getApplication(&#039;site&#039;);&lt;br /&gt;
&lt;br /&gt;
        // Get the form.&lt;br /&gt;
		$form = $this-&amp;gt;loadForm(&#039;com_helloworld.updhelloworld&#039;, &#039;updhelloworld&#039;, array(&#039;control&#039; =&amp;gt; &#039;jform&#039;, &#039;load_data&#039; =&amp;gt; true));&lt;br /&gt;
		if (empty($form)) {&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		return $form;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 * @return object The message to be displayed to the user&lt;br /&gt;
	 */&lt;br /&gt;
	function &amp;amp;getItem()&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;_item))&lt;br /&gt;
		{&lt;br /&gt;
			$cache = JFactory::getCache(&#039;com_helloworld&#039;, &#039;&#039;);&lt;br /&gt;
			$id = $this-&amp;gt;getState(&#039;helloworld.id&#039;);&lt;br /&gt;
			$this-&amp;gt;_item =  $cache-&amp;gt;get($id);&lt;br /&gt;
			if ($this-&amp;gt;_item === false) {&lt;br /&gt;
&lt;br /&gt;
                // Menu parameters&lt;br /&gt;
                $menuitemid = JRequest::getInt( &#039;Itemid&#039; );  // this returns the menu id number so you can reference parameters&lt;br /&gt;
                $menu = JSite::getMenu();&lt;br /&gt;
                if ($menuitemid) {&lt;br /&gt;
                   $menuparams = $menu-&amp;gt;getParams( $menuitemid );&lt;br /&gt;
                   $headingtxtcolor = $menuparams-&amp;gt;get(&#039;headingtxtcolor&#039;);  // This shows how to get an individual parameter for use&lt;br /&gt;
                   $headingbgcolor = $menuparams-&amp;gt;get(&#039;headingbgcolor&#039;);  // This shows how to get an individual parameter for use&lt;br /&gt;
                }&lt;br /&gt;
                $this-&amp;gt;setState(&#039;menuparams&#039;, $menuparams);  // this sets the parameter values to the state for later use&lt;br /&gt;
&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		return $this-&amp;gt;_item;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public function updItem($data)&lt;br /&gt;
	{&lt;br /&gt;
        // set the variables from the passed data&lt;br /&gt;
        $id = $data[&#039;id&#039;];&lt;br /&gt;
        $greeting = $data[&#039;greeting&#039;];&lt;br /&gt;
&lt;br /&gt;
        // set the data into a query to update the record&lt;br /&gt;
		$db		= $this-&amp;gt;getDbo();&lt;br /&gt;
		$query	= $db-&amp;gt;getQuery(true);&lt;br /&gt;
        $query-&amp;gt;clear();&lt;br /&gt;
		$query-&amp;gt;update(&#039; #__helloworld &#039;);&lt;br /&gt;
		$query-&amp;gt;set(&#039; greeting = &#039;.$db-&amp;gt;Quote($greeting) );&lt;br /&gt;
		$query-&amp;gt;where(&#039; id = &#039; . (int) $id );&lt;br /&gt;
&lt;br /&gt;
		$db-&amp;gt;setQuery((string)$query);&lt;br /&gt;
&lt;br /&gt;
        if (!$db-&amp;gt;query()) {&lt;br /&gt;
            JError::raiseError(500, $db-&amp;gt;getErrorMsg());&lt;br /&gt;
        	return false;&lt;br /&gt;
        } else {&lt;br /&gt;
        	return true;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add a stylesheet file ==&lt;br /&gt;
&lt;br /&gt;
Create a new stylesheet file to contain the css code you want to use on your component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;media/css/site.stylesheet.css&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;media/css/site.stylesheet.css&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
p {&lt;br /&gt;
   color: #000000;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding some language keys ==&lt;br /&gt;
&lt;br /&gt;
Add the last 4 lines to the &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.ini&#039;&#039; file to provide the text link for the parameter type display.  And being for the backend, it resides in the admin language folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/language/en-GB/en-GB.com_helloworld.sys.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.ini&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
COM_HELLOWORLD=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_DESCRIPTION=&amp;quot;This is the Hello World description&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC=&amp;quot;This view displays a selected message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE=&amp;quot;Hello World&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_INSTALL_TEXT=&amp;quot;HelloWorld Install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MENU=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_DISCOVER_INSTALL_TEXT=&amp;quot;HelloWorld postlight discover install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_INSTALL_TEXT=&amp;quot;HelloWorld postflight install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_UNINSTALL_TEXT=&amp;quot;HelloWorld postflight uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_UPDATE_TEXT=&amp;quot;HelloWorld postflight update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_DISCOVER_INSTALL_TEXT=&amp;quot;HelloWorld preflight discover install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_INSTALL_TEXT=&amp;quot;HelloWorld preflight install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_UNINSTALL_TEXT=&amp;quot;HelloWorld preflight uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_UPDATE_TEXT=&amp;quot;HelloWorld preflight update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UNINSTALL_TEXT=&amp;quot;HelloWorld Uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDATE_TEXT=&amp;quot;HelloWorld Update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_TITLE=&amp;quot;Update the Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_DESC=&amp;quot;Update greeting here&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGTXTCOLOR_LABEL=&amp;quot;Colour of Text&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGTXTCOLOR_DESC=&amp;quot;Set the colour of the text on the heading&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGBGCOLOR_LABEL=&amp;quot;Colour of Background&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGBGCOLOR_DESC=&amp;quot;Set the colour of the background on the heading&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;_populateState&#039;&#039; method is, by default, automatically called when a state is read by the &#039;&#039;getState&#039;&#039; method.&lt;br /&gt;
&lt;br /&gt;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory-&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#script.php|script.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/updhelloworld.php|site/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/controllers/updhelloworld.php|site/controllers/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/controllers/index.html|site/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/views/updhelloworld/view.html.php|site/views/updhelloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/updhelloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/views/updhelloworld/tmpl/default.xml|site/views/updhelloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/views/updhelloworld/tmpl/default.php|site/views/updhelloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/models/updhelloworld.php|site/models/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/models/forms/updhelloworld.xml|site/models/forms/updhelloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#site/language/en-GB/en-GB.com_helloworld.ini|site/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/access.xml|admin/access.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/config.xml|admin/config.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_12#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_12#admin/sql/updates/mysql/0.0.12.sql|admin/sql/updates/mysql/0.0.12.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/sql/updates/mysql/0.0.13.sql|admin/sql/updates/mysql/0.0.13.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_12#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/models/forms/helloworld.xml|admin/models/forms/helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/forms/helloworld.js|admin/models/forms/helloworld.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/rules/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/rules/greeting.php|admin/models/rules/greeting.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/models/helloworld.php|admin/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_09#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/views/helloworld/view.html.php|admin/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworld/submitbutton.js|admin/views/helloworld/submitbutton.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/views/helloworld/tmpl/edit.php|admin/views/helloworld/tmpl/edit.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/helpers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/helpers/helloworld.php|admin/helpers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/language/en-GB/en-GB.com_helloworld.ini|admin/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/language/en-GB/en-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/controllers/helloworld.php|admin/controllers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/controllers/helloworlds.php|admin/controllers/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#language/en-GB/en-GB.ini|language/en-GB/en-GB.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/images/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-16x16.png&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-48x48.png&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [http://www.glennarkell.com/joomlaorg/com_helloworld_0.0.19.zip] and install it using the extension manager of Joomla. You can add a menu item of this component using the menu manager in the backend.&lt;br /&gt;
&lt;br /&gt;
Be sure to update your manifest to include the stylesheet folder within the media section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;2.5.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;name&amp;gt;COM_HELLOWORLD&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting conttraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;November 2009&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.19&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;COM_HELLOWORLD_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- Runs on install/uninstall/update; New in 2.5 --&amp;gt;&lt;br /&gt;
	&amp;lt;scriptfile&amp;gt;script.php&amp;lt;/scriptfile&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New in 2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;updhelloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;media destination=&amp;quot;com_helloworld&amp;quot; folder=&amp;quot;media&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;css&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;images&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/media&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu img=&amp;quot;../media/com_helloworld/images/tux-16x16.png&amp;quot;&amp;gt;COM_HELLOWORLD_MENU&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;config.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;access.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- views files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- controllers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- helpers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;helpers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		&amp;lt;languages folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;/languages&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- UPDATESERVER DEFINITION --&amp;gt;&lt;br /&gt;
	&amp;lt;updateservers&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note: No spaces or linebreaks allowed between the server tags --&amp;gt;&lt;br /&gt;
		&amp;lt;server type=&amp;quot;extension&amp;quot; priority=&amp;quot;1&amp;quot; name=&amp;quot;HelloWorld Update Site&amp;quot;&amp;gt;http://yourdomain.com/update/helloworld-update.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
	&amp;lt;/updateservers&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when you view your &#039;&#039;&#039;hello-world&#039;&#039;&#039; update function via the front-end menu option, you will see the colours of the text and background being utilised.&lt;br /&gt;
&lt;br /&gt;
== Zips ==&lt;br /&gt;
Download the zip file for this Part:&lt;br /&gt;
[http://www.glennarkell.com/joomlaorg/com_helloworld_0.0.19.zip]&lt;br /&gt;
&lt;br /&gt;
== Navigate ==&lt;br /&gt;
&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 18|Prev: Example of a Frontend Update Function]]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:garkell|Glenn Arkell]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[category:Joomla! 1.6]]&lt;br /&gt;
[[category:Joomla! 1.7]]&lt;br /&gt;
[[category:Joomla! 2.5]]&lt;br /&gt;
[[category:Manual]]&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Example_of_menu_parameters_and_stylesheets&amp;diff=67232</id>
		<title>Archived:Developing a MVC Component/Example of menu parameters and stylesheets</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Example_of_menu_parameters_and_stylesheets&amp;diff=67232"/>
		<updated>2012-05-12T22:57:29Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Add new example of menu parameters &amp;amp; stylesheets - extending on the Update Function (Part 18) example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial is for {{JVer|1.6}} {{JVer|1.7}} {{JVer|2.5}}&lt;br /&gt;
== Warning - this article needs to be reviewed by someone who knows what they&#039;re doing ==&lt;br /&gt;
&lt;br /&gt;
== Articles in this series ==&lt;br /&gt;
{{Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Contents}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Update the view ==&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, update the file &#039;&#039;site/views/updhelloworld/view.html.php&#039;&#039; to include setting the state.  For the stylesheet, include the import of the html class, and add a new function for including the stylesheet file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/view.html.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/view.html.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 &lt;br /&gt;
// import Joomla view library&lt;br /&gt;
jimport(&#039;joomla.application.component.view&#039;);&lt;br /&gt;
// import Joomla html for use with stylesheets&lt;br /&gt;
jimport(&#039;joomla.html.html&#039;);&lt;br /&gt;
 &lt;br /&gt;
/**&lt;br /&gt;
 * HTML View class for the UpdHelloWorld Component&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewUpdHelloWorld extends JView&lt;br /&gt;
{&lt;br /&gt;
	// Overwriting JView display method&lt;br /&gt;
	function display($tpl = null) &lt;br /&gt;
	{&lt;br /&gt;
		$app		= JFactory::getApplication();&lt;br /&gt;
		$params		= $app-&amp;gt;getParams();&lt;br /&gt;
		$dispatcher = JDispatcher::getInstance();&lt;br /&gt;
&lt;br /&gt;
		// Get some data from the models&lt;br /&gt;
		$state		= $this-&amp;gt;get(&#039;State&#039;);&lt;br /&gt;
		$item		= $this-&amp;gt;get(&#039;Item&#039;);&lt;br /&gt;
		$this-&amp;gt;form	= $this-&amp;gt;get(&#039;Form&#039;);&lt;br /&gt;
		$this-&amp;gt;state = $this-&amp;gt;get(&#039;State&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Check for errors.&lt;br /&gt;
		if (count($errors = $this-&amp;gt;get(&#039;Errors&#039;))) &lt;br /&gt;
		{&lt;br /&gt;
			JError::raiseError(500, implode(&#039;&amp;lt;br /&amp;gt;&#039;, $errors));&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		// get the stylesheet and/or other document values such as title&lt;br /&gt;
        	$this-&amp;gt;addDocStyle();&lt;br /&gt;
&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Add the stylesheet to the document.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function addDocStyle()&lt;br /&gt;
	{&lt;br /&gt;
        $doc = JFactory::getDocument();&lt;br /&gt;
        $doc-&amp;gt;addStyleSheet(&#039;media/com_helloworld/css/site.stylesheet.css&#039;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Update the layout ==&lt;br /&gt;
&lt;br /&gt;
In Joomla, views display data using a layout. With your favorite file manager and editor, edit your file &#039;&#039;site/views/updhelloworld/tmpl/default.php&#039;&#039; to get the parameter values&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/tmpl/default.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/tmpl/default.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JHtml::_(&#039;behavior.keepalive&#039;);&lt;br /&gt;
JHtml::_(&#039;behavior.formvalidation&#039;);&lt;br /&gt;
JHtml::_(&#039;behavior.tooltip&#039;);&lt;br /&gt;
&lt;br /&gt;
// get the menu parameters for use&lt;br /&gt;
$menuparams = $this-&amp;gt;state-&amp;gt;get(&amp;quot;menuparams&amp;quot;);&lt;br /&gt;
$headingtxtcolor = $menuparams-&amp;gt;get(&amp;quot;headingtxtcolor&amp;quot;);&lt;br /&gt;
$headingbgcolor = $menuparams-&amp;gt;get(&amp;quot;headingbgcolor&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
    &amp;lt;h2 style=&amp;quot;color:&amp;lt;?php echo $headingtxtcolor; ?&amp;gt;; background-color:&amp;lt;?php echo $headingbgcolor; ?&amp;gt;;&amp;quot;&amp;gt;Update the Hello World greeting&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;form class=&amp;quot;form-validate&amp;quot; action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php&#039;); ?&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot; id=&amp;quot;updhelloworld&amp;quot; name=&amp;quot;updhelloworld&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset&amp;gt;&lt;br /&gt;
        	&amp;lt;dl&amp;gt;&lt;br /&gt;
          	    &amp;lt;dt&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getLabel(&#039;id&#039;); ?&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
             	&amp;lt;dd&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getInput(&#039;id&#039;); ?&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
        	    &amp;lt;dt&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getLabel(&#039;greeting&#039;); ?&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
        	    &amp;lt;dd&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getInput(&#039;greeting&#039;); ?&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
            	&amp;lt;dd&amp;gt;&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;option&amp;quot; value=&amp;quot;com_helloworld&amp;quot; /&amp;gt;&lt;br /&gt;
            	    &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;updhelloworld.submit&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
                &amp;lt;dd&amp;gt;&amp;lt;button type=&amp;quot;submit&amp;quot; class=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Submit&#039;); ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
			                &amp;lt;?php echo JHtml::_(&#039;form.token&#039;); ?&amp;gt;&lt;br /&gt;
                &amp;lt;/dd&amp;gt;&lt;br /&gt;
        	&amp;lt;/dl&amp;gt;&lt;br /&gt;
        &amp;lt;fieldset&amp;gt;&lt;br /&gt;
    &amp;lt;/form&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;clr&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This layout utilises the forms design which resides with the related model.  The getLabel and getInput will pickup the xml fields defined and display appropriately.  More on the xml file within the models section of this tutorial.&lt;br /&gt;
&lt;br /&gt;
Update the file &#039;&#039;site/views/updhelloworld/tmpl/default.xml&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/tmpl/default.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
    &amp;lt;layout title=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;message&amp;gt;COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
    &amp;lt;/layout&amp;gt;&lt;br /&gt;
    &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;field name=&amp;quot;headingtxtcolor&amp;quot; type=&amp;quot;text&amp;quot; default=&amp;quot;#ff0000&amp;quot; size=&amp;quot;40&amp;quot;&lt;br /&gt;
                label=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGTXTCOLOR_LABEL&amp;quot;&lt;br /&gt;
                description=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGTXTCOLOR_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;field name=&amp;quot;headingbgcolor&amp;quot; type=&amp;quot;text&amp;quot; default=&amp;quot;#0000ff&amp;quot; size=&amp;quot;40&amp;quot;&lt;br /&gt;
                label=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGBGCOLOR_LABEL&amp;quot;&lt;br /&gt;
                description=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGBGCOLOR_DESC&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
    &amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the parameter fields and allows for default values to be set.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Update the model ==&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;UpdHelloWorld&#039;&#039; model sets up the data sent from the related form and allows for saving the data from the form into the database.  In the getItem method we will get the values from the parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/updhelloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/models/updhelloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 &lt;br /&gt;
// Include dependancy of the main model form&lt;br /&gt;
jimport(&#039;joomla.application.component.modelform&#039;);&lt;br /&gt;
// import Joomla modelitem library&lt;br /&gt;
jimport(&#039;joomla.application.component.modelitem&#039;);&lt;br /&gt;
// Include dependancy of the dispatcher&lt;br /&gt;
jimport(&#039;joomla.event.dispatcher&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * UpdHelloWorld Model&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelUpdHelloWorld extends JModelForm&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var object item&lt;br /&gt;
	 */&lt;br /&gt;
	protected $item;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the data for a new qualification&lt;br /&gt;
	 */&lt;br /&gt;
	public function getForm($data = array(), $loadData = true)&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
        $app = JFactory::getApplication(&#039;site&#039;);&lt;br /&gt;
&lt;br /&gt;
        // Get the form.&lt;br /&gt;
		$form = $this-&amp;gt;loadForm(&#039;com_helloworld.updhelloworld&#039;, &#039;updhelloworld&#039;, array(&#039;control&#039; =&amp;gt; &#039;jform&#039;, &#039;load_data&#039; =&amp;gt; true));&lt;br /&gt;
		if (empty($form)) {&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		return $form;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 * @return object The message to be displayed to the user&lt;br /&gt;
	 */&lt;br /&gt;
	function &amp;amp;getItem()&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;_item))&lt;br /&gt;
		{&lt;br /&gt;
			$cache = JFactory::getCache(&#039;com_helloworld&#039;, &#039;&#039;);&lt;br /&gt;
			$id = $this-&amp;gt;getState(&#039;helloworld.id&#039;);&lt;br /&gt;
			$this-&amp;gt;_item =  $cache-&amp;gt;get($id);&lt;br /&gt;
			if ($this-&amp;gt;_item === false) {&lt;br /&gt;
&lt;br /&gt;
                // Menu parameters&lt;br /&gt;
                $menuitemid = JRequest::getInt( &#039;Itemid&#039; );  // this returns the menu id number so you can reference parameters&lt;br /&gt;
                $menu = JSite::getMenu();&lt;br /&gt;
                if ($menuitemid) {&lt;br /&gt;
                   $menuparams = $menu-&amp;gt;getParams( $menuitemid );&lt;br /&gt;
                   $headingtxtcolor = $menuparams-&amp;gt;get(&#039;headingtxtcolor&#039;);  // This shows how to get an individual parameter for use&lt;br /&gt;
                   $headingbgcolor = $menuparams-&amp;gt;get(&#039;headingbgcolor&#039;);  // This shows how to get an individual parameter for use&lt;br /&gt;
                }&lt;br /&gt;
                $this-&amp;gt;setState(&#039;menuparams&#039;, $menuparams);  // this sets the parameter values to the state for later use&lt;br /&gt;
&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		return $this-&amp;gt;_item;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public function updItem($data)&lt;br /&gt;
	{&lt;br /&gt;
        // set the variables from the passed data&lt;br /&gt;
        $id = $data[&#039;id&#039;];&lt;br /&gt;
        $greeting = $data[&#039;greeting&#039;];&lt;br /&gt;
&lt;br /&gt;
        // set the data into a query to update the record&lt;br /&gt;
		$db		= $this-&amp;gt;getDbo();&lt;br /&gt;
		$query	= $db-&amp;gt;getQuery(true);&lt;br /&gt;
        $query-&amp;gt;clear();&lt;br /&gt;
		$query-&amp;gt;update(&#039; #__helloworld &#039;);&lt;br /&gt;
		$query-&amp;gt;set(&#039; greeting = &#039;.$db-&amp;gt;Quote($greeting) );&lt;br /&gt;
		$query-&amp;gt;where(&#039; id = &#039; . (int) $id );&lt;br /&gt;
&lt;br /&gt;
		$db-&amp;gt;setQuery((string)$query);&lt;br /&gt;
&lt;br /&gt;
        if (!$db-&amp;gt;query()) {&lt;br /&gt;
            JError::raiseError(500, $db-&amp;gt;getErrorMsg());&lt;br /&gt;
        	return false;&lt;br /&gt;
        } else {&lt;br /&gt;
        	return true;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add a stylesheet file ==&lt;br /&gt;
&lt;br /&gt;
Create a new stylesheet file to contain the css code you want to use on your component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;media/css/site.stylesheet.css&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;media/css/site.stylesheet.css&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
p {&lt;br /&gt;
   color: #000000;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding some language keys ==&lt;br /&gt;
&lt;br /&gt;
Add the last 4 lines to the &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.ini&#039;&#039; file to provide the text link for the parameter type display.  And being for the backend, it resides in the admin language folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/language/en-GB/en-GB.com_helloworld.sys.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.ini&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
COM_HELLOWORLD=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_DESCRIPTION=&amp;quot;This is the Hello World description&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC=&amp;quot;This view displays a selected message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE=&amp;quot;Hello World&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_INSTALL_TEXT=&amp;quot;HelloWorld Install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MENU=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_DISCOVER_INSTALL_TEXT=&amp;quot;HelloWorld postlight discover install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_INSTALL_TEXT=&amp;quot;HelloWorld postflight install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_UNINSTALL_TEXT=&amp;quot;HelloWorld postflight uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_UPDATE_TEXT=&amp;quot;HelloWorld postflight update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_DISCOVER_INSTALL_TEXT=&amp;quot;HelloWorld preflight discover install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_INSTALL_TEXT=&amp;quot;HelloWorld preflight install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_UNINSTALL_TEXT=&amp;quot;HelloWorld preflight uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_UPDATE_TEXT=&amp;quot;HelloWorld preflight update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UNINSTALL_TEXT=&amp;quot;HelloWorld Uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDATE_TEXT=&amp;quot;HelloWorld Update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_TITLE=&amp;quot;Update the Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_DESC=&amp;quot;Update greeting here&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGTXTCOLOR_LABEL=&amp;quot;Colour of Text&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGTXTCOLOR_DESC=&amp;quot;Set the colour of the text on the heading&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGBGCOLOR_LABEL=&amp;quot;Colour of Background&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_FIELD_HEADINGBGCOLOR_DESC=&amp;quot;Set the colour of the background on the heading&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;_populateState&#039;&#039; method is, by default, automatically called when a state is read by the &#039;&#039;getState&#039;&#039; method.&lt;br /&gt;
&lt;br /&gt;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory-&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#script.php|script.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/updhelloworld.php|site/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/controllers/updhelloworld.php|site/controllers/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/controllers/index.html|site/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/views/updhelloworld/view.html.php|site/views/updhelloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/updhelloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/views/updhelloworld/tmpl/default.xml|site/views/updhelloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/views/updhelloworld/tmpl/default.php|site/views/updhelloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/models/updhelloworld.php|site/models/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/models/forms/updhelloworld.xml|site/models/forms/updhelloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#site/language/en-GB/en-GB.com_helloworld.ini|site/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/access.xml|admin/access.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/config.xml|admin/config.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_12#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_12#admin/sql/updates/mysql/0.0.12.sql|admin/sql/updates/mysql/0.0.12.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/sql/updates/mysql/0.0.13.sql|admin/sql/updates/mysql/0.0.13.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_12#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/models/forms/helloworld.xml|admin/models/forms/helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/forms/helloworld.js|admin/models/forms/helloworld.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/rules/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/rules/greeting.php|admin/models/rules/greeting.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/models/helloworld.php|admin/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_09#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/views/helloworld/view.html.php|admin/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworld/submitbutton.js|admin/views/helloworld/submitbutton.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/views/helloworld/tmpl/edit.php|admin/views/helloworld/tmpl/edit.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/helpers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/helpers/helloworld.php|admin/helpers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/language/en-GB/en-GB.com_helloworld.ini|admin/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/language/en-GB/en-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/controllers/helloworld.php|admin/controllers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/controllers/helloworlds.php|admin/controllers/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#language/en-GB/en-GB.ini|language/en-GB/en-GB.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/images/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-16x16.png&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-48x48.png&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [http://www.glennarkell.com/joomlaorg/com_helloworld_0.0.19.zip] and install it using the extension manager of Joomla. You can add a menu item of this component using the menu manager in the backend.&lt;br /&gt;
&lt;br /&gt;
Be sure to update your manifest to include the stylesheet folder within the media section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;2.5.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;name&amp;gt;COM_HELLOWORLD&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting conttraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;November 2009&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.19&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;COM_HELLOWORLD_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- Runs on install/uninstall/update; New in 2.5 --&amp;gt;&lt;br /&gt;
	&amp;lt;scriptfile&amp;gt;script.php&amp;lt;/scriptfile&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New in 2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;updhelloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;media destination=&amp;quot;com_helloworld&amp;quot; folder=&amp;quot;media&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;css&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;images&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/media&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu img=&amp;quot;../media/com_helloworld/images/tux-16x16.png&amp;quot;&amp;gt;COM_HELLOWORLD_MENU&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;config.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;access.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- views files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- controllers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- helpers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;helpers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		&amp;lt;languages folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;/languages&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- UPDATESERVER DEFINITION --&amp;gt;&lt;br /&gt;
	&amp;lt;updateservers&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note: No spaces or linebreaks allowed between the server tags --&amp;gt;&lt;br /&gt;
		&amp;lt;server type=&amp;quot;extension&amp;quot; priority=&amp;quot;1&amp;quot; name=&amp;quot;HelloWorld Update Site&amp;quot;&amp;gt;http://yourdomain.com/update/helloworld-update.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
	&amp;lt;/updateservers&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when you view your &#039;&#039;&#039;hello-world&#039;&#039;&#039; update function via the front-end menu option, you will see the colours of the text and background being utilised.&lt;br /&gt;
&lt;br /&gt;
== Zips ==&lt;br /&gt;
Download the zip file for this Part:&lt;br /&gt;
[http://www.glennarkell.com/joomlaorg/com_helloworld_0.0.19.zip]&lt;br /&gt;
&lt;br /&gt;
== Navigate ==&lt;br /&gt;
&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 18|Prev: Example of a Frontend Update Function]]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:garkell|Glenn Arkell]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[category:Joomla! 1.6]]&lt;br /&gt;
[[category:Joomla! 1.7]]&lt;br /&gt;
[[category:Joomla! 2.5]]&lt;br /&gt;
[[category:Manual]]&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Contents&amp;diff=67231</id>
		<title>Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Contents</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Contents&amp;diff=67231"/>
		<updated>2012-05-12T22:36:45Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Add new example of menu parameters &amp;amp; stylesheets - extending on the Update Function (Part 18) example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 01|Developing a Basic Component]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 02|Adding a view to the site part]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 03|Adding a menu type to the site part]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 04|Adding a model to the site part]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 05|Adding a variable request in the menu type]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 06|Using the database]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 07|Basic backend]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 08|Adding language management]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 09|Adding backend actions]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 10|Adding decorations to the backend]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 11|Adding verifications]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 12|Adding categories]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 13|Adding configuration]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 14|Adding ACL]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 15|Adding an install/uninstall/update script file]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 16|Using the language filter facility]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 17|Adding an update server]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 18|Example of a Frontend Update Function]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 19|Example of Menu Parameters &amp;amp; Stylesheets]]&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Example_of_a_frontend_update_function&amp;diff=67219</id>
		<title>Archived:Developing a MVC Component/Example of a frontend update function</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Example_of_a_frontend_update_function&amp;diff=67219"/>
		<updated>2012-05-11T10:12:35Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Tidied up the form xml for presentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial is for {{JVer|1.6}} {{JVer|1.7}} {{JVer|2.5}}&lt;br /&gt;
== Warning - this article needs to be reviewed by someone who knows what they&#039;re doing ==&lt;br /&gt;
&lt;br /&gt;
== Articles in this series ==&lt;br /&gt;
{{Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Contents}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Basic frontend form ==&lt;br /&gt;
Designing the frontend interface leads us to create a Model-View-Controller triptych similar to the backend in Part 7.&lt;br /&gt;
&lt;br /&gt;
== Create the specific controller ==&lt;br /&gt;
The entry point now gets an instance of an &#039;&#039;UpdHelloWorld&#039;&#039; prefixed controller which extends the function of JControllerForm. Let&#039;s create a basic controllerform for the site part:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/controllers/updhelloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/controllers/updhelloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
// No direct access.&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
// Include dependancy of the main controllerform class&lt;br /&gt;
jimport(&#039;joomla.application.component.controllerform&#039;);&lt;br /&gt;
&lt;br /&gt;
class HelloWorldControllerUpdHelloWorld extends JControllerForm&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
	public function getModel($name = &#039;&#039;, $prefix = &#039;&#039;, $config = array(&#039;ignore_request&#039; =&amp;gt; true))&lt;br /&gt;
	{&lt;br /&gt;
		return parent::getModel($name, $prefix, array(&#039;ignore_request&#039; =&amp;gt; false));&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public function submit()&lt;br /&gt;
	{&lt;br /&gt;
		// Check for request forgeries.&lt;br /&gt;
		JRequest::checkToken() or jexit(JText::_(&#039;JINVALID_TOKEN&#039;));&lt;br /&gt;
&lt;br /&gt;
		// Initialise variables.&lt;br /&gt;
		$app	= JFactory::getApplication();&lt;br /&gt;
		$model	= $this-&amp;gt;getModel(&#039;updhelloworld&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Get the data from the form POST&lt;br /&gt;
		$data = JRequest::getVar(&#039;jform&#039;, array(), &#039;post&#039;, &#039;array&#039;);&lt;br /&gt;
&lt;br /&gt;
        // Now update the loaded data to the database via a function in the model&lt;br /&gt;
        $upditem	= $model-&amp;gt;updItem($data);&lt;br /&gt;
&lt;br /&gt;
    	// check if ok and display appropriate message.  This can also have a redirect if desired.&lt;br /&gt;
        if ($upditem) {&lt;br /&gt;
            echo &amp;quot;&amp;lt;h2&amp;gt;Updated Greeting has been saved&amp;lt;/h2&amp;gt;&amp;quot;;&lt;br /&gt;
        } else {&lt;br /&gt;
            echo &amp;quot;&amp;lt;h2&amp;gt;Updated Greeting failed to be saved&amp;lt;/h2&amp;gt;&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		return true;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This controller will display the appropriate message after the form is submitted.&lt;br /&gt;
&lt;br /&gt;
== Create the view ==&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, create a file &#039;&#039;site/views/updhelloworld/view.html.php&#039;&#039; containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/view.html.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/view.html.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 &lt;br /&gt;
// import Joomla view library&lt;br /&gt;
jimport(&#039;joomla.application.component.view&#039;);&lt;br /&gt;
 &lt;br /&gt;
/**&lt;br /&gt;
 * HTML View class for the UpdHelloWorld Component&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewUpdHelloWorld extends JView&lt;br /&gt;
{&lt;br /&gt;
	// Overwriting JView display method&lt;br /&gt;
	function display($tpl = null) &lt;br /&gt;
	{&lt;br /&gt;
		$app		= JFactory::getApplication();&lt;br /&gt;
		$params		= $app-&amp;gt;getParams();&lt;br /&gt;
		$dispatcher = JDispatcher::getInstance();&lt;br /&gt;
&lt;br /&gt;
		// Get some data from the models&lt;br /&gt;
		$state		= $this-&amp;gt;get(&#039;State&#039;);&lt;br /&gt;
		$item		= $this-&amp;gt;get(&#039;Item&#039;);&lt;br /&gt;
		$this-&amp;gt;form	= $this-&amp;gt;get(&#039;Form&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Check for errors.&lt;br /&gt;
		if (count($errors = $this-&amp;gt;get(&#039;Errors&#039;))) &lt;br /&gt;
		{&lt;br /&gt;
			JError::raiseError(500, implode(&#039;&amp;lt;br /&amp;gt;&#039;, $errors));&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Joomla, views display data using a layout. With your favorite file manager and editor, put a file &#039;&#039;site/views/updhelloworld/tmpl/default.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/tmpl/default.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/tmpl/default.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JHtml::_(&#039;behavior.keepalive&#039;);&lt;br /&gt;
JHtml::_(&#039;behavior.formvalidation&#039;);&lt;br /&gt;
JHtml::_(&#039;behavior.tooltip&#039;);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
    &amp;lt;h2&amp;gt;Update the Hello World greeting&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;form class=&amp;quot;form-validate&amp;quot; action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php&#039;); ?&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot; id=&amp;quot;updhelloworld&amp;quot; name=&amp;quot;updhelloworld&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset&amp;gt;&lt;br /&gt;
        	&amp;lt;dl&amp;gt;&lt;br /&gt;
          	    &amp;lt;dt&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getLabel(&#039;id&#039;); ?&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
             	&amp;lt;dd&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getInput(&#039;id&#039;); ?&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
        	    &amp;lt;dt&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getLabel(&#039;greeting&#039;); ?&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
        	    &amp;lt;dd&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getInput(&#039;greeting&#039;); ?&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
            	&amp;lt;dd&amp;gt;&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;option&amp;quot; value=&amp;quot;com_helloworld&amp;quot; /&amp;gt;&lt;br /&gt;
            	    &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;updhelloworld.submit&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
                &amp;lt;dd&amp;gt;&amp;lt;button type=&amp;quot;submit&amp;quot; class=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Submit&#039;); ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
			                &amp;lt;?php echo JHtml::_(&#039;form.token&#039;); ?&amp;gt;&lt;br /&gt;
                &amp;lt;/dd&amp;gt;&lt;br /&gt;
        	&amp;lt;/dl&amp;gt;&lt;br /&gt;
        &amp;lt;fieldset&amp;gt;&lt;br /&gt;
    &amp;lt;/form&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;clr&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This layout utilises the forms design which resides with the related model.  The getLabel and getInput will pickup the xml fields defined and display appropriately.  More on the xml file within the models section of this tutorial.&lt;br /&gt;
&lt;br /&gt;
Create a file &#039;&#039;site/views/updhelloworld/tmpl/default.xml&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/tmpl/default.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This enables a menu option to be allocated to the frontend form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the model ==&lt;br /&gt;
The &#039;&#039;UpdHelloWorld&#039;&#039; model sets up the data through from the related form and allows the mechanism to save the subsequent data loaded into the form into the database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/updhelloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/models/updhelloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 &lt;br /&gt;
// Include dependancy of the main model form&lt;br /&gt;
jimport(&#039;joomla.application.component.modelform&#039;);&lt;br /&gt;
// import Joomla modelitem library&lt;br /&gt;
jimport(&#039;joomla.application.component.modelitem&#039;);&lt;br /&gt;
// Include dependancy of the dispatcher&lt;br /&gt;
jimport(&#039;joomla.event.dispatcher&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * UpdHelloWorld Model&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelUpdHelloWorld extends JModelForm&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var object item&lt;br /&gt;
	 */&lt;br /&gt;
	protected $item;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the data for a new qualification&lt;br /&gt;
	 */&lt;br /&gt;
	public function getForm($data = array(), $loadData = true)&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
        $app = JFactory::getApplication(&#039;site&#039;);&lt;br /&gt;
&lt;br /&gt;
        // Get the form.&lt;br /&gt;
		$form = $this-&amp;gt;loadForm(&#039;com_helloworld.updhelloworld&#039;, &#039;updhelloworld&#039;, array(&#039;control&#039; =&amp;gt; &#039;jform&#039;, &#039;load_data&#039; =&amp;gt; true));&lt;br /&gt;
		if (empty($form)) {&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		return $form;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 * @return object The message to be displayed to the user&lt;br /&gt;
	 */&lt;br /&gt;
	function &amp;amp;getItem()&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;_item))&lt;br /&gt;
		{&lt;br /&gt;
			$cache = JFactory::getCache(&#039;com_helloworld&#039;, &#039;&#039;);&lt;br /&gt;
			$id = $this-&amp;gt;getState(&#039;helloworld.id&#039;);&lt;br /&gt;
			$this-&amp;gt;_item =  $cache-&amp;gt;get($id);&lt;br /&gt;
			if ($this-&amp;gt;_item === false) {&lt;br /&gt;
&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		return $this-&amp;gt;_item;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public function updItem($data)&lt;br /&gt;
	{&lt;br /&gt;
        // set the variables from the passed data&lt;br /&gt;
        $id = $data[&#039;id&#039;];&lt;br /&gt;
        $greeting = $data[&#039;greeting&#039;];&lt;br /&gt;
&lt;br /&gt;
        // set the data into a query to update the record&lt;br /&gt;
		$db		= $this-&amp;gt;getDbo();&lt;br /&gt;
		$query	= $db-&amp;gt;getQuery(true);&lt;br /&gt;
        $query-&amp;gt;clear();&lt;br /&gt;
		$query-&amp;gt;update(&#039; #__helloworld &#039;);&lt;br /&gt;
		$query-&amp;gt;set(&#039; greeting = &#039;.$db-&amp;gt;Quote($greeting) );&lt;br /&gt;
		$query-&amp;gt;where(&#039; id = &#039; . (int) $id );&lt;br /&gt;
&lt;br /&gt;
		$db-&amp;gt;setQuery((string)$query);&lt;br /&gt;
&lt;br /&gt;
        if (!$db-&amp;gt;query()) {&lt;br /&gt;
            JError::raiseError(500, $db-&amp;gt;getErrorMsg());&lt;br /&gt;
        	return false;&lt;br /&gt;
        } else {&lt;br /&gt;
        	return true;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following file &#039;&#039;updhelloworld.xml&#039;&#039; should be created using your favourite editor and saved in the forms folder under the models directory.  The first of the fields being referenced id using the sql type so that I returns the results from the query into a dropdown list form to be selected.&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/forms/updhelloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/models/forms/updhelloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;form name=&amp;quot;updhelloworld&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset name=&amp;quot;updhelloworld&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;field&lt;br /&gt;
            name=&amp;quot;id&amp;quot;&lt;br /&gt;
            type=&amp;quot;sql&amp;quot;&lt;br /&gt;
            multiple=&amp;quot;false&amp;quot;&lt;br /&gt;
            size=&amp;quot;1&amp;quot;&lt;br /&gt;
            label=&amp;quot;COM_HELLOWORLD_FORM_LBL_UPDHELLOWORLD_ID&amp;quot;&lt;br /&gt;
            description=&amp;quot;COM_HELLOWORLD_FORM_DESC_UPDHELLOWORLD_ID&amp;quot;&lt;br /&gt;
            query=&amp;quot;select id, greeting from #__helloworld&amp;quot;&lt;br /&gt;
            key_field=&amp;quot;id&amp;quot;&lt;br /&gt;
            value_field=&amp;quot;greeting&amp;quot;&lt;br /&gt;
            default=&amp;quot;0&amp;quot;&lt;br /&gt;
	    required=&amp;quot;true&amp;quot;&lt;br /&gt;
            &amp;gt;&lt;br /&gt;
                &amp;lt;option value=&amp;quot;&amp;quot;&amp;gt;JOPTION_SELECT_ID&amp;lt;/option&amp;gt;&lt;br /&gt;
        &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;field&lt;br /&gt;
            name=&amp;quot;greeting&amp;quot;&lt;br /&gt;
            type=&amp;quot;text&amp;quot;&lt;br /&gt;
	    description=&amp;quot;COM_HELLOWORLD_FORM_DESC_UPDHELLOWORLD_GREETING&amp;quot;&lt;br /&gt;
	    label=&amp;quot;COM_HELLOWORLD_FORM_LBL_UPDHELLOWORLD_GREETING&amp;quot;&lt;br /&gt;
	    required=&amp;quot;true&amp;quot;&lt;br /&gt;
	    size=&amp;quot;50&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding some language keys ==&lt;br /&gt;
&lt;br /&gt;
This file provides the text link between the label in the model form definition to be displayed in the view.  And being for the frontend, it resides in the site folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/language/en-GB/en-GB.com_helloworld.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/language/en-GB/en-GB.com_helloworld.ini&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
COM_HELLOWORLD_FORM_LBL_UPDHELLOWORLD_ID=&amp;quot;Greeting ID&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_FORM_DESC_UPDHELLOWORLD_ID=&amp;quot;This is the ID of the Greeting record&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_FORM_LBL_UPDHELLOWORLD_GREETING=&amp;quot;Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_FORM_DESC_UPDHELLOWORLD_GREETING=&amp;quot;Greeting description&amp;quot;&lt;br /&gt;
JOPTION_SELECT_ID=&amp;quot; -- Select Greeting to Update -- &amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the last 2 lines to the &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.ini&#039;&#039; file to provide the text link for the menu type display.  And being for the backend, it resides in the admin language folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/language/en-GB/en-GB.com_helloworld.sys.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.ini&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
COM_HELLOWORLD=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_DESCRIPTION=&amp;quot;This is the Hello World description&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC=&amp;quot;This view displays a selected message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE=&amp;quot;Hello World&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_INSTALL_TEXT=&amp;quot;HelloWorld Install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MENU=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_DISCOVER_INSTALL_TEXT=&amp;quot;HelloWorld postlight discover install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_INSTALL_TEXT=&amp;quot;HelloWorld postflight install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_UNINSTALL_TEXT=&amp;quot;HelloWorld postflight uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_UPDATE_TEXT=&amp;quot;HelloWorld postflight update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_DISCOVER_INSTALL_TEXT=&amp;quot;HelloWorld preflight discover install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_INSTALL_TEXT=&amp;quot;HelloWorld preflight install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_UNINSTALL_TEXT=&amp;quot;HelloWorld preflight uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_UPDATE_TEXT=&amp;quot;HelloWorld preflight update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UNINSTALL_TEXT=&amp;quot;HelloWorld Uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDATE_TEXT=&amp;quot;HelloWorld Update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_TITLE=&amp;quot;Update the Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_DESC=&amp;quot;Update greeting here&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;_populateState&#039;&#039; method is, by default, automatically called when a state is read by the &#039;&#039;getState&#039;&#039; method.&lt;br /&gt;
&lt;br /&gt;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory-&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#script.php|script.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/updhelloworld.php|site/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/controllers/updhelloworld.php|site/controllers/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/controllers/index.html|site/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/views/updhelloworld/view.html.php|site/views/updhelloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/updhelloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/views/updhelloworld/tmpl/default.xml|site/views/updhelloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/views/updhelloworld/tmpl/default.php|site/views/updhelloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/models/updhelloworld.php|site/models/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/models/forms/updhelloworld.xml|site/models/forms/updhelloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#site/language/en-GB/en-GB.com_helloworld.ini|site/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/access.xml|admin/access.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/config.xml|admin/config.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_12#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_12#admin/sql/updates/mysql/0.0.12.sql|admin/sql/updates/mysql/0.0.12.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/sql/updates/mysql/0.0.13.sql|admin/sql/updates/mysql/0.0.13.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_12#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/models/forms/helloworld.xml|admin/models/forms/helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/forms/helloworld.js|admin/models/forms/helloworld.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/rules/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/rules/greeting.php|admin/models/rules/greeting.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/models/helloworld.php|admin/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_09#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/views/helloworld/view.html.php|admin/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworld/submitbutton.js|admin/views/helloworld/submitbutton.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/views/helloworld/tmpl/edit.php|admin/views/helloworld/tmpl/edit.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/helpers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/helpers/helloworld.php|admin/helpers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/language/en-GB/en-GB.com_helloworld.ini|admin/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/language/en-GB/en-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/controllers/helloworld.php|admin/controllers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/controllers/helloworlds.php|admin/controllers/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#language/en-GB/en-GB.ini|language/en-GB/en-GB.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/images/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-16x16.png&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-48x48.png&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [http://joomlacode.org/gf/download/frsrelease/11394/58397/com_helloworld-1.6-part07.zip archive] and install it using the extension manager of Joomla. You can add a menu item of this component using the menu manager in the backend.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;2.5.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;name&amp;gt;COM_HELLOWORLD&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting conttraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;November 2009&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.18&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;COM_HELLOWORLD_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- Runs on install/uninstall/update; New in 2.5 --&amp;gt;&lt;br /&gt;
	&amp;lt;scriptfile&amp;gt;script.php&amp;lt;/scriptfile&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New in 2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;updhelloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;media destination=&amp;quot;com_helloworld&amp;quot; folder=&amp;quot;media&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;images&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/media&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu img=&amp;quot;../media/com_helloworld/images/tux-16x16.png&amp;quot;&amp;gt;COM_HELLOWORLD_MENU&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;config.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;access.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- views files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- controllers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- helpers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;helpers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		&amp;lt;languages folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;/languages&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- UPDATESERVER DEFINITION --&amp;gt;&lt;br /&gt;
	&amp;lt;updateservers&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note: No spaces or linebreaks allowed between the server tags --&amp;gt;&lt;br /&gt;
		&amp;lt;server type=&amp;quot;extension&amp;quot; priority=&amp;quot;1&amp;quot; name=&amp;quot;HelloWorld Update Site&amp;quot;&amp;gt;http://yourdomain.com/update/helloworld-update.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
	&amp;lt;/updateservers&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can see in your component &#039;&#039;&#039;hello-world&#039;&#039;&#039; an array with two colums, two rows and checkboxes. You can click the checkboxes in order to select the different options you want.&lt;br /&gt;
&lt;br /&gt;
== Zips ==&lt;br /&gt;
Download the zip file for this Part:&lt;br /&gt;
[http://www.glennarkell.com/joomlaorg/com_helloworld_0.0.18.zip]&lt;br /&gt;
&lt;br /&gt;
== Navigate ==&lt;br /&gt;
&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 17|Prev: Adding an update server]]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:garkell|Glenn Arkell]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[category:Joomla! 1.6]]&lt;br /&gt;
[[category:Joomla! 1.7]]&lt;br /&gt;
[[category:Joomla! 2.5]]&lt;br /&gt;
[[category:Manual]]&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Example_of_a_frontend_update_function&amp;diff=65116</id>
		<title>Archived:Developing a MVC Component/Example of a frontend update function</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Example_of_a_frontend_update_function&amp;diff=65116"/>
		<updated>2012-02-22T20:44:50Z</updated>

		<summary type="html">&lt;p&gt;Garkell: /* Basic frontend form */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial is for {{JVer|1.6}} {{JVer|1.7}} {{JVer|2.5}}&lt;br /&gt;
== Warning - this article needs to be reviewed by someone who knows what they&#039;re doing ==&lt;br /&gt;
&lt;br /&gt;
== Articles in this series ==&lt;br /&gt;
{{Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Contents}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Basic frontend form ==&lt;br /&gt;
Designing the frontend interface leads us to create a Model-View-Controller triptych similar to the backend in Part 7.&lt;br /&gt;
&lt;br /&gt;
== Create the specific controller ==&lt;br /&gt;
The entry point now gets an instance of an &#039;&#039;UpdHelloWorld&#039;&#039; prefixed controller which extends the function of JControllerForm. Let&#039;s create a basic controllerform for the site part:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/controllers/updhelloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/controllers/updhelloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
// No direct access.&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
// Include dependancy of the main controllerform class&lt;br /&gt;
jimport(&#039;joomla.application.component.controllerform&#039;);&lt;br /&gt;
&lt;br /&gt;
class HelloWorldControllerUpdHelloWorld extends JControllerForm&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
	public function getModel($name = &#039;&#039;, $prefix = &#039;&#039;, $config = array(&#039;ignore_request&#039; =&amp;gt; true))&lt;br /&gt;
	{&lt;br /&gt;
		return parent::getModel($name, $prefix, array(&#039;ignore_request&#039; =&amp;gt; false));&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public function submit()&lt;br /&gt;
	{&lt;br /&gt;
		// Check for request forgeries.&lt;br /&gt;
		JRequest::checkToken() or jexit(JText::_(&#039;JINVALID_TOKEN&#039;));&lt;br /&gt;
&lt;br /&gt;
		// Initialise variables.&lt;br /&gt;
		$app	= JFactory::getApplication();&lt;br /&gt;
		$model	= $this-&amp;gt;getModel(&#039;updhelloworld&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Get the data from the form POST&lt;br /&gt;
		$data = JRequest::getVar(&#039;jform&#039;, array(), &#039;post&#039;, &#039;array&#039;);&lt;br /&gt;
&lt;br /&gt;
        // Now update the loaded data to the database via a function in the model&lt;br /&gt;
        $upditem	= $model-&amp;gt;updItem($data);&lt;br /&gt;
&lt;br /&gt;
    	// check if ok and display appropriate message.  This can also have a redirect if desired.&lt;br /&gt;
        if ($upditem) {&lt;br /&gt;
            echo &amp;quot;&amp;lt;h2&amp;gt;Updated Greeting has been saved&amp;lt;/h2&amp;gt;&amp;quot;;&lt;br /&gt;
        } else {&lt;br /&gt;
            echo &amp;quot;&amp;lt;h2&amp;gt;Updated Greeting failed to be saved&amp;lt;/h2&amp;gt;&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		return true;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This controller will display the appropriate message after the form is submitted.&lt;br /&gt;
&lt;br /&gt;
== Create the view ==&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, create a file &#039;&#039;site/views/updhelloworld/view.html.php&#039;&#039; containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/view.html.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/view.html.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 &lt;br /&gt;
// import Joomla view library&lt;br /&gt;
jimport(&#039;joomla.application.component.view&#039;);&lt;br /&gt;
 &lt;br /&gt;
/**&lt;br /&gt;
 * HTML View class for the UpdHelloWorld Component&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewUpdHelloWorld extends JView&lt;br /&gt;
{&lt;br /&gt;
	// Overwriting JView display method&lt;br /&gt;
	function display($tpl = null) &lt;br /&gt;
	{&lt;br /&gt;
		$app		= JFactory::getApplication();&lt;br /&gt;
		$params		= $app-&amp;gt;getParams();&lt;br /&gt;
		$dispatcher = JDispatcher::getInstance();&lt;br /&gt;
&lt;br /&gt;
		// Get some data from the models&lt;br /&gt;
		$state		= $this-&amp;gt;get(&#039;State&#039;);&lt;br /&gt;
		$item		= $this-&amp;gt;get(&#039;Item&#039;);&lt;br /&gt;
		$this-&amp;gt;form	= $this-&amp;gt;get(&#039;Form&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Check for errors.&lt;br /&gt;
		if (count($errors = $this-&amp;gt;get(&#039;Errors&#039;))) &lt;br /&gt;
		{&lt;br /&gt;
			JError::raiseError(500, implode(&#039;&amp;lt;br /&amp;gt;&#039;, $errors));&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Joomla, views display data using a layout. With your favorite file manager and editor, put a file &#039;&#039;site/views/updhelloworld/tmpl/default.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/tmpl/default.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/tmpl/default.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JHtml::_(&#039;behavior.keepalive&#039;);&lt;br /&gt;
JHtml::_(&#039;behavior.formvalidation&#039;);&lt;br /&gt;
JHtml::_(&#039;behavior.tooltip&#039;);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
    &amp;lt;h2&amp;gt;Update the Hello World greeting&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;form class=&amp;quot;form-validate&amp;quot; action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php&#039;); ?&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot; id=&amp;quot;updhelloworld&amp;quot; name=&amp;quot;updhelloworld&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset&amp;gt;&lt;br /&gt;
        	&amp;lt;dl&amp;gt;&lt;br /&gt;
          	    &amp;lt;dt&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getLabel(&#039;id&#039;); ?&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
             	&amp;lt;dd&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getInput(&#039;id&#039;); ?&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
        	    &amp;lt;dt&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getLabel(&#039;greeting&#039;); ?&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
        	    &amp;lt;dd&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getInput(&#039;greeting&#039;); ?&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
            	&amp;lt;dd&amp;gt;&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;option&amp;quot; value=&amp;quot;com_helloworld&amp;quot; /&amp;gt;&lt;br /&gt;
            	    &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;updhelloworld.submit&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
                &amp;lt;dd&amp;gt;&amp;lt;button type=&amp;quot;submit&amp;quot; class=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Submit&#039;); ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
			                &amp;lt;?php echo JHtml::_(&#039;form.token&#039;); ?&amp;gt;&lt;br /&gt;
                &amp;lt;/dd&amp;gt;&lt;br /&gt;
        	&amp;lt;/dl&amp;gt;&lt;br /&gt;
        &amp;lt;fieldset&amp;gt;&lt;br /&gt;
    &amp;lt;/form&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;clr&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This layout utilises the forms design which resides with the related model.  The getLabel and getInput will pickup the xml fields defined and display appropriately.  More on the xml file within the models section of this tutorial.&lt;br /&gt;
&lt;br /&gt;
Create a file &#039;&#039;site/views/updhelloworld/tmpl/default.xml&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/tmpl/default.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This enables a menu option to be allocated to the frontend form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the model ==&lt;br /&gt;
The &#039;&#039;UpdHelloWorld&#039;&#039; model sets up the data through from the related form and allows the mechanism to save the subsequent data loaded into the form into the database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/updhelloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/models/updhelloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 &lt;br /&gt;
// Include dependancy of the main model form&lt;br /&gt;
jimport(&#039;joomla.application.component.modelform&#039;);&lt;br /&gt;
// import Joomla modelitem library&lt;br /&gt;
jimport(&#039;joomla.application.component.modelitem&#039;);&lt;br /&gt;
// Include dependancy of the dispatcher&lt;br /&gt;
jimport(&#039;joomla.event.dispatcher&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * UpdHelloWorld Model&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelUpdHelloWorld extends JModelForm&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var object item&lt;br /&gt;
	 */&lt;br /&gt;
	protected $item;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the data for a new qualification&lt;br /&gt;
	 */&lt;br /&gt;
	public function getForm($data = array(), $loadData = true)&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
        $app = JFactory::getApplication(&#039;site&#039;);&lt;br /&gt;
&lt;br /&gt;
        // Get the form.&lt;br /&gt;
		$form = $this-&amp;gt;loadForm(&#039;com_helloworld.updhelloworld&#039;, &#039;updhelloworld&#039;, array(&#039;control&#039; =&amp;gt; &#039;jform&#039;, &#039;load_data&#039; =&amp;gt; true));&lt;br /&gt;
		if (empty($form)) {&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		return $form;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 * @return object The message to be displayed to the user&lt;br /&gt;
	 */&lt;br /&gt;
	function &amp;amp;getItem()&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;_item))&lt;br /&gt;
		{&lt;br /&gt;
			$cache = JFactory::getCache(&#039;com_helloworld&#039;, &#039;&#039;);&lt;br /&gt;
			$id = $this-&amp;gt;getState(&#039;helloworld.id&#039;);&lt;br /&gt;
			$this-&amp;gt;_item =  $cache-&amp;gt;get($id);&lt;br /&gt;
			if ($this-&amp;gt;_item === false) {&lt;br /&gt;
&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		return $this-&amp;gt;_item;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public function updItem($data)&lt;br /&gt;
	{&lt;br /&gt;
        // set the variables from the passed data&lt;br /&gt;
        $id = $data[&#039;id&#039;];&lt;br /&gt;
        $greeting = $data[&#039;greeting&#039;];&lt;br /&gt;
&lt;br /&gt;
        // set the data into a query to update the record&lt;br /&gt;
		$db		= $this-&amp;gt;getDbo();&lt;br /&gt;
		$query	= $db-&amp;gt;getQuery(true);&lt;br /&gt;
        $query-&amp;gt;clear();&lt;br /&gt;
		$query-&amp;gt;update(&#039; #__helloworld &#039;);&lt;br /&gt;
		$query-&amp;gt;set(&#039; greeting = &#039;.$db-&amp;gt;Quote($greeting) );&lt;br /&gt;
		$query-&amp;gt;where(&#039; id = &#039; . (int) $id );&lt;br /&gt;
&lt;br /&gt;
		$db-&amp;gt;setQuery((string)$query);&lt;br /&gt;
&lt;br /&gt;
        if (!$db-&amp;gt;query()) {&lt;br /&gt;
            JError::raiseError(500, $db-&amp;gt;getErrorMsg());&lt;br /&gt;
        	return false;&lt;br /&gt;
        } else {&lt;br /&gt;
        	return true;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following file &#039;&#039;updhelloworld.xml&#039;&#039; should be created using your favourite editor and saved in the forms folder under the models directory.  The first of the fields being referenced id using the sql type so that I returns the results from the query into a dropdown list form to be selected.&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/forms/updhelloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/models/forms/updhelloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;form name=&amp;quot;updhelloworld&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset name=&amp;quot;updhelloworld&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;field&lt;br /&gt;
            name=&amp;quot;id&amp;quot;&lt;br /&gt;
            type=&amp;quot;sql&amp;quot;&lt;br /&gt;
            multiple=&amp;quot;false&amp;quot;&lt;br /&gt;
            size=&amp;quot;1&amp;quot;&lt;br /&gt;
            label=&amp;quot;COM_HELLOWORLD_FORM_LBL_UPDHELLOWORLD_ID&amp;quot;&lt;br /&gt;
            description=&amp;quot;COM_HELLOWORLD_FORM_DESC_UPDHELLOWORLD_ID&amp;quot;&lt;br /&gt;
            query=&amp;quot;select id, greeting from #__helloworld&amp;quot;&lt;br /&gt;
            key_field=&amp;quot;id&amp;quot;&lt;br /&gt;
            value_field=&amp;quot;greeting&amp;quot;&lt;br /&gt;
            default=&amp;quot;0&amp;quot;&lt;br /&gt;
			required=&amp;quot;true&amp;quot;&lt;br /&gt;
            &amp;gt;&lt;br /&gt;
                &amp;lt;option value=&amp;quot;&amp;quot;&amp;gt;JOPTION_SELECT_ID&amp;lt;/option&amp;gt;&lt;br /&gt;
        &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
            name=&amp;quot;greeting&amp;quot;&lt;br /&gt;
            type=&amp;quot;text&amp;quot;&lt;br /&gt;
			description=&amp;quot;COM_HELLOWORLD_FORM_DESC_UPDHELLOWORLD_GREETING&amp;quot;&lt;br /&gt;
			label=&amp;quot;COM_HELLOWORLD_FORM_LBL_UPDHELLOWORLD_GREETING&amp;quot;&lt;br /&gt;
			required=&amp;quot;true&amp;quot;&lt;br /&gt;
			size=&amp;quot;50&amp;quot;&lt;br /&gt;
		/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding some language keys ==&lt;br /&gt;
&lt;br /&gt;
This file provides the text link between the label in the model form definition to be displayed in the view.  And being for the frontend, it resides in the site folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/language/en-GB/en-GB.com_helloworld.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/language/en-GB/en-GB.com_helloworld.ini&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
COM_HELLOWORLD_FORM_LBL_UPDHELLOWORLD_ID=&amp;quot;Greeting ID&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_FORM_DESC_UPDHELLOWORLD_ID=&amp;quot;This is the ID of the Greeting record&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_FORM_LBL_UPDHELLOWORLD_GREETING=&amp;quot;Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_FORM_DESC_UPDHELLOWORLD_GREETING=&amp;quot;Greeting description&amp;quot;&lt;br /&gt;
JOPTION_SELECT_ID=&amp;quot; -- Select Greeting to Update -- &amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the last 2 lines to the &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.ini&#039;&#039; file to provide the text link for the menu type display.  And being for the backend, it resides in the admin language folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/language/en-GB/en-GB.com_helloworld.sys.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.ini&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
COM_HELLOWORLD=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_DESCRIPTION=&amp;quot;This is the Hello World description&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC=&amp;quot;This view displays a selected message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE=&amp;quot;Hello World&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_INSTALL_TEXT=&amp;quot;HelloWorld Install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MENU=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_DISCOVER_INSTALL_TEXT=&amp;quot;HelloWorld postlight discover install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_INSTALL_TEXT=&amp;quot;HelloWorld postflight install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_UNINSTALL_TEXT=&amp;quot;HelloWorld postflight uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_UPDATE_TEXT=&amp;quot;HelloWorld postflight update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_DISCOVER_INSTALL_TEXT=&amp;quot;HelloWorld preflight discover install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_INSTALL_TEXT=&amp;quot;HelloWorld preflight install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_UNINSTALL_TEXT=&amp;quot;HelloWorld preflight uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_UPDATE_TEXT=&amp;quot;HelloWorld preflight update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UNINSTALL_TEXT=&amp;quot;HelloWorld Uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDATE_TEXT=&amp;quot;HelloWorld Update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_TITLE=&amp;quot;Update the Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_DESC=&amp;quot;Update greeting here&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;_populateState&#039;&#039; method is, by default, automatically called when a state is read by the &#039;&#039;getState&#039;&#039; method.&lt;br /&gt;
&lt;br /&gt;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory-&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#script.php|script.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/updhelloworld.php|site/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/controllers/updhelloworld.php|site/controllers/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/controllers/index.html|site/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/views/updhelloworld/view.html.php|site/views/updhelloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/updhelloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/views/updhelloworld/tmpl/default.xml|site/views/updhelloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/views/updhelloworld/tmpl/default.php|site/views/updhelloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/models/updhelloworld.php|site/models/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_18#site/models/forms/updhelloworld.xml|site/models/forms/updhelloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#site/language/en-GB/en-GB.com_helloworld.ini|site/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/access.xml|admin/access.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/config.xml|admin/config.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_12#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_06#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_12#admin/sql/updates/mysql/0.0.12.sql|admin/sql/updates/mysql/0.0.12.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/sql/updates/mysql/0.0.13.sql|admin/sql/updates/mysql/0.0.13.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_12#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/models/forms/helloworld.xml|admin/models/forms/helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/forms/helloworld.js|admin/models/forms/helloworld.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/rules/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/models/rules/greeting.php|admin/models/rules/greeting.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/models/helloworld.php|admin/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_09#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_07#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/views/helloworld/view.html.php|admin/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/views/helloworld/submitbutton.js|admin/views/helloworld/submitbutton.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/views/helloworld/tmpl/edit.php|admin/views/helloworld/tmpl/edit.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/helpers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/helpers/helloworld.php|admin/helpers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_14#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_13#admin/language/en-GB/en-GB.com_helloworld.ini|admin/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/language/en-GB/en-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/controllers/helloworld.php|admin/controllers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_11#admin/controllers/helloworlds.php|admin/controllers/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_08#language/en-GB/en-GB.ini|language/en-GB/en-GB.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|media/images/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-16x16.png&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-48x48.png&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [http://joomlacode.org/gf/download/frsrelease/11394/58397/com_helloworld-1.6-part07.zip archive] and install it using the extension manager of Joomla. You can add a menu item of this component using the menu manager in the backend.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;2.5.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;name&amp;gt;COM_HELLOWORLD&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting conttraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;November 2009&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.18&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;COM_HELLOWORLD_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- Runs on install/uninstall/update; New in 2.5 --&amp;gt;&lt;br /&gt;
	&amp;lt;scriptfile&amp;gt;script.php&amp;lt;/scriptfile&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New in 2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;updhelloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;media destination=&amp;quot;com_helloworld&amp;quot; folder=&amp;quot;media&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;images&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/media&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu img=&amp;quot;../media/com_helloworld/images/tux-16x16.png&amp;quot;&amp;gt;COM_HELLOWORLD_MENU&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;config.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;access.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- views files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- controllers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- helpers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;helpers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		&amp;lt;languages folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;/languages&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- UPDATESERVER DEFINITION --&amp;gt;&lt;br /&gt;
	&amp;lt;updateservers&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note: No spaces or linebreaks allowed between the server tags --&amp;gt;&lt;br /&gt;
		&amp;lt;server type=&amp;quot;extension&amp;quot; priority=&amp;quot;1&amp;quot; name=&amp;quot;HelloWorld Update Site&amp;quot;&amp;gt;http://yourdomain.com/update/helloworld-update.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
	&amp;lt;/updateservers&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can see in your component &#039;&#039;&#039;hello-world&#039;&#039;&#039; an array with two colums, two rows and checkboxes. You can click the checkboxes in order to select the different options you want.&lt;br /&gt;
&lt;br /&gt;
== Zips ==&lt;br /&gt;
Download the zip file for this Part:&lt;br /&gt;
[http://www.glennarkell.com/joomlaorg/com_helloworld_0.0.18.zip]&lt;br /&gt;
&lt;br /&gt;
== Navigate ==&lt;br /&gt;
&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 17|Prev: Adding an update server]]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:garkell|Glenn Arkell]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[category:Joomla! 1.6]]&lt;br /&gt;
[[category:Joomla! 1.7]]&lt;br /&gt;
[[category:Joomla! 2.5]]&lt;br /&gt;
[[category:Manual]]&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Example_of_a_frontend_update_function&amp;diff=65115</id>
		<title>Archived talk:Developing a MVC Component/Example of a frontend update function</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Example_of_a_frontend_update_function&amp;diff=65115"/>
		<updated>2012-02-22T20:42:04Z</updated>

		<summary type="html">&lt;p&gt;Garkell: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This section of the tutorial seems to say that to add an &amp;quot;update&amp;quot; view to the helloworld component a new entry point file must be created with the same name as the view (&amp;quot;updhelloworld.php&amp;quot; in that example). I think this is wrong because:&lt;br /&gt;
1) I can delete this file and the example component still works&lt;br /&gt;
2) None of the other components have this structure (eg com_users just&lt;br /&gt;
has a switch in the main controller&#039;s display to select different&lt;br /&gt;
displays based on view name)&lt;br /&gt;
3) A &amp;quot;die()&amp;quot; in that file never gets executed.&lt;br /&gt;
&lt;br /&gt;
Note that &amp;quot;helloworld.php&amp;quot; (without the &amp;quot;upd&amp;quot; prefix) was created as the entry point back in part 2.&lt;br /&gt;
&lt;br /&gt;
:-Dave&lt;br /&gt;
&lt;br /&gt;
:: I can&#039;t see why there is dispatcher in the model and another import of it in the controller. [[User:Oc666|oc666]] 00:49, 14 February 2012 (CST)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hi Dave,&lt;br /&gt;
You are correct.  Since your comment I created my second small component and followed your suggestion and all is working as expected so I agree and will update.  Cheers.&lt;br /&gt;
&lt;br /&gt;
Glenn&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Example_of_a_frontend_update_function&amp;diff=63617</id>
		<title>Archived:Developing a MVC Component/Example of a frontend update function</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Example_of_a_frontend_update_function&amp;diff=63617"/>
		<updated>2011-12-15T04:19:19Z</updated>

		<summary type="html">&lt;p&gt;Garkell: An example of frontend form - my first go so be nice but change whatever is wrong&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial is for {{JVer|1.7}}&lt;br /&gt;
== Warning - this article needs to be reviewed by someone who knows what they&#039;re doing ==&lt;br /&gt;
&lt;br /&gt;
== Articles in this series ==&lt;br /&gt;
{{Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Contents}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[Developing a Model-View-Controller (MVC) Component for Joomla!1.6]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Basic frontend form ==&lt;br /&gt;
Designing the frontend interface leads us to create a Model-View-Controller triptych similar to the backend in Part 7. We have to create an entry point of our component, the &#039;&#039;site/updhelloworld.php&#039;&#039; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/updhelloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/updhelloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 &lt;br /&gt;
// import joomla controller library&lt;br /&gt;
jimport(&#039;joomla.application.component.controller&#039;);&lt;br /&gt;
 &lt;br /&gt;
// Get an instance of the controller prefixed by UpdHelloWorld&lt;br /&gt;
$controller = JController::getInstance(&#039;UpdHelloWorld&#039;);&lt;br /&gt;
 &lt;br /&gt;
// Perform the Request task&lt;br /&gt;
$controller-&amp;gt;execute(JRequest::getCmd(&#039;task&#039;));&lt;br /&gt;
 &lt;br /&gt;
// Redirect if set by the controller&lt;br /&gt;
$controller-&amp;gt;redirect();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the specific controller ==&lt;br /&gt;
The entry point now gets an instance of an &#039;&#039;UpdHelloWorld&#039;&#039; prefixed controller which extends the function of JControllerForm. Let&#039;s create a basic controllerform for the site part:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/controllers/updhelloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/controllers/updhelloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
// No direct access.&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
// Include dependancy of the main controllerform class&lt;br /&gt;
jimport(&#039;joomla.application.component.controllerform&#039;);&lt;br /&gt;
&lt;br /&gt;
class HelloWorldControllerUpdHelloWorld extends JControllerForm&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
	public function getModel($name = &#039;&#039;, $prefix = &#039;&#039;, $config = array(&#039;ignore_request&#039; =&amp;gt; true))&lt;br /&gt;
	{&lt;br /&gt;
		return parent::getModel($name, $prefix, array(&#039;ignore_request&#039; =&amp;gt; false));&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public function submit()&lt;br /&gt;
	{&lt;br /&gt;
		// Check for request forgeries.&lt;br /&gt;
		JRequest::checkToken() or jexit(JText::_(&#039;JINVALID_TOKEN&#039;));&lt;br /&gt;
&lt;br /&gt;
		// Initialise variables.&lt;br /&gt;
		$app	= JFactory::getApplication();&lt;br /&gt;
		$model	= $this-&amp;gt;getModel(&#039;updhelloworld&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Get the data from the form POST&lt;br /&gt;
		$data = JRequest::getVar(&#039;jform&#039;, array(), &#039;post&#039;, &#039;array&#039;);&lt;br /&gt;
&lt;br /&gt;
        // Now update the loaded data to the database via a function in the model&lt;br /&gt;
        $upditem	= $model-&amp;gt;updItem($data);&lt;br /&gt;
&lt;br /&gt;
    	// check if ok and display appropriate message.  This can also have a redirect if desired.&lt;br /&gt;
        if ($upditem) {&lt;br /&gt;
            echo &amp;quot;&amp;lt;h2&amp;gt;Updated Greeting has been saved&amp;lt;/h2&amp;gt;&amp;quot;;&lt;br /&gt;
        } else {&lt;br /&gt;
            echo &amp;quot;&amp;lt;h2&amp;gt;Updated Greeting failed to be saved&amp;lt;/h2&amp;gt;&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		return true;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This controller will display the appropriate message after the form is submitted.&lt;br /&gt;
&lt;br /&gt;
== Create the view ==&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, create a file &#039;&#039;site/views/updhelloworld/view.html.php&#039;&#039; containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/view.html.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/view.html.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 &lt;br /&gt;
// import Joomla view library&lt;br /&gt;
jimport(&#039;joomla.application.component.view&#039;);&lt;br /&gt;
 &lt;br /&gt;
/**&lt;br /&gt;
 * HTML View class for the UpdHelloWorld Component&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewUpdHelloWorld extends JView&lt;br /&gt;
{&lt;br /&gt;
	// Overwriting JView display method&lt;br /&gt;
	function display($tpl = null) &lt;br /&gt;
	{&lt;br /&gt;
		$app		= JFactory::getApplication();&lt;br /&gt;
		$params		= $app-&amp;gt;getParams();&lt;br /&gt;
		$dispatcher = JDispatcher::getInstance();&lt;br /&gt;
&lt;br /&gt;
		// Get some data from the models&lt;br /&gt;
		$state		= $this-&amp;gt;get(&#039;State&#039;);&lt;br /&gt;
		$item		= $this-&amp;gt;get(&#039;Item&#039;);&lt;br /&gt;
		$this-&amp;gt;form	= $this-&amp;gt;get(&#039;Form&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Check for errors.&lt;br /&gt;
		if (count($errors = $this-&amp;gt;get(&#039;Errors&#039;))) &lt;br /&gt;
		{&lt;br /&gt;
			JError::raiseError(500, implode(&#039;&amp;lt;br /&amp;gt;&#039;, $errors));&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Joomla, views display data using a layout. With your favorite file manager and editor, put a file &#039;&#039;site/views/updhelloworld/tmpl/default.php&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/tmpl/default.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/tmpl/default.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JHtml::_(&#039;behavior.keepalive&#039;);&lt;br /&gt;
JHtml::_(&#039;behavior.formvalidation&#039;);&lt;br /&gt;
JHtml::_(&#039;behavior.tooltip&#039;);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
    &amp;lt;h2&amp;gt;Update the Hello World greeting&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;form class=&amp;quot;form-validate&amp;quot; action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php&#039;); ?&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot; id=&amp;quot;updhelloworld&amp;quot; name=&amp;quot;updhelloworld&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset&amp;gt;&lt;br /&gt;
        	&amp;lt;dl&amp;gt;&lt;br /&gt;
          	    &amp;lt;dt&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getLabel(&#039;id&#039;); ?&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
             	&amp;lt;dd&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getInput(&#039;id&#039;); ?&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
        	    &amp;lt;dt&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getLabel(&#039;greeting&#039;); ?&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
        	    &amp;lt;dd&amp;gt;&amp;lt;?php echo $this-&amp;gt;form-&amp;gt;getInput(&#039;greeting&#039;); ?&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
            	&amp;lt;dd&amp;gt;&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;option&amp;quot; value=&amp;quot;com_helloworld&amp;quot; /&amp;gt;&lt;br /&gt;
            	    &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;updhelloworld.submit&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;/dd&amp;gt;&lt;br /&gt;
                &amp;lt;dt&amp;gt;&amp;lt;/dt&amp;gt;&lt;br /&gt;
                &amp;lt;dd&amp;gt;&amp;lt;button type=&amp;quot;submit&amp;quot; class=&amp;quot;button&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;Submit&#039;); ?&amp;gt;&amp;lt;/button&amp;gt;&lt;br /&gt;
			                &amp;lt;?php echo JHtml::_(&#039;form.token&#039;); ?&amp;gt;&lt;br /&gt;
                &amp;lt;/dd&amp;gt;&lt;br /&gt;
        	&amp;lt;/dl&amp;gt;&lt;br /&gt;
        &amp;lt;fieldset&amp;gt;&lt;br /&gt;
    &amp;lt;/form&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;clr&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This layout utilises the forms design which resides with the related model.  The getLabel and getInput will pickup the xml fields defined and display appropriately.  More on the xml file within the models section of this tutorial.&lt;br /&gt;
&lt;br /&gt;
Create a file &#039;&#039;site/views/updhelloworld/tmpl/default.xml&#039;&#039; containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/updhelloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/views/updhelloworld/tmpl/default.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This enables a menu option to be allocated to the frontend form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the model ==&lt;br /&gt;
The &#039;&#039;UpdHelloWorld&#039;&#039; model sets up the data through from the related form and allows the mechanism to save the subsequent data loaded into the form into the database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/updhelloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/models/updhelloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 &lt;br /&gt;
// Include dependancy of the main model form&lt;br /&gt;
jimport(&#039;joomla.application.component.modelform&#039;);&lt;br /&gt;
// import Joomla modelitem library&lt;br /&gt;
jimport(&#039;joomla.application.component.modelitem&#039;);&lt;br /&gt;
// Include dependancy of the dispatcher&lt;br /&gt;
jimport(&#039;joomla.event.dispatcher&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * UpdHelloWorld Model&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelUpdHelloWorld extends JModelForm&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var object item&lt;br /&gt;
	 */&lt;br /&gt;
	protected $item;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the data for a new qualification&lt;br /&gt;
	 */&lt;br /&gt;
	public function getForm($data = array(), $loadData = true)&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
        $app = JFactory::getApplication(&#039;site&#039;);&lt;br /&gt;
&lt;br /&gt;
        // Get the form.&lt;br /&gt;
		$form = $this-&amp;gt;loadForm(&#039;com_helloworld.updhelloworld&#039;, &#039;updhelloworld&#039;, array(&#039;control&#039; =&amp;gt; &#039;jform&#039;, &#039;load_data&#039; =&amp;gt; true));&lt;br /&gt;
		if (empty($form)) {&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
		return $form;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 * @return object The message to be displayed to the user&lt;br /&gt;
	 */&lt;br /&gt;
	function &amp;amp;getItem()&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;_item))&lt;br /&gt;
		{&lt;br /&gt;
			$cache = JFactory::getCache(&#039;com_helloworld&#039;, &#039;&#039;);&lt;br /&gt;
			$id = $this-&amp;gt;getState(&#039;helloworld.id&#039;);&lt;br /&gt;
			$this-&amp;gt;_item =  $cache-&amp;gt;get($id);&lt;br /&gt;
			if ($this-&amp;gt;_item === false) {&lt;br /&gt;
&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		return $this-&amp;gt;_item;&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public function updItem($data)&lt;br /&gt;
	{&lt;br /&gt;
        // set the variables from the passed data&lt;br /&gt;
        $id = $data[&#039;id&#039;];&lt;br /&gt;
        $greeting = $data[&#039;greeting&#039;];&lt;br /&gt;
&lt;br /&gt;
        // set the data into a query to update the record&lt;br /&gt;
		$db		= $this-&amp;gt;getDbo();&lt;br /&gt;
		$query	= $db-&amp;gt;getQuery(true);&lt;br /&gt;
        $query-&amp;gt;clear();&lt;br /&gt;
		$query-&amp;gt;update(&#039; #__helloworld &#039;);&lt;br /&gt;
		$query-&amp;gt;set(&#039; greeting = &#039;.$db-&amp;gt;Quote($greeting) );&lt;br /&gt;
		$query-&amp;gt;where(&#039; id = &#039; . (int) $id );&lt;br /&gt;
&lt;br /&gt;
		$db-&amp;gt;setQuery((string)$query);&lt;br /&gt;
&lt;br /&gt;
        if (!$db-&amp;gt;query()) {&lt;br /&gt;
            JError::raiseError(500, $db-&amp;gt;getErrorMsg());&lt;br /&gt;
        	return false;&lt;br /&gt;
        } else {&lt;br /&gt;
        	return true;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following file &#039;&#039;updhelloworld.xml&#039;&#039; should be created using your favourite editor and saved in the forms folder under the models directory.  The first of the fields being referenced id using the sql type so that I returns the results from the query into a dropdown list form to be selected.&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/forms/updhelloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/models/forms/updhelloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;form name=&amp;quot;updhelloworld&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset name=&amp;quot;updhelloworld&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;field&lt;br /&gt;
            name=&amp;quot;id&amp;quot;&lt;br /&gt;
            type=&amp;quot;sql&amp;quot;&lt;br /&gt;
            multiple=&amp;quot;false&amp;quot;&lt;br /&gt;
            size=&amp;quot;1&amp;quot;&lt;br /&gt;
            label=&amp;quot;COM_HELLOWORLD_FORM_LBL_UPDHELLOWORLD_ID&amp;quot;&lt;br /&gt;
            description=&amp;quot;COM_HELLOWORLD_FORM_DESC_UPDHELLOWORLD_ID&amp;quot;&lt;br /&gt;
            query=&amp;quot;select id, greeting from #__helloworld&amp;quot;&lt;br /&gt;
            key_field=&amp;quot;id&amp;quot;&lt;br /&gt;
            value_field=&amp;quot;greeting&amp;quot;&lt;br /&gt;
            default=&amp;quot;0&amp;quot;&lt;br /&gt;
			required=&amp;quot;true&amp;quot;&lt;br /&gt;
            &amp;gt;&lt;br /&gt;
                &amp;lt;option value=&amp;quot;&amp;quot;&amp;gt;JOPTION_SELECT_ID&amp;lt;/option&amp;gt;&lt;br /&gt;
        &amp;lt;/field&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
            name=&amp;quot;greeting&amp;quot;&lt;br /&gt;
            type=&amp;quot;text&amp;quot;&lt;br /&gt;
			description=&amp;quot;COM_HELLOWORLD_FORM_DESC_UPDHELLOWORLD_GREETING&amp;quot;&lt;br /&gt;
			label=&amp;quot;COM_HELLOWORLD_FORM_LBL_UPDHELLOWORLD_GREETING&amp;quot;&lt;br /&gt;
			required=&amp;quot;true&amp;quot;&lt;br /&gt;
			size=&amp;quot;50&amp;quot;&lt;br /&gt;
		/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding some language keys ==&lt;br /&gt;
&lt;br /&gt;
This file provides the text link between the label in the model form definition to be displayed in the view.  And being for the frontend, it resides in the site folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/language/en-GB/en-GB.com_helloworld.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/language/en-GB/en-GB.com_helloworld.ini&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
COM_HELLOWORLD_FORM_LBL_UPDHELLOWORLD_ID=&amp;quot;Greeting ID&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_FORM_DESC_UPDHELLOWORLD_ID=&amp;quot;This is the ID of the Greeting record&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_FORM_LBL_UPDHELLOWORLD_GREETING=&amp;quot;Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_FORM_DESC_UPDHELLOWORLD_GREETING=&amp;quot;Greeting description&amp;quot;&lt;br /&gt;
JOPTION_SELECT_ID=&amp;quot; -- Select Greeting to Update -- &amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the last 2 lines to the &#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.ini&#039;&#039; file to provide the text link for the menu type display.  And being for the backend, it resides in the admin language folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/language/en-GB/en-GB.com_helloworld.sys.ini&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/language/en-GB/en-GB.com_helloworld.sys.ini&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
COM_HELLOWORLD=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_DESCRIPTION=&amp;quot;This is the Hello World description&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC=&amp;quot;This view displays a selected message&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE=&amp;quot;Hello World&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_INSTALL_TEXT=&amp;quot;HelloWorld Install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MENU=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_DISCOVER_INSTALL_TEXT=&amp;quot;HelloWorld postlight discover install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_INSTALL_TEXT=&amp;quot;HelloWorld postflight install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_UNINSTALL_TEXT=&amp;quot;HelloWorld postflight uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_POSTFLIGHT_UPDATE_TEXT=&amp;quot;HelloWorld postflight update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_DISCOVER_INSTALL_TEXT=&amp;quot;HelloWorld preflight discover install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_INSTALL_TEXT=&amp;quot;HelloWorld preflight install script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_UNINSTALL_TEXT=&amp;quot;HelloWorld preflight uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_PREFLIGHT_UPDATE_TEXT=&amp;quot;HelloWorld preflight update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UNINSTALL_TEXT=&amp;quot;HelloWorld Uninstall script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDATE_TEXT=&amp;quot;HelloWorld Update script&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_TITLE=&amp;quot;Update the Greeting&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_UPDHELLOWORLD_VIEW_DEFAULT_DESC=&amp;quot;Update greeting here&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;_populateState&#039;&#039; method is, by default, automatically called when a state is read by the &#039;&#039;getState&#039;&#039; method.&lt;br /&gt;
&lt;br /&gt;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#script.php|script.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_18#site/updhelloworld.php|site/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_18#site/controllers/updhelloworld.php|site/controllers/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_18#site/controllers/index.html|site/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_13#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_18#site/views/updhelloworld/view.html.php|site/views/updhelloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|site/views/updhelloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_06#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_13#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_18#site/views/updhelloworld/tmpl/default.xml|site/views/updhelloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_18#site/views/updhelloworld/tmpl/default.php|site/views/updhelloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_13#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_18#site/models/updhelloworld.php|site/models/updhelloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_18#site/models/forms/updhelloworld.xml|site/models/forms/updhelloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|site/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_08#site/language/en-GB/en-GB.com_helloworld.ini|site/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_14#admin/access.xml|admin/access.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_14#admin/config.xml|admin/config.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_14#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_12#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_13#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_06#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_06#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_12#admin/sql/updates/mysql/0.0.12.sql|admin/sql/updates/mysql/0.0.12.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_13#admin/sql/updates/mysql/0.0.13.sql|admin/sql/updates/mysql/0.0.13.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_12#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|admin/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_13#admin/models/forms/helloworld.xml|admin/models/forms/helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_11#admin/models/forms/helloworld.js|admin/models/forms/helloworld.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|admin/models/rules/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_11#admin/models/rules/greeting.php|admin/models/rules/greeting.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_14#admin/models/helloworld.php|admin/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_09#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_14#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_11#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_07#admin/views/helloworlds/tmpl/default_head.php|admin/views/helloworlds/tmpl/default_head.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_07#admin/views/helloworlds/tmpl/default_body.php|admin/views/helloworlds/tmpl/default_body.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_07#admin/views/helloworlds/tmpl/default_foot.php|admin/views/helloworlds/tmpl/default_foot.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|admin/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_14#admin/views/helloworld/view.html.php|admin/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_11#admin/views/helloworld/submitbutton.js|admin/views/helloworld/submitbutton.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|admin/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_13#admin/views/helloworld/tmpl/edit.php|admin/views/helloworld/tmpl/edit.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|admin/helpers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_14#admin/helpers/helloworld.php|admin/helpers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_14#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_13#admin/language/en-GB/en-GB.com_helloworld.ini|admin/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/language/en-GB/en-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|admin/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_11#admin/controllers/helloworld.php|admin/controllers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_11#admin/controllers/helloworlds.php|admin/controllers/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_08#language/en-GB/en-GB.ini|language/en-GB/en-GB.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|media/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6_-_Part_01#index.html|media/images/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-16x16.png&#039;&#039;&lt;br /&gt;
* &#039;&#039;media/images/tux-48x48.png&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a compressed file of this directory or directly download the [http://joomlacode.org/gf/download/frsrelease/11394/58397/com_helloworld-1.6-part07.zip archive] and install it using the extension manager of Joomla!1.6. You can add a menu item of this component using the menu manager in the backend.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;1.6.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;name&amp;gt;COM_HELLOWORLD&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting conttraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;November 2009&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.18&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;COM_HELLOWORLD_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- Runs on install/uninstall/update; New in 1.6 --&amp;gt;&lt;br /&gt;
	&amp;lt;scriptfile&amp;gt;script.php&amp;lt;/scriptfile&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New in 1.6 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;updhelloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;media destination=&amp;quot;com_helloworld&amp;quot; folder=&amp;quot;media&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;images&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/media&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu img=&amp;quot;../media/com_helloworld/images/tux-16x16.png&amp;quot;&amp;gt;COM_HELLOWORLD_MENU&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;config.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;access.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- views files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- controllers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- helpers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;helpers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		&amp;lt;languages folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
			&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;/languages&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
	&amp;lt;!-- UPDATESERVER DEFINITION --&amp;gt;&lt;br /&gt;
	&amp;lt;updateservers&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note: No spaces or linebreaks allowed between the server tags --&amp;gt;&lt;br /&gt;
		&amp;lt;server type=&amp;quot;extension&amp;quot; priority=&amp;quot;1&amp;quot; name=&amp;quot;HelloWorld Update Site&amp;quot;&amp;gt;http://yourdomain.com/update/helloworld-update.xml&amp;lt;/server&amp;gt;&lt;br /&gt;
	&amp;lt;/updateservers&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can see in your component &#039;&#039;&#039;hello-world&#039;&#039;&#039; an array with two colums, two rows and checkboxes. You can click the checkboxes in order to select the different options you want.&lt;br /&gt;
&lt;br /&gt;
== Zips ==&lt;br /&gt;
Download the zip file for this Part:&lt;br /&gt;
[http://www.glennarkell.com/joomlaorg/com_helloworld_0.0.18.zip]&lt;br /&gt;
&lt;br /&gt;
== Navigate ==&lt;br /&gt;
&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Part 17|Prev: Adding an update server]]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:garkell|Glenn Arkell]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[category:Joomla! 1.7]]&lt;br /&gt;
[[category:Manual]]&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Contents&amp;diff=63616</id>
		<title>Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Contents</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Contents&amp;diff=63616"/>
		<updated>2011-12-15T04:15:11Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Added Part 18 - example of front end form&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Part 01|Developing a Basic Component]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Part 02|Adding a view to the site part]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Part 03|Adding a menu type to the site part]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Part 04|Adding a model to the site part]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Part 05|Adding a variable request in the menu type]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Part 06|Using the database]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Part 07|Basic backend]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Part 08|Adding language management]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Part 09|Adding backend actions]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Part 10|Adding decorations to the backend]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Part 11|Adding verifications]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Part 12|Adding categories]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Part 13|Adding configuration]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Part 14|Adding ACL]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Part 15|Adding an install/uninstall/update script file]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Part 16|Using the language filter facility]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Part 17|Adding an update server]]&lt;br /&gt;
* [[Developing a Model-View-Controller (MVC) Component for Joomla!1.6 - Part 18|Example of a Frontend Update Function]]&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_JTable_class&amp;diff=63594</id>
		<title>J1.5:Using the JTable class</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Using_the_JTable_class&amp;diff=63594"/>
		<updated>2011-12-10T23:18:47Z</updated>

		<summary type="html">&lt;p&gt;Garkell: Added comment about version of Joomla this is related to.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial is for {{JVer|1.5}} In Joomla! 1.5.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
== Writing an extension of JTable ==&lt;br /&gt;
&lt;br /&gt;
The [[JTable]] class is an implementation of the [http://en.wikipedia.org/wiki/Active_record_pattern Active Record] design pattern. It is used throughout Joomla! for [http://en.wikipedia.org/wiki/Create,_read,_update_and_delete creating, reading, updating, and deleting] records in the database table.&lt;br /&gt;
&lt;br /&gt;
To use JTable, create an extension of the class. In this example, we have a database table containing recipes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die();&lt;br /&gt;
&lt;br /&gt;
class TableRecipes extends JTable&lt;br /&gt;
{&lt;br /&gt;
	var $id = null;&lt;br /&gt;
	var $ingredients = null;&lt;br /&gt;
	var $instructions = null;&lt;br /&gt;
	var $serves = null;&lt;br /&gt;
	var $difficulty = null;&lt;br /&gt;
	var $prep_time = null;&lt;br /&gt;
	var $cook_time = null;&lt;br /&gt;
	var $published = 0;&lt;br /&gt;
	&lt;br /&gt;
	function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct( &#039;#__recipes&#039;, &#039;id&#039;, $db );&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When naming your class extension, the convention is to prefix it with &#039;Table&#039;, then follow with a [http://en.wikipedia.org/wiki/CamelCase CamelCased] version of the table&#039;s name. All of the member variables of your class should match the column names in the database. The default values should be valid according to the table schema For instance, if you have columns that are NOT NULL, you must use a value other than &#039;null&#039; as the default.&lt;br /&gt;
&lt;br /&gt;
Finally,  create a constructor for the class that accepts a reference to the current database instance. This will call the parent constructor which needs the name of the table, the name of the primary key column, and the database instance. The name of the table uses #__ instead of jos_, as the administrator can pick any table prefix desired during Joomla! installation.&lt;br /&gt;
&lt;br /&gt;
If you were using this class as a part of a component called &#039;Recipes&#039;, you would place this code in the file /administrator/components/com_recipes/tables/recipes.php.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Using a JTable class extension ==&lt;br /&gt;
&lt;br /&gt;
Once the table class is in place, you can use it in any Joomla! extension. To include the file, place this line in your extension&#039;s source code (use com_nameofyourcomponent in place of com_recipes):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.&#039;components&#039;.DS.&#039;com_recipes&#039;.DS.&#039;tables&#039;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get an instance of the object, use this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$row =&amp;amp; JTable::getInstance(&#039;recipes&#039;, &#039;Table&#039;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the lowercase version of the suffix of your class name is used as the first parameter, with the prefix &#039;Table&#039; as the second. Also, the getInstance() member function of JTable returns the object by reference instead of value; use =&amp;amp; to enforce this. &lt;br /&gt;
&lt;br /&gt;
In a model class (extends JModel) you can also use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$row =&amp;amp; $this-&amp;gt;getTable(&#039;recipes&#039;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that if you have not used the standard naming convention, you can supply the class prefix as the optional second parameter.&lt;br /&gt;
&lt;br /&gt;
=== Checkout/Checkin ===&lt;br /&gt;
Common scenario is when multiple users are editing identical item (e.g article, category, user and etc) simultaneously, which in turn, may results in arbitrary data when saved by the users (depends on who last saved the item). Joomla! solves such cases of unknown modification ownership using Checkouts and Checkins in order to provide access only to one user at a time. For example, if one user began editing an article, then it is said that the article was &#039;&#039;&#039;checked out&#039;&#039;&#039; by the user, when finished working with the article (usually by closing it using a button), the article is &#039;&#039;&#039;checked in&#039;&#039;&#039; by the user. At the time the user was editing the article, no other user could edit the same article, unless manually specified by a user with the right permissions. You can find further explanation [http://help.joomla.org/content/view/202/153/ here].&lt;br /&gt;
The following examples demonstrate how Checkout/Checkin may be implemented.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Checkout&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// retrieve item identifier from request&lt;br /&gt;
$itemId  = JRequest::getInt(&#039;itemId&#039;);&lt;br /&gt;
// the user to test checkout with, could be any other user you want&lt;br /&gt;
$user     = JFactory::getUser();&lt;br /&gt;
&lt;br /&gt;
// load the item&#039;s data so we&#039;ll know with what item were dealing with&lt;br /&gt;
if (!$row-&amp;gt;load($itemId)) {&lt;br /&gt;
    return JError::raiseWarning( 500, $row-&amp;gt;getError() );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// check out the item&lt;br /&gt;
if ($row-&amp;gt;checkout($user-&amp;gt;id)) {&lt;br /&gt;
    echo &#039;Item was checked out by the user.&#039;;&lt;br /&gt;
} else {&lt;br /&gt;
    return JError::raiseWarning( 500, $row-&amp;gt;getError() );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;checkout()&#039;&#039;&#039; will signal the item was checked out by the user whom ID we provided as an argument to the method.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Checkin&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// retrieve item identifier from request&lt;br /&gt;
$itemId  = JRequest::getInt(&#039;itemId&#039;);&lt;br /&gt;
// the user to test checkout with, could be any other user you want&lt;br /&gt;
$user     = JFactory::getUser();&lt;br /&gt;
&lt;br /&gt;
// load the item&#039;s data so we&#039;ll know with what item were dealing with&lt;br /&gt;
if (!$row-&amp;gt;load($itemId)) {&lt;br /&gt;
    return JError::raiseWarning( 500, $row-&amp;gt;getError() );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// check if the item was checked out, and if it does - whether or not it was checked out by the user&lt;br /&gt;
if($row-&amp;gt;isCheckedOut($user-&amp;gt;id)) {&lt;br /&gt;
    // check in the item&lt;br /&gt;
    if ($row-&amp;gt;checkin()) {&lt;br /&gt;
        echo &#039;The item was checked in, and can now be edited by other users.&#039;;&lt;br /&gt;
    } else {&lt;br /&gt;
        return JError::raiseWarning( 500, $row-&amp;gt;getError() );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We use &#039;&#039;&#039;isCheckedOut()&#039;&#039;&#039; to find out whether the item was checked out,  it returns TRUE in the following cases:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Item is empty (i.e no data was loaded to the item).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The item does not support checkout, which can be as a result of database design.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The supplied user ID does not match the ID of the user who checked out the item, meaning the item is probably being edited by another user already, or the user who last checked out the item did not properly checked in the item. &#039;&#039;&#039;This is probably the most common scenario&#039;&#039;&#039; when dealing with items in the backend.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;isCheckedOut()&#039;&#039;&#039; returns FALSE in the following cases:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The item was not checked out by any user.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The item was checked out, but by the same user who checked it out (i.e the user with the ID we passed to isCheckedOut()).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;checkin()&#039;&#039;&#039; will purge any checkout state that was applied to the item.&lt;br /&gt;
&lt;br /&gt;
=== Create/Update ===&lt;br /&gt;
In a typical situation, you will have an HTML form submitted by the user which will PHP will interpret for you as an associative array. The JRequest class in Joomla! has functions ready to assist with retrieving this data safely. Use JRequest::get(&#039;post&#039;) to retrieve all of the elements in the HTTP POST request as a sanitized array.&lt;br /&gt;
&lt;br /&gt;
Once you have this array, you can pass it into the bind() method of JTable. Doing this will match the associated items of the array with member variables of the class. In the following example, the array is retrieved from JRequest::get(&#039;post&#039;) and immediately passed into bind(). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if (!$row-&amp;gt;bind( JRequest::get( &#039;post&#039; ) )) {&lt;br /&gt;
	return JError::raiseWarning( 500, $row-&amp;gt;getError() );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If bind() fails, you want to stop the application and explain the failure before your extension attempts to send the data. The raiseWarning() function of JError allows you to stop Joomla!, while the getError() function returns the error message stored in the JTable object.&lt;br /&gt;
&lt;br /&gt;
When binding succeeds and your object is ready, call the store() function. Again, if something goes wrong, stop the application and explain why. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if (!$row-&amp;gt;store()) {&lt;br /&gt;
	JError::raiseError(500, $row-&amp;gt;getError() );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* If any member variables of your JTable object are null when store() is called, they are ignored by default. This allows you to update specific columns of your table, while leaving the others untouched. If you wish to override this behavior to ensure that all columns have a value, pass true into store().&lt;br /&gt;
* The JTable::bind() and JRequest::get() functions do not enforce data types. If you need a column to be a specific type (for instance, integer), you need to add this logic to your code before calling store().&lt;br /&gt;
&lt;br /&gt;
=== Read ===&lt;br /&gt;
To load a specific row of the database with JTable, pass the key into the load() member function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$row-&amp;gt;load( $id );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This relies on the key column you specified in the second parameter of parent::__construct() when you extended JTable.&lt;br /&gt;
&lt;br /&gt;
=== Delete ===&lt;br /&gt;
Like read(), delete() allows you to destroy a specific row in the table based on the key specified earlier.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$row-&amp;gt;delete( $id );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to delete multiple rows at once, you will need to write the query manually.&lt;br /&gt;
&lt;br /&gt;
== Member Functions ==&lt;br /&gt;
{{jfr summary|class=JTable|methods=yes}}&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
When properly extended, JTable gives you all of the basic functions you need for managing and retrieving records in a database table. Member functions take care of the rest when you add member variables, the table name, and the key column.&lt;/div&gt;</summary>
		<author><name>Garkell</name></author>
	</entry>
</feed>