<?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=GregJPreece</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=GregJPreece"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/GregJPreece"/>
	<updated>2026-07-08T16:46:30Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/en&amp;diff=786461</id>
		<title>Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!4.x - Contents/en</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!4.x_-_Contents/en&amp;diff=786461"/>
		<updated>2021-04-04T07:29:27Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: &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;div class=&amp;quot;large-4 columns&amp;quot; style=&amp;quot;float:right; background:#fff;margin:0 0 1.0em 1.0em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-12 columns panel radius mw-collapsible&amp;quot; style=&amp;quot;width:100%;background:#fff;font-size:.8em&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&#039;&#039;&#039;Articles in this Series&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-12 columns panel mw-collapsible-content&amp;quot; style=&amp;quot;border:none; background:#fff; min-width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Introduction|Introduction]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Developing a Basic Component]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_View_to_the_Site_Part|Adding a View to the Site Part]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_Menu_Type_to_the_Site_Part|Adding a Menu Type to the Site Part]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Language_Management|Language Management]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_Model_to_the_Site_Part|Adding a Model to the Site Part]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_Request_Variable_in_the_Menu_Link|Adding a Request Variable in the Menu Link]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Setting_up_the_Database|Setting Up the Database]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{-}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials in a Series{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Setting_up_the_Database&amp;diff=786460</id>
		<title>J4.x:Developing an MVC Component/Setting up the Database</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Setting_up_the_Database&amp;diff=786460"/>
		<updated>2021-04-04T07:28:07Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Created page with &amp;quot;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}} {{-}} {{Top portal heading|color=white-bkgd|icon=file-code-o|icon-color=#5091cd|size=5x|text-color=#333|title=Setting Up the D...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}}&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=Setting Up the Database}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Notes/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Now we have finally arrived at the stage of development where we are going to create the database tables that our component will use to store and retrieve data. Depending on its purpose, your extension may not require database tables to operate, but given the sophistication level of component extensions this is unlikely.&lt;br /&gt;
&lt;br /&gt;
Installation, uninstallation and version upgrades within a Joomla! component are handled using SQL scripts placed in the &amp;lt;tt&amp;gt;admin/sql&amp;lt;/tt&amp;gt; folder of the component. An SQL script matches a specific database engine, for example &amp;lt;tt&amp;gt;install.mysql.utf8.sql&amp;lt;/tt&amp;gt; will only be run if Joomla! is running on a MySQL database. At the time of writing, Joomla! 4 supports MySQL and PostgreSQL, and we recommend writing SQL scripts for both database types for maximum compatibility. However, for the purposes of this tutorial we will be focusing on MySQL-based scripts.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s go ahead and write the SQL scripts that will be needed to create a database table to hold customised greeting messages for our component. In later sections of the tutorial, we&#039;ll build a control panel to manage these messages.&lt;br /&gt;
&lt;br /&gt;
== Required Changes ==&lt;br /&gt;
&lt;br /&gt;
We&#039;ll need to make files to install and uninstall the component, and one upgrade file. As our component is already installed, an upgrade file is needed to make the necessary changes.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
 | 1&lt;br /&gt;
 | Create: [[#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&lt;br /&gt;
 | An SQL file that is run when the component is installed on a MySQL database&lt;br /&gt;
 |-&lt;br /&gt;
 | 2&lt;br /&gt;
 | Create: [[#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&lt;br /&gt;
 | An SQL file that is run when the component is uninstalled on a MySQL database&lt;br /&gt;
 |-&lt;br /&gt;
 | 3&lt;br /&gt;
 | Create: [[#admin/sql/mysql/0.0.7.sql|admin/sql/mysql/0.0.7.sql]]&lt;br /&gt;
 | An SQL file that is run when the component is updated to/beyond version 0.0.7 on a MySQL database&lt;br /&gt;
 |-&lt;br /&gt;
 | 4&lt;br /&gt;
 | Update: [[#helloworld.xml|helloworld.xml]]&lt;br /&gt;
 | We&#039;ll need to add the new &amp;lt;tt&amp;gt;sql&amp;lt;/tt&amp;gt; directory to our file copy list, and add instructions for Joomla! on where to find our scripts&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== File Details ==&lt;br /&gt;
&lt;br /&gt;
{{vanchor|admin/sql/install.mysql.utf8.sql}}&lt;br /&gt;
&lt;br /&gt;
This file will need to be updated whenever you make changes to your component&#039;s database schema. It is run on installation. Note that when you are creating tables, you prefix the name with &amp;lt;tt&amp;gt;#__&amp;lt;/tt&amp;gt;. Joomla! will automatically replace this prefix with the system-configured database table prefix. You must ensure that your database names use this prefix whenever you are creating or updating them. Additionally, we &#039;&#039;&#039;highly recommend&#039;&#039;&#039; that you prefix all your table names, key names, etc with the name of your component (as seen here) to prevent any chance of collision between components on a Joomla! site.&lt;br /&gt;
&lt;br /&gt;
Note also that we are using &amp;lt;tt&amp;gt;IF EXISTS&amp;lt;/tt&amp;gt; checks on our &amp;lt;tt&amp;gt;DROP&amp;lt;/tt&amp;gt; statements, and placing &amp;lt;tt&amp;gt;DROP&amp;lt;/tt&amp;gt; statements before &amp;lt;tt&amp;gt;CREATE&amp;lt;/tt&amp;gt; statements. While it may seem that the status of the database is predictable - there should be no existing table with that name before we create it - it is best to never assume that the previous install/uninstall operation completed cleanly and successfully. In the rare instance of such an error, our code will continue to function.&lt;br /&gt;
&lt;br /&gt;
If this file were for a PostgreSQL database, it would be called &amp;lt;tt&amp;gt;install.postgresql.utf8.sql&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld_greetings`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld_greetings` ( &lt;br /&gt;
    `id` SERIAL NOT NULL, &lt;br /&gt;
    `greeting` VARCHAR(200) NOT NULL, &lt;br /&gt;
    `published` BOOLEAN NOT NULL DEFAULT FALSE, &lt;br /&gt;
    PRIMARY KEY (`id`)&lt;br /&gt;
) ENGINE = InnoDB; &lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld_greetings` (`greeting`) VALUES&lt;br /&gt;
    (&#039;Hello World!&#039;),&lt;br /&gt;
    (&#039;Good bye World!&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{vanchor|admin/sql/uninstall.mysql.utf8.sql}}&lt;br /&gt;
&lt;br /&gt;
This file must take every action required to remove this component&#039;s effect on the Joomla! database. In our case, it is currently very simple - if the greeting table exists, remove it.&lt;br /&gt;
&lt;br /&gt;
If this file were for a PostgreSQL database, it would be called &amp;lt;tt&amp;gt;uninstall.postgresql.utf8.sql&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld_greetings`;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{vanchor|admin/sql/mysql/0.0.7.sql}}&lt;br /&gt;
&lt;br /&gt;
When you create a new version of your component that has matching database changes, those changes will need to go into database update files. The filename is simply the version number that requires the changes, and the files are grouped into folders according to the database engine they are intended to run on. When Joomla! upgrades a component, it will look for any upgrade files between the previously installed version number and the new version number, and run them in sequence.&lt;br /&gt;
&lt;br /&gt;
In our case, as we did not have any database tables before our new 0.0.7 version, this file is identical to the install file.&lt;br /&gt;
&lt;br /&gt;
If this file were for a PostgreSQL database, it would be named the same, but would be placed in &amp;lt;tt&amp;gt;admin/sql/postgresql&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld_greetings`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld_greetings` ( &lt;br /&gt;
    `id` SERIAL NOT NULL, &lt;br /&gt;
    `greeting` VARCHAR(200) NOT NULL, &lt;br /&gt;
    `published` BOOLEAN NOT NULL DEFAULT FALSE, &lt;br /&gt;
    PRIMARY KEY (`id`)&lt;br /&gt;
) ENGINE = InnoDB; &lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld_greetings` (`greeting`) VALUES&lt;br /&gt;
    (&#039;Hello World!&#039;),&lt;br /&gt;
    (&#039;Good bye World!&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{vanchor|helloworld.xml}}&lt;br /&gt;
&lt;br /&gt;
In our updated manifest file, we need to tell Joomla! to copy our new &amp;lt;tt&amp;gt;admin/sql&amp;lt;/tt&amp;gt; folder when installing/upgrading the component. We also need to tell it that our component now has database files, which ones to run on which action, and where to find them.&lt;br /&gt;
&lt;br /&gt;
The three new elements, &amp;lt;tt&amp;gt;&amp;lt;install /&amp;gt;&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;&amp;lt;uninstall /&amp;gt;&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;&amp;lt;update /&amp;gt;&amp;lt;/tt&amp;gt; are fairly self-explanatory. While the structures are slightly different, each essentially consists of an action (the element), a database type (mysql/postgresql) and a file path. When you add PostgreSQL support to your component, you&#039;ll add an extra line in each element to direct Joomla! to the correct files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,49,60-74&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;4.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;name&amp;gt;Hello World&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;December 2020&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Dummy author, feel free to replace anywhere you see it--&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;John Smith&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;https://smith.ca&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;John Smith&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GPL v3&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;0.0.7&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;&lt;br /&gt;
        A hello world component!&lt;br /&gt;
    &amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- This is the PHP namespace under which the extension&#039;s&lt;br /&gt;
    code is organised. It should follow this format:&lt;br /&gt;
    &lt;br /&gt;
    Vendor\Component\ComponentName&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Vendor&amp;quot; can be your company or your own name&lt;br /&gt;
    &lt;br /&gt;
    The &amp;quot;ComponentName&amp;quot; section MUST match the name used &lt;br /&gt;
    everywhere else for your component. Whatever the name of &lt;br /&gt;
    this XML file is, the namespace must match (ignoring CamelCase). &lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;namespace path=&amp;quot;src/&amp;quot;&amp;gt;JohnSmith\Component\HelloWorld&amp;lt;/namespace&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;files folder=&amp;quot;site/&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;src&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;languages&amp;gt;&lt;br /&gt;
        &amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;site/language/en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;/languages&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;administration&amp;gt;&lt;br /&gt;
        &amp;lt;!-- The link that will appear in the Admin panel&#039;s &amp;quot;Components&amp;quot; menu --&amp;gt;&lt;br /&gt;
        &amp;lt;menu link=&amp;quot;index.php?option=com_helloworld&amp;quot;&amp;gt;Hello World&amp;lt;/menu&amp;gt;&lt;br /&gt;
        &amp;lt;!-- List of files and folders to copy, and where to copy them --&amp;gt;&lt;br /&gt;
        &amp;lt;files folder=&amp;quot;admin/&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;services&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;src&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;languages&amp;gt;&lt;br /&gt;
            &amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;admin/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;admin/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;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;&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;&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;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing the Database Installation ==&lt;br /&gt;
&lt;br /&gt;
As always, zip up your new component version and upload it into your Joomla! install&#039;s admin panel. It should give you a message that installation has been successful. Nothing is actually using the table just now, so use your preferred database client to connect into your Joomla! database and check that the new table exists.&lt;br /&gt;
&lt;br /&gt;
Next, we&#039;ll start creating a back-end admin panel to create and manage our greeting records.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_Request_Variable_in_the_Menu_Link|Prev: Adding a Request Variable in the Menu Link|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Our First Backend Page|Next: Our First Back-end Page|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Joomla!_4.x]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
[[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>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User_talk:Krauthos&amp;diff=785711</id>
		<title>User talk:Krauthos</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User_talk:Krauthos&amp;diff=785711"/>
		<updated>2021-03-19T22:44:35Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hey man, thanks for your corrections on the Joomla 4 tutorial. I&#039;ll be continuing with the rest of it soon - there&#039;s a lot to get through! --[[User:GregJPreece|GregJPreece]] ([[User talk:GregJPreece|talk]]) 17:44, 19 March 2021 (CDT)&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User_talk:Krauthos&amp;diff=785710</id>
		<title>User talk:Krauthos</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User_talk:Krauthos&amp;diff=785710"/>
		<updated>2021-03-19T22:43:55Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Created page with &amp;quot;Hey man, thanks for your corrections on the Joomla 4 tutorial. I&amp;#039;ll be continuing with the rest of it soon - there&amp;#039;s a lot to get through!&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hey man, thanks for your corrections on the Joomla 4 tutorial. I&#039;ll be continuing with the rest of it soon - there&#039;s a lot to get through!&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x_talk:Developing_an_MVC_Component/Adding_a_Request_Variable_in_the_Menu_Link&amp;diff=779165</id>
		<title>J4.x talk:Developing an MVC Component/Adding a Request Variable in the Menu Link</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x_talk:Developing_an_MVC_Component/Adding_a_Request_Variable_in_the_Menu_Link&amp;diff=779165"/>
		<updated>2021-01-17T21:38:35Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Created page with &amp;quot;User:M-b-o| I appreciate the assist, but please don&amp;#039;t add language tagging yet. The text and titles of these pages are not yet finalised. Some of the old terminology was a...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[User:M-b-o|M-b-o]] I appreciate the assist, but please don&#039;t add language tagging yet. The text and titles of these pages are not yet finalised. Some of the old terminology was a bit clunky so terms might get shifted as I go along. I do intend to language-tag everything once the tutorial is complete.&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/en&amp;diff=779081</id>
		<title>Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!4.x - Contents/en</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!4.x_-_Contents/en&amp;diff=779081"/>
		<updated>2021-01-17T07:57:14Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: &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;div class=&amp;quot;large-4 columns&amp;quot; style=&amp;quot;float:right; background:#fff;margin:0 0 1.0em 1.0em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-12 columns panel radius mw-collapsible&amp;quot; style=&amp;quot;width:100%;background:#fff;font-size:.8em&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&#039;&#039;&#039;Articles in this Series&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-12 columns panel mw-collapsible-content&amp;quot; style=&amp;quot;border:none; background:#fff; min-width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Introduction|Introduction]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Developing a Basic Component]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_View_to_the_Site_Part|Adding a View to the Site Part]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_Menu_Type_to_the_Site_Part|Adding a Menu Type to the Site Part]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Language_Management|Language Management]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_Model_to_the_Site_Part|Adding a Model to the Site Part]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_Request_Variable_in_the_Menu_Link|Adding a Request Variable in the Menu Link]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{-}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials in a Series{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Adding_a_Request_Variable_in_the_Menu_Link&amp;diff=779080</id>
		<title>J4.x:Developing an MVC Component/Adding a Request Variable in the Menu Link</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Adding_a_Request_Variable_in_the_Menu_Link&amp;diff=779080"/>
		<updated>2021-01-17T07:56:00Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Created page with &amp;quot;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}} {{-}} {{Top portal heading|color=white-bkgd|icon=file-code-o|icon-color=#5091cd|size=5x|text-color=#333|title=Adding a Request...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}}&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=Adding a Request Variable to the Menu Link}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Notes/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
We now have a page in our Joomla installation&#039;s public front-end that can render a greeting message, provided by a data model. Now we will add a request variable to the menu link we created earlier, and learn how to read the request variable inside the data model. Depending on the value of the variable, we will show a different greeting.&lt;br /&gt;
&lt;br /&gt;
== Required Changes ==&lt;br /&gt;
&lt;br /&gt;
There are two primary changes we will need to make:&lt;br /&gt;
* Adding the request variable and its possible values to the menu link&#039;s XML definition&lt;br /&gt;
* Adding code to the model to read the request variable and choose an appropriate greeting&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
 | 1&lt;br /&gt;
 | Update: [[#site/tmpl/hello/default.xml|site/tmpl/hello/default.xml]]&lt;br /&gt;
 | Add the new parameter to the menu link&#039;s definition&lt;br /&gt;
 |-&lt;br /&gt;
 | 2&lt;br /&gt;
 | Update: [[#site/src/Model/MessageModel.php|site/src/Model/MessageModel.php]]&lt;br /&gt;
 | Have the view&#039;s data model decide which greeting to return&lt;br /&gt;
 |-&lt;br /&gt;
 | 3&lt;br /&gt;
 | Update: [[#admin/language/en-GB/en-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&lt;br /&gt;
 | Add the new language strings needed when configuring the menu link&lt;br /&gt;
 |-&lt;br /&gt;
 | 4&lt;br /&gt;
 | Update: [[#site/language/en-GB/en-GB.com_helloworld.ini|site/language/en-GB/en-GB.com_helloworld.ini]]&lt;br /&gt;
 | Swap our existing greeting string for two greetings we can choose between&lt;br /&gt;
 |-&lt;br /&gt;
 | 5&lt;br /&gt;
 | Update: [[#helloworld.xml|helloworld.xml]]&lt;br /&gt;
 | For consistency, we&#039;ll bump the component&#039;s version number&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== File Details ==&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/tmpl/hello/default.xml}}&lt;br /&gt;
&lt;br /&gt;
While this change may look fairly verbose, it&#039;s actually very straightforward. We&#039;re adding a configurable request variable (called a &amp;quot;field&amp;quot;) to our menu link. When editing the menu entry in the Joomla control panel, this field and its options will be displayed in the configuration form.&lt;br /&gt;
&lt;br /&gt;
Menu fields are organised into fieldsets, though we only need the one here. We&#039;ll call our field &amp;lt;tt&amp;gt;greetingType&amp;lt;/tt&amp;gt;, which will be appended to the URL when the link is clicked. We&#039;re also pre-defining what values are allowed for this field, as we want to be able to rely on their values in the data model. We do this by using &amp;lt;tt&amp;gt;type=&amp;quot;list&amp;quot;&amp;lt;/tt&amp;gt; to tell Joomla it has a list of values, and then providing them as &amp;lt;tt&amp;gt;&amp;lt;option /&amp;gt;&amp;lt;/tt&amp;gt; child elements.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt; attribute of each &amp;lt;tt&amp;gt;&amp;lt;option /&amp;gt;&amp;lt;/tt&amp;gt; is the actual value that will be appended to the URL (such as &amp;lt;tt&amp;gt;&amp;amp;greetingType=1&amp;lt;/tt&amp;gt;). The language string name inside the &amp;lt;tt&amp;gt;&amp;lt;option /&amp;gt;&amp;lt;/tt&amp;gt; element represents the label that will be shown in the configuration form.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;6-17&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_MENU_HELLO_WORLD_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;message&amp;gt;&amp;lt;![CDATA[COM_HELLOWORLD_MENU_HELLO_WORLD_DESC]]&amp;gt;&amp;lt;/message&amp;gt;&lt;br /&gt;
    &amp;lt;/layout&amp;gt;&lt;br /&gt;
    &amp;lt;fields name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;field  name=&amp;quot;greetingType&amp;quot;&lt;br /&gt;
                    type=&amp;quot;list&amp;quot;&lt;br /&gt;
                    label=&amp;quot;COM_HELLOWORLD_MENU_HELLO_WORLD_PARAM_LABEL&amp;quot;&lt;br /&gt;
                    description=&amp;quot;COM_HELLOWORLD_MENU_HELLO_WORLD_PARAM_DESC&amp;quot;&lt;br /&gt;
                    default=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;![CDATA[COM_HELLOWORLD_MENU_HELLO_WORLD_PARAM_VALUE_HELLO]]&amp;gt;&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;option value=&amp;quot;2&amp;quot;&amp;gt;&amp;lt;![CDATA[COM_HELLOWORLD_MENU_HELLO_WORLD_PARAM_VALUE_GOODBYE]]&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;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/src/Model/MessageModel.php}}&lt;br /&gt;
&lt;br /&gt;
Here we read in the new request variable via the Joomla framework, and decide which of our two greeting messages to show. This code illustrates how to read request variables in Joomla 4:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;tt&amp;gt;Factory::getApplication()&amp;lt;/tt&amp;gt; returns the Joomla application object. You will use this code a lot when writing in Joomla, as your entry point to the Joomla runtime.&lt;br /&gt;
# &amp;lt;tt&amp;gt;-&amp;gt;getInput()&amp;lt;/tt&amp;gt; returns the &amp;lt;tt&amp;gt;\Joomla\Input\Input&amp;lt;/tt&amp;gt; object for this request. This object can be used to read request variables in a safe and sanitised manner. &lt;br /&gt;
# &amp;lt;tt&amp;gt;$input-&amp;gt;getInt(&#039;greetingType&#039;, 1);&amp;lt;/tt&amp;gt; fetches the value of the &#039;greetingType&#039; request variable we defined earlier. If no value is defined, we have specified that it should return a default value of &amp;lt;tt&amp;gt;1&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You should never use superglobals like &amp;lt;tt&amp;gt;$_GET&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;$_POST&amp;lt;/tt&amp;gt; to access request variables or other inputs. Use Joomla&#039;s framework to access any passed or submitted data, to ensure that it is properly handled and sanitised.&lt;br /&gt;
&lt;br /&gt;
With the request variable read, we simply choose which of our two possible greetings to return to the template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;7,31-34,37-45&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
namespace JohnSmith\Component\HelloWorld\Site\Model;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Factory;&lt;br /&gt;
use Joomla\CMS\MVC\Model\ItemModel;&lt;br /&gt;
use Joomla\CMS\Language\Text;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Site&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello World Message Model&lt;br /&gt;
 * @since 0.0.5&lt;br /&gt;
 */&lt;br /&gt;
class MessageModel extends ItemModel {&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Returns a message for display&lt;br /&gt;
     * @param integer $pk Primary key of the &amp;quot;message item&amp;quot;, currently unused&lt;br /&gt;
     * @return object Message object&lt;br /&gt;
     */&lt;br /&gt;
    public function getItem($pk= null): object {&lt;br /&gt;
        // This gives us a Joomla\Input\Input object&lt;br /&gt;
        $input = Factory::getApplication()-&amp;gt;getInput();&lt;br /&gt;
        $greetingType = $input-&amp;gt;getInt(&#039;greetingType&#039;, 1);&lt;br /&gt;
&lt;br /&gt;
        $item = new \stdClass();&lt;br /&gt;
        &lt;br /&gt;
        switch($greetingType) {&lt;br /&gt;
            case 2:&lt;br /&gt;
                $item-&amp;gt;message = Text::_(&#039;COM_HELLOWORLD_MSG_GREETING_GOODBYE&#039;);&lt;br /&gt;
                break;&lt;br /&gt;
            case 1:&lt;br /&gt;
            default:&lt;br /&gt;
                $item-&amp;gt;message = Text::_(&#039;COM_HELLOWORLD_MSG_GREETING_HELLO&#039;);&lt;br /&gt;
                break;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        return $item;&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|admin/language/en-GB/en-GB.com_helloworld.sys.ini}}&lt;br /&gt;
&lt;br /&gt;
Here we define the language strings that will be used in the configuration form for our menu link. Remember, even though the menu link is defined in the site part of the component, the strings are defined here because it is used in the Joomla control panel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot; highlight=&amp;quot;6-9&amp;quot;&amp;gt;&lt;br /&gt;
; Hello World Sys.ini&lt;br /&gt;
; Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
&lt;br /&gt;
COM_HELLOWORLD_MENU_HELLO_WORLD_TITLE=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MENU_HELLO_WORLD_DESC=&amp;quot;My first Joomla! page&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MENU_HELLO_WORLD_PARAM_LABEL=&amp;quot;Greeting Type&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MENU_HELLO_WORLD_PARAM_DESC=&amp;quot;Select which type of greeting to show&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MENU_HELLO_WORLD_PARAM_VALUE_HELLO=&amp;quot;Say Hello&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MENU_HELLO_WORLD_PARAM_VALUE_GOODBYE=&amp;quot;Say Goodbye&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/language/en-GB/en-GB.com_helloworld.ini}}&lt;br /&gt;
&lt;br /&gt;
Here we switch out our existing greeting for two different greetings, which the model will choose between based on the value of the &amp;lt;tt&amp;gt;greetingType&amp;lt;/tt&amp;gt; request variable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot; highlight=&amp;quot;5-6&amp;quot;&amp;gt;&lt;br /&gt;
; Hello World Public Site Strings&lt;br /&gt;
; Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
&lt;br /&gt;
COM_HELLOWORLD_MSG_HELLO_WORLD=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MSG_GREETING_GOODBYE=&amp;quot;Goodbye from the item model!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MSG_GREETING_HELLO=&amp;quot;Hello from the item model!&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|helloworld.xml}}&lt;br /&gt;
&lt;br /&gt;
As before, our last job is to bump the component&#039;s version number. None of the changes made here require the version number to be bumped before re-importing it, but we&#039;ll do it for consistency.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13&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;4.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;name&amp;gt;Hello World&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;December 2020&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Dummy author, feel free to replace anywhere you see it--&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;John Smith&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;https://smith.ca&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;John Smith&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GPL v3&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;0.0.6&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;&lt;br /&gt;
        A hello world component!&lt;br /&gt;
    &amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- This is the PHP namespace under which the extension&#039;s&lt;br /&gt;
    code is organised. It should follow this format:&lt;br /&gt;
    &lt;br /&gt;
    Vendor\Component\ComponentName&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Vendor&amp;quot; can be your company or your own name&lt;br /&gt;
    &lt;br /&gt;
    The &amp;quot;ComponentName&amp;quot; section MUST match the name used &lt;br /&gt;
    everywhere else for your component. Whatever the name of &lt;br /&gt;
    this XML file is, the namespace must match (ignoring CamelCase). &lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;namespace path=&amp;quot;src/&amp;quot;&amp;gt;JohnSmith\Component\HelloWorld&amp;lt;/namespace&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;files folder=&amp;quot;site/&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;src&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;languages&amp;gt;&lt;br /&gt;
        &amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;site/language/en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;/languages&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;administration&amp;gt;&lt;br /&gt;
        &amp;lt;!-- The link that will appear in the Admin panel&#039;s &amp;quot;Components&amp;quot; menu --&amp;gt;&lt;br /&gt;
        &amp;lt;menu link=&amp;quot;index.php?option=com_helloworld&amp;quot;&amp;gt;Hello World&amp;lt;/menu&amp;gt;&lt;br /&gt;
        &amp;lt;!-- List of files and folders to copy, and where to copy them --&amp;gt;&lt;br /&gt;
        &amp;lt;files folder=&amp;quot;admin/&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;services&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;src&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;languages&amp;gt;&lt;br /&gt;
            &amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;admin/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;admin/language/en-GB/en-GB.com_helloworld.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
        &amp;lt;/languages&amp;gt;&lt;br /&gt;
    &amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing the Extension ==&lt;br /&gt;
&lt;br /&gt;
Just as before, zip up your new component version and upload it into your Joomla! install&#039;s admin panel. Once it has updated, open the main menu setup from the left menu as you did before, then click your &amp;quot;Hello World&amp;quot; link in the list of link on the right.&lt;br /&gt;
&lt;br /&gt;
[[File:Joomla 4.x Component Tutorial 0.0.6 Main Menu Link.png|frameless|Link to the main menu configuration in the Joomla control panel]]&lt;br /&gt;
&lt;br /&gt;
You should see the menu link configuration form once again, but now there should be a brand new drop-down selection box:&lt;br /&gt;
&lt;br /&gt;
[[File:Joomla 4.x Component Tutorial 0.0.6 Menu Link Configuration.png|frameless|Menu link configuration with custom fields added]]&lt;br /&gt;
&lt;br /&gt;
Here you can see our new configuration option, &amp;quot;Greeting Type&amp;quot;. This is the field we defined in XML earlier, using the language strings we also defined. To test your change, select one of the possible greeting types and save the menu link. Once the link is saved, visit the public section of your Joomla install and click the link. You should see the appropriate greeting!&lt;br /&gt;
&lt;br /&gt;
[[File:Joomla 4.x Component Tutorial 0.0.6 Message from Model.png|frameless|The greeting from the data model that matches the field in the menu link]]&lt;br /&gt;
&lt;br /&gt;
To make sure that the request variable is working correctly, make sure to switch the menu link&#039;s configuration back and forth a few times. The message in the public page should change as appropriate.&lt;br /&gt;
&lt;br /&gt;
Great! Now we have a page taking simple data from a model, &#039;&#039;and&#039;&#039; that model can respond to request variables. Next, we&#039;ll finally get to setting up our database, and wiring our data model up to it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_Model_to_the_Site_Part|Prev: Adding a Model to the Site Part|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Setting_up_the_Database|Next: Setting up the Database|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Joomla!_4.x]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
[[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>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=File:Joomla_4.x_Component_Tutorial_0.0.6_Main_Menu_Link.png&amp;diff=779079</id>
		<title>File:Joomla 4.x Component Tutorial 0.0.6 Main Menu Link.png</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=File:Joomla_4.x_Component_Tutorial_0.0.6_Main_Menu_Link.png&amp;diff=779079"/>
		<updated>2021-01-17T07:55:30Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Link to the main menu configuration in the Joomla control panel&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=File:Joomla_4.x_Component_Tutorial_0.0.6_Message_from_Model.png&amp;diff=779078</id>
		<title>File:Joomla 4.x Component Tutorial 0.0.6 Message from Model.png</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=File:Joomla_4.x_Component_Tutorial_0.0.6_Message_from_Model.png&amp;diff=779078"/>
		<updated>2021-01-17T07:45:53Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A message from the view&#039;s data model, switched according to a field supplied in the menu link&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=File:Joomla_4.x_Component_Tutorial_0.0.6_Menu_Link_Configuration.png&amp;diff=779077</id>
		<title>File:Joomla 4.x Component Tutorial 0.0.6 Menu Link Configuration.png</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=File:Joomla_4.x_Component_Tutorial_0.0.6_Menu_Link_Configuration.png&amp;diff=779077"/>
		<updated>2021-01-17T07:40:47Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Menu link configuration with custom fields added&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Adding_a_Model_to_the_Site_Part&amp;diff=779038</id>
		<title>J4.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=J4.x:Developing_an_MVC_Component/Adding_a_Model_to_the_Site_Part&amp;diff=779038"/>
		<updated>2021-01-17T04:05:35Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Updating the previously used tutorial language to parse better - may need to update elsewhere&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}}&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=Adding a Model to the Site Part}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Notes/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Now that we have the &amp;quot;Controller&amp;quot; and &amp;quot;View&amp;quot; portions of the Model-View-Controller design pattern in place, in this article we will add a model to our Hello World component. The model will hold some sample data for our template to render. To create a model we extend one of the abstract models provided by Joomla! Several such models exist, and can be found in the &amp;lt;tt&amp;gt;Joomla\CMS\MVC\Model&amp;lt;/tt&amp;gt; namespace:&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
 | 1&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Joomla\CMS\MVC\Model\AdminModel&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Despite its name, this model is not actually specific to the admin panel section of Joomla! It is actually for administering records of a particular type, allowing for batch update/delete operations, etc.&lt;br /&gt;
 |-&lt;br /&gt;
 | 2&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Joomla\CMS\MVC\Model\BaseModel&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | The basic model from which other models inherit. If you don&#039;t require any additional functionality you can extend this model, but you likely don&#039;t want to.&lt;br /&gt;
 |-&lt;br /&gt;
 | 3&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Joomla\CMS\MVC\Model\FormModel&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Used in forms, allows for rows to be checked in or out for editing, and has methods for validation of form inputs.&lt;br /&gt;
 |-&lt;br /&gt;
 | 4&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Joomla\CMS\MVC\Model\ItemModel&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Represents a single database record, allows for basic database operations.&lt;br /&gt;
 |-&lt;br /&gt;
 | 5&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Joomla\CMS\MVC\Model\ListModel&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Used to display paginated lists of records, with optional filtering.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
Later in the tutorial we will back this model with a database query, so we&#039;re going to use &amp;lt;tt&amp;gt;ItemModel&amp;lt;/tt&amp;gt; as the base for our new model class. Let&#039;s go ahead and create the new files we will need to add our model.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
 | 1&lt;br /&gt;
 | Update: &amp;lt;tt&amp;gt;[[#site/language/en-GB/en-GB.com_helloworld.ini|site/language/en-GB/en-GB.com_helloworld.ini]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | We&#039;ll add a new message to pull from the language system, to verify that our model is working&lt;br /&gt;
 |-&lt;br /&gt;
 | 2&lt;br /&gt;
 | Create: &amp;lt;tt&amp;gt;[[#site/src/Model/MessageModel.php|site/src/Model/MessageModel.php]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Our new model, which will hold a message for display in the public web page&lt;br /&gt;
 |-&lt;br /&gt;
 | 3&lt;br /&gt;
 | Update: &amp;lt;tt&amp;gt;[[#site/src/Controller/DisplayController.php|site/src/Controller/DisplayController.php]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | We&#039;ll tell the default display controller to fetch the new model&lt;br /&gt;
 |-&lt;br /&gt;
 | 4&lt;br /&gt;
 | Update: &amp;lt;tt&amp;gt;[[#site/tmpl/hello/default.php|site/tmpl/hello/default.php]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | We&#039;ll add an output in the template to show the message from the model&lt;br /&gt;
 |-&lt;br /&gt;
 | 5&lt;br /&gt;
 | Update: &amp;lt;tt&amp;gt;[[#helloworld.xml|helloworld.xml]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | A simple version bump, for our new code&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== File Details ==&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/language/en-GB/en-GB.com_helloworld.ini}}&lt;br /&gt;
&lt;br /&gt;
We&#039;ll (temporarily) put a new message in here that we can use to demo the model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot; highlight=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
; Hello World Admin Strings&lt;br /&gt;
; Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
&lt;br /&gt;
COM_HELLOWORLD_MSG_HELLO_WORLD=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MSG_GREETING=&amp;quot;This message is coming from the item model!&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/src/Model/MessageModel.php}}&lt;br /&gt;
&lt;br /&gt;
The new single-item data model. The &amp;lt;tt&amp;gt;getItem()&amp;lt;/tt&amp;gt; method is the only one required when extending &amp;lt;tt&amp;gt;ItemModel&amp;lt;/tt&amp;gt;. It returns an object that represents the model&#039;s item. This &amp;quot;item&amp;quot; could be anything, but is usually a database record. Until we hook this model up to the database in a future part of the tutorial, we will return a basic object with our new message in it, straight from the language system. &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;
namespace JohnSmith\Component\HelloWorld\Site\Model;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\MVC\Model\ItemModel;&lt;br /&gt;
use Joomla\CMS\Language\Text;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Site&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello World Message Model&lt;br /&gt;
 * @since 0.0.5&lt;br /&gt;
 */&lt;br /&gt;
class MessageModel extends ItemModel {&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Returns a message for display&lt;br /&gt;
     * @param integer $pk Primary key of the &amp;quot;message item&amp;quot;, currently unused&lt;br /&gt;
     * @return object Message object&lt;br /&gt;
     */&lt;br /&gt;
    public function getItem($pk= null): object {&lt;br /&gt;
        $item = new \stdClass();&lt;br /&gt;
        $item-&amp;gt;message = Text::_(&#039;COM_HELLOWORLD_MSG_GREETING&#039;);&lt;br /&gt;
        return $item;&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/src/Controller/DisplayController.php}}&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to tell the &amp;lt;tt&amp;gt;DisplayController&amp;lt;/tt&amp;gt; to add our new model to the view as it is being loaded. As we currently have only one view, this will do for now. As our component becomes more complex, our views will gain their own controllers, and can load their own models independently.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;30&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
namespace JohnSmith\Component\HelloWorld\Site\Controller;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\MVC\Controller\BaseController;&lt;br /&gt;
use Joomla\CMS\Factory;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Site&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Component Controller&lt;br /&gt;
 * @since  0.0.2&lt;br /&gt;
 */&lt;br /&gt;
class DisplayController extends BaseController {&lt;br /&gt;
    &lt;br /&gt;
    public function display($cachable = false, $urlparams = array()) {        &lt;br /&gt;
        $document = Factory::getDocument();&lt;br /&gt;
        $viewName = $this-&amp;gt;input-&amp;gt;getCmd(&#039;view&#039;, &#039;login&#039;);&lt;br /&gt;
        $viewFormat = $document-&amp;gt;getType();&lt;br /&gt;
        &lt;br /&gt;
        $view = $this-&amp;gt;getView($viewName, $viewFormat);&lt;br /&gt;
        $view-&amp;gt;setModel($this-&amp;gt;getModel(&#039;Message&#039;), true);&lt;br /&gt;
        &lt;br /&gt;
        $view-&amp;gt;document = $document;&lt;br /&gt;
        $view-&amp;gt;display();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/tmpl/hello/default.php}}&lt;br /&gt;
&lt;br /&gt;
The last functional change to make is to add the message output into our site template. In the context of a component template, the &amp;lt;tt&amp;gt;$this&amp;lt;/tt&amp;gt; variable refers to the view object. Remember setting the model on the view in the previous file? We retrieve it here, and display the message.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;18&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Language\Text;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted Access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&amp;lt;?= Text::_(&#039;COM_HELLOWORLD_MSG_HELLO_WORLD&#039;) ?&amp;gt;&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;?= $this-&amp;gt;getModel()-&amp;gt;getItem()-&amp;gt;message; ?&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|helloworld.xml}}&lt;br /&gt;
&lt;br /&gt;
There&#039;s nothing new needed in the manifest file for these changes, so this update isn&#039;t technically required. However, for consistency, we will bump the component&#039;s version in the manifest file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13&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;4.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;name&amp;gt;Hello World&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;December 2020&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Dummy author, feel free to replace anywhere you see it--&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;John Smith&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;https://smith.ca&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;John Smith&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GPL v3&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;0.0.5&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;&lt;br /&gt;
        A hello world component!&lt;br /&gt;
    &amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- This is the PHP namespace under which the extension&#039;s&lt;br /&gt;
    code is organised. It should follow this format:&lt;br /&gt;
    &lt;br /&gt;
    Vendor\Component\ComponentName&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Vendor&amp;quot; can be your company or your own name&lt;br /&gt;
    &lt;br /&gt;
    The &amp;quot;ComponentName&amp;quot; section MUST match the name used &lt;br /&gt;
    everywhere else for your component. Whatever the name of &lt;br /&gt;
    this XML file is, the namespace must match (ignoring CamelCase). &lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;namespace path=&amp;quot;src/&amp;quot;&amp;gt;JohnSmith\Component\HelloWorld&amp;lt;/namespace&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;files folder=&amp;quot;site/&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;src&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;languages&amp;gt;&lt;br /&gt;
        &amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;site/language/en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;/languages&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;administration&amp;gt;&lt;br /&gt;
        &amp;lt;!-- The link that will appear in the Admin panel&#039;s &amp;quot;Components&amp;quot; menu --&amp;gt;&lt;br /&gt;
        &amp;lt;menu link=&amp;quot;index.php?option=com_helloworld&amp;quot;&amp;gt;Hello World&amp;lt;/menu&amp;gt;&lt;br /&gt;
        &amp;lt;!-- List of files and folders to copy, and where to copy them --&amp;gt;&lt;br /&gt;
        &amp;lt;files folder=&amp;quot;admin/&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;services&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;src&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;languages&amp;gt;&lt;br /&gt;
            &amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;admin/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;admin/language/en-GB/en-GB.com_helloworld.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
        &amp;lt;/languages&amp;gt;&lt;br /&gt;
    &amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing the Component ==&lt;br /&gt;
&lt;br /&gt;
Just as before, zip up your new component version and upload it into your Joomla! install&#039;s admin panel. Once you have done so, go to the front-end of your Joomla site. Click the &amp;quot;Hello World&amp;quot; link we created in the menu. You should see the new message in the page template.&lt;br /&gt;
&lt;br /&gt;
[[File:Joomla 4.x Component Tutorial 0.0.5 Message from Model.png|frameless|The new language string, being passed to the template from the new model]]&lt;br /&gt;
&lt;br /&gt;
Next, we&#039;ll learn how to add parameters to menu items, and how to read them within the code. After that, we&#039;ll start wiring our component up to the database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Language_Management|Prev: Language Management|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_Request_Variable_in_the_Menu_Link|Next: Adding a Request Variable in the Menu Link|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Joomla!_4.x]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
[[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>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/en&amp;diff=778886</id>
		<title>Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!4.x - Contents/en</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!4.x_-_Contents/en&amp;diff=778886"/>
		<updated>2021-01-16T05:12:20Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: &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;div class=&amp;quot;large-4 columns&amp;quot; style=&amp;quot;float:right; background:#fff;margin:0 0 1.0em 1.0em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-12 columns panel radius mw-collapsible&amp;quot; style=&amp;quot;width:100%;background:#fff;font-size:.8em&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&#039;&#039;&#039;Articles in this Series&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-12 columns panel mw-collapsible-content&amp;quot; style=&amp;quot;border:none; background:#fff; min-width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Introduction|Introduction]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Developing a Basic Component]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_View_to_the_Site_Part|Adding a View to the Site Part]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_Menu_Type_to_the_Site_Part|Adding a Menu Type to the Site Part]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Language_Management|Language Management]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_Model_to_the_Site_Part|Adding a Model to the Site Part]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{-}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials in a Series{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Adding_a_Model_to_the_Site_Part&amp;diff=778885</id>
		<title>J4.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=J4.x:Developing_an_MVC_Component/Adding_a_Model_to_the_Site_Part&amp;diff=778885"/>
		<updated>2021-01-16T05:08:46Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Created page with &amp;quot;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}} {{-}} {{Top portal heading|color=white-bkgd|icon=file-code-o|icon-color=#5091cd|size=5x|text-color=#333|title=Adding a Model t...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}}&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=Adding a Model to the Site Part}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Notes/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Now that we have the &amp;quot;Controller&amp;quot; and &amp;quot;View&amp;quot; portions of the Model-View-Controller design pattern in place, in this article we will add a model to our Hello World component. The model will hold some sample data for our template to render. To create a model we extend one of the abstract models provided by Joomla! Several such models exist, and can be found in the &amp;lt;tt&amp;gt;Joomla\CMS\MVC\Model&amp;lt;/tt&amp;gt; namespace:&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
 | 1&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Joomla\CMS\MVC\Model\AdminModel&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Despite its name, this model is not actually specific to the admin panel section of Joomla! It is actually for administering records of a particular type, allowing for batch update/delete operations, etc.&lt;br /&gt;
 |-&lt;br /&gt;
 | 2&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Joomla\CMS\MVC\Model\BaseModel&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | The basic model from which other models inherit. If you don&#039;t require any additional functionality you can extend this model, but you likely don&#039;t want to.&lt;br /&gt;
 |-&lt;br /&gt;
 | 3&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Joomla\CMS\MVC\Model\FormModel&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Used in forms, allows for rows to be checked in or out for editing, and has methods for validation of form inputs.&lt;br /&gt;
 |-&lt;br /&gt;
 | 4&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Joomla\CMS\MVC\Model\ItemModel&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Represents a single database record, allows for basic database operations.&lt;br /&gt;
 |-&lt;br /&gt;
 | 5&lt;br /&gt;
 | &amp;lt;tt&amp;gt;Joomla\CMS\MVC\Model\ListModel&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Used to display paginated lists of records, with optional filtering.&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
Later in the tutorial we will back this model with a database query, so we&#039;re going to use &amp;lt;tt&amp;gt;ItemModel&amp;lt;/tt&amp;gt; as the base for our new model class. Let&#039;s go ahead and create the new files we will need to add our model.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
 | 1&lt;br /&gt;
 | Update: &amp;lt;tt&amp;gt;[[#site/language/en-GB/en-GB.com_helloworld.ini|site/language/en-GB/en-GB.com_helloworld.ini]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | We&#039;ll add a new message to pull from the language system, to verify that our model is working&lt;br /&gt;
 |-&lt;br /&gt;
 | 2&lt;br /&gt;
 | Create: &amp;lt;tt&amp;gt;[[#site/src/Model/MessageModel.php|site/src/Model/MessageModel.php]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Our new model, which will hold a message for display in the public web page&lt;br /&gt;
 |-&lt;br /&gt;
 | 3&lt;br /&gt;
 | Update: &amp;lt;tt&amp;gt;[[#site/src/Controller/DisplayController.php|site/src/Controller/DisplayController.php]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | We&#039;ll tell the default display controller to fetch the new model&lt;br /&gt;
 |-&lt;br /&gt;
 | 4&lt;br /&gt;
 | Update: &amp;lt;tt&amp;gt;[[#site/tmpl/hello/default.php|site/tmpl/hello/default.php]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | We&#039;ll add an output in the template to show the message from the model&lt;br /&gt;
 |-&lt;br /&gt;
 | 5&lt;br /&gt;
 | Update: &amp;lt;tt&amp;gt;[[#helloworld.xml|helloworld.xml]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | A simple version bump, for our new code&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== File Details ==&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/language/en-GB/en-GB.com_helloworld.ini}}&lt;br /&gt;
&lt;br /&gt;
We&#039;ll (temporarily) put a new message in here that we can use to demo the model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot; highlight=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
; Hello World Admin Strings&lt;br /&gt;
; Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
&lt;br /&gt;
COM_HELLOWORLD_MSG_HELLO_WORLD=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MSG_GREETING=&amp;quot;This message is coming from the item model!&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/src/Model/MessageModel.php}}&lt;br /&gt;
&lt;br /&gt;
The new single-item data model. The &amp;lt;tt&amp;gt;getItem()&amp;lt;/tt&amp;gt; method is the only one required when extending &amp;lt;tt&amp;gt;ItemModel&amp;lt;/tt&amp;gt;. It returns an object that represents the model&#039;s item. This &amp;quot;item&amp;quot; could be anything, but is usually a database record. Until we hook this model up to the database in a future part of the tutorial, we will return a basic object with our new message in it, straight from the language system. &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;
namespace JohnSmith\Component\HelloWorld\Site\Model;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\MVC\Model\ItemModel;&lt;br /&gt;
use Joomla\CMS\Language\Text;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Site&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello World Message Model&lt;br /&gt;
 * @since 0.0.5&lt;br /&gt;
 */&lt;br /&gt;
class MessageModel extends ItemModel {&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Returns a message for display&lt;br /&gt;
     * @param integer $pk Primary key of the &amp;quot;message item&amp;quot;, currently unused&lt;br /&gt;
     * @return object Message object&lt;br /&gt;
     */&lt;br /&gt;
    public function getItem($pk= null): object {&lt;br /&gt;
        $item = new \stdClass();&lt;br /&gt;
        $item-&amp;gt;message = Text::_(&#039;COM_HELLOWORLD_MSG_GREETING&#039;);&lt;br /&gt;
        return $item;&lt;br /&gt;
    }&lt;br /&gt;
        &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/src/Controller/DisplayController.php}}&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to tell the &amp;lt;tt&amp;gt;DisplayController&amp;lt;/tt&amp;gt; to add our new model to the view as it is being loaded. As we currently have only one view, this will do for now. As our component becomes more complex, our views will gain their own controllers, and can load their own models independently.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;30&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
namespace JohnSmith\Component\HelloWorld\Site\Controller;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\MVC\Controller\BaseController;&lt;br /&gt;
use Joomla\CMS\Factory;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Site&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Component Controller&lt;br /&gt;
 * @since  0.0.2&lt;br /&gt;
 */&lt;br /&gt;
class DisplayController extends BaseController {&lt;br /&gt;
    &lt;br /&gt;
    public function display($cachable = false, $urlparams = array()) {        &lt;br /&gt;
        $document = Factory::getDocument();&lt;br /&gt;
        $viewName = $this-&amp;gt;input-&amp;gt;getCmd(&#039;view&#039;, &#039;login&#039;);&lt;br /&gt;
        $viewFormat = $document-&amp;gt;getType();&lt;br /&gt;
        &lt;br /&gt;
        $view = $this-&amp;gt;getView($viewName, $viewFormat);&lt;br /&gt;
        $view-&amp;gt;setModel($this-&amp;gt;getModel(&#039;Message&#039;), true);&lt;br /&gt;
        &lt;br /&gt;
        $view-&amp;gt;document = $document;&lt;br /&gt;
        $view-&amp;gt;display();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/tmpl/hello/default.php}}&lt;br /&gt;
&lt;br /&gt;
The last functional change to make is to add the message output into our site template. In the context of a component template, the &amp;lt;tt&amp;gt;$this&amp;lt;/tt&amp;gt; variable refers to the view object. Remember setting the model on the view in the previous file? We retrieve it here, and display the message.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;18&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Language\Text;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted Access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&amp;lt;?= Text::_(&#039;COM_HELLOWORLD_MSG_HELLO_WORLD&#039;) ?&amp;gt;&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;?= $this-&amp;gt;getModel()-&amp;gt;getItem()-&amp;gt;message; ?&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|helloworld.xml}}&lt;br /&gt;
&lt;br /&gt;
There&#039;s nothing new needed in the manifest file for these changes, so this update isn&#039;t technically required. However, for consistency, we will bump the component&#039;s version in the manifest file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13&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;4.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;name&amp;gt;Hello World&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;December 2020&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Dummy author, feel free to replace anywhere you see it--&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;John Smith&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;https://smith.ca&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;John Smith&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GPL v3&amp;lt;/license&amp;gt;&lt;br /&gt;
    &amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
    &amp;lt;version&amp;gt;0.0.5&amp;lt;/version&amp;gt;&lt;br /&gt;
    &amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;&lt;br /&gt;
        A hello world component!&lt;br /&gt;
    &amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- This is the PHP namespace under which the extension&#039;s&lt;br /&gt;
    code is organised. It should follow this format:&lt;br /&gt;
    &lt;br /&gt;
    Vendor\Component\ComponentName&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Vendor&amp;quot; can be your company or your own name&lt;br /&gt;
    &lt;br /&gt;
    The &amp;quot;ComponentName&amp;quot; section MUST match the name used &lt;br /&gt;
    everywhere else for your component. Whatever the name of &lt;br /&gt;
    this XML file is, the namespace must match (ignoring CamelCase). &lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;namespace path=&amp;quot;src/&amp;quot;&amp;gt;JohnSmith\Component\HelloWorld&amp;lt;/namespace&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;files folder=&amp;quot;site/&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;src&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;languages&amp;gt;&lt;br /&gt;
        &amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;site/language/en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;/languages&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;administration&amp;gt;&lt;br /&gt;
        &amp;lt;!-- The link that will appear in the Admin panel&#039;s &amp;quot;Components&amp;quot; menu --&amp;gt;&lt;br /&gt;
        &amp;lt;menu link=&amp;quot;index.php?option=com_helloworld&amp;quot;&amp;gt;Hello World&amp;lt;/menu&amp;gt;&lt;br /&gt;
        &amp;lt;!-- List of files and folders to copy, and where to copy them --&amp;gt;&lt;br /&gt;
        &amp;lt;files folder=&amp;quot;admin/&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;services&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;src&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;languages&amp;gt;&lt;br /&gt;
            &amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;admin/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;admin/language/en-GB/en-GB.com_helloworld.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
        &amp;lt;/languages&amp;gt;&lt;br /&gt;
    &amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing the Component ==&lt;br /&gt;
&lt;br /&gt;
Just as before, zip up your new component version and upload it into your Joomla! install&#039;s admin panel. Once you have done so, go to the front-end of your Joomla site. Click the &amp;quot;Hello World&amp;quot; link we created in the menu. You should see the new message in the page template.&lt;br /&gt;
&lt;br /&gt;
[[File:Joomla 4.x Component Tutorial 0.0.5 Message from Model.png|frameless|The new language string, being passed to the template from the new model]]&lt;br /&gt;
&lt;br /&gt;
Next, we&#039;ll learn how to add parameters to menu items, and how to read them within the code. After that, we&#039;ll start wiring our component up to the database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Language_Management|Prev: Language Management|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_Variable_Request_in_the_Menu_Type|Next: Adding a Variable Request in the Menu Type|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Joomla!_4.x]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
[[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>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=File:Joomla_4.x_Component_Tutorial_0.0.5_Message_from_Model.png&amp;diff=778884</id>
		<title>File:Joomla 4.x Component Tutorial 0.0.5 Message from Model.png</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=File:Joomla_4.x_Component_Tutorial_0.0.5_Message_from_Model.png&amp;diff=778884"/>
		<updated>2021-01-16T05:01:17Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A screenshot of the message string coming from the model added in this stage.&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/en&amp;diff=771649</id>
		<title>Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!4.x - Contents/en</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!4.x_-_Contents/en&amp;diff=771649"/>
		<updated>2020-12-17T07:22:26Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: &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;div class=&amp;quot;large-4 columns&amp;quot; style=&amp;quot;float:right; background:#fff;margin:0 0 1.0em 1.0em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-12 columns panel radius mw-collapsible&amp;quot; style=&amp;quot;width:100%;background:#fff;font-size:.8em&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&#039;&#039;&#039;Articles in this Series&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-12 columns panel mw-collapsible-content&amp;quot; style=&amp;quot;border:none; background:#fff; min-width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Introduction|Introduction]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Developing a Basic Component]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_View_to_the_Site_Part|Adding a View to the Site Part]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_Menu_Type_to_the_Site_Part|Adding a Menu Type to the Site Part]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Language_Management|Language Management]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{-}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials in a Series{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Language_Management&amp;diff=771648</id>
		<title>J4.x:Developing an MVC Component/Language Management</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Language_Management&amp;diff=771648"/>
		<updated>2020-12-17T07:20:49Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Created page with &amp;quot;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}} {{-}} {{Top portal heading|color=white-bkgd|icon=file-code-o|icon-color=#5091cd|size=5x|text-color=#333|title=Adding Language...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}}&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=Adding Language Management}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Notes/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Basic Language Management ==&lt;br /&gt;
&lt;br /&gt;
In this article we will add management for language strings to our new component. You may have noticed in the last article in this tutorial series that when we added a menu link to the component, we hard-coded English words into the link:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;3,4&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;Hello World!&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;message&amp;gt;&amp;lt;![CDATA[My first Joomla! page]]&amp;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;
&lt;br /&gt;
This works as an initial test, but hard-coding a single language into the system is a bad idea. Before we get too far into building pages and forms, we should add multi-language support to the component. &lt;br /&gt;
&lt;br /&gt;
Even if you do not personally have the resources to perform translations yourself, we &#039;&#039;&#039;&#039;&#039;highly recommend&#039;&#039;&#039;&#039;&#039; that you are diligent about correctly managing your language strings inside your component. Open source components can be translated by members of the community, and end users can create their own if they so wish.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s create the language files and update the manifest to reference them:&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
 | 1&lt;br /&gt;
 | Create: &amp;lt;tt&amp;gt;[[#admin/language/en-GB/en-GB.com_helloworld.ini|admin/language/en-GB/en-GB.com_helloworld.ini]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Component language strings for the admin panel part&lt;br /&gt;
 |-&lt;br /&gt;
 | 2&lt;br /&gt;
 | Create: &amp;lt;tt&amp;gt;[[#admin/language/en-GB/en-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | System language strings for the component&lt;br /&gt;
 |-&lt;br /&gt;
 | 3&lt;br /&gt;
 | Create: &amp;lt;tt&amp;gt;[[#site/language/en-GB/en-GB.com_helloworld.ini|site/language/en-GB/en-GB.com_helloworld.ini]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Component language strings for the public site part&lt;br /&gt;
 |-&lt;br /&gt;
 | 4&lt;br /&gt;
 | Update: &amp;lt;tt&amp;gt;[[#helloworld.xml|helloworld.xml]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Need to add the language files to the manifest&lt;br /&gt;
 |-&lt;br /&gt;
 | 5&lt;br /&gt;
 | Update: &amp;lt;tt&amp;gt;[[#admin/tmpl/hello/default.php|admin/tmpl/hello/default.php]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Swap hard-coded language strings for language codes&lt;br /&gt;
 |-&lt;br /&gt;
 | 6&lt;br /&gt;
 | Update: &amp;lt;tt&amp;gt;[[#site/tmpl/hello/default.php|site/tmpl/hello/default.php]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Swap hard-coded language strings for language codes&lt;br /&gt;
 |-&lt;br /&gt;
 | 7&lt;br /&gt;
 | Update: &amp;lt;tt&amp;gt;[[#site/tmpl/hello/default.xml|site/tmpl/hello/default.xml]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
 | Swap hard-coded language strings for language codes&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== File Details ==&lt;br /&gt;
&lt;br /&gt;
{{vanchor|admin/language/en-GB/en-GB.com_helloworld.ini}}&lt;br /&gt;
&lt;br /&gt;
This file contains the language strings used on the component&#039;s pages inside the admin panel of Joomla!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
; Hello World Admin Strings&lt;br /&gt;
; Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
&lt;br /&gt;
COM_HELLOWORLD_MSG_HELLO_WORLD=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|admin/language/en-GB/en-GB.com_helloworld.sys.ini}}&lt;br /&gt;
&lt;br /&gt;
This file contains the language strings used in Joomla! systems outside the component&#039;s own pages. For example, our menu item&#039;s strings belong to this component, but are used by the Joomla! menu system rather than on our own pages, so they belong in this file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
; Hello World Sys.ini&lt;br /&gt;
; Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
&lt;br /&gt;
COM_HELLOWORLD_MENU_HELLO_WORLD_TITLE=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
COM_HELLOWORLD_MENU_HELLO_WORLD_DESC=&amp;quot;My first Joomla! page&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/language/en-GB/en-GB.com_helloworld.ini}}&lt;br /&gt;
&lt;br /&gt;
This file contains the language strings used on the component&#039;s &amp;quot;public&amp;quot; pages (pages in the site part). There&#039;s a few things to note that are common to all the language files you&#039;ll create. Firstly, language strings are stored in the common INI format, and the name of each property begins with the component&#039;s system name: &amp;lt;tt&amp;gt;com_helloworld&amp;lt;/tt&amp;gt;. It is convention that all language properties are written in upper-case.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also notice that both the folder and the language file itself contain the locale code for these strings, &amp;quot;en-GB&amp;quot;. For each locale you wish to support, you will need a new set of files with the appropriate strings .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
; Hello World Public Site Strings&lt;br /&gt;
; Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
&lt;br /&gt;
COM_HELLOWORLD_MSG_HELLO_WORLD=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|helloworld.xml}}&lt;br /&gt;
&lt;br /&gt;
As before, we need to add the new &amp;lt;tt&amp;gt;language&amp;lt;/tt&amp;gt; folders to the manifest, so that Joomla! knows to copy them into place. Additionally, we need to tell Joomla! that we have language files, where to find them and what locales they support. This is done with the addition of two &amp;lt;tt&amp;gt;&amp;lt;language /&amp;gt;&amp;lt;/tt&amp;gt; XML blocks, one for each part of the component. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,33,38-40,47,53-56&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;4.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;name&amp;gt;Hello World&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;December 2020&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Dummy author, feel free to replace anywhere you see it--&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;John Smith&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;https://smith.ca&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;John Smith&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GPL v3&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;&lt;br /&gt;
        A hello world component!&lt;br /&gt;
    &amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- This is the PHP namespace under which the extension&#039;s&lt;br /&gt;
    code is organised. It should follow this format:&lt;br /&gt;
    &lt;br /&gt;
    Vendor\Component\ComponentName&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Vendor&amp;quot; can be your company or your own name&lt;br /&gt;
    &lt;br /&gt;
    The &amp;quot;ComponentName&amp;quot; section MUST match the name used &lt;br /&gt;
    everywhere else for your component. Whatever the name of &lt;br /&gt;
    this XML file is, the namespace must match (ignoring CamelCase). &lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;namespace path=&amp;quot;src/&amp;quot;&amp;gt;JohnSmith\Component\HelloWorld&amp;lt;/namespace&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;files folder=&amp;quot;site/&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;src&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;languages&amp;gt;&lt;br /&gt;
        &amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;site/language/en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;/languages&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;administration&amp;gt;&lt;br /&gt;
        &amp;lt;!-- The link that will appear in the Admin panel&#039;s &amp;quot;Components&amp;quot; menu --&amp;gt;&lt;br /&gt;
        &amp;lt;menu link=&amp;quot;index.php?option=com_helloworld&amp;quot;&amp;gt;Hello World&amp;lt;/menu&amp;gt;&lt;br /&gt;
        &amp;lt;!-- List of files and folders to copy, and where to copy them --&amp;gt;&lt;br /&gt;
        &amp;lt;files folder=&amp;quot;admin/&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;language&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;services&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;src&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;languages&amp;gt;&lt;br /&gt;
            &amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;admin/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;admin/language/en-GB/en-GB.com_helloworld.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
        &amp;lt;/languages&amp;gt;&lt;br /&gt;
    &amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|admin/tmpl/hello/default.php}}&lt;br /&gt;
&lt;br /&gt;
Replace the hard-coded English strings with the new language properties. We use the &amp;lt;tt&amp;gt;Joomla\CMS\Language\Text&amp;lt;/tt&amp;gt; class to output our language strings into the page. If the end user uses another language that is supported in our component, this class will automatically fetch the correct strings for that language and output those instead.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;3,16&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Language\Text;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted Access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&amp;lt;?= Text::_(&#039;COM_HELLOWORLD_MSG_HELLO_WORLD&#039;) ?&amp;gt;&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/tmpl/hello/default.php}}&lt;br /&gt;
&lt;br /&gt;
Our page templates are currently identical, so the replacements required are also identical. Remove the hard-coded English and replace it with the correct language property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;3,16&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Language\Text;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted Access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;&amp;lt;?= Text::_(&#039;COM_HELLOWORLD_MSG_HELLO_WORLD&#039;) ?&amp;gt;&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/tmpl/hello/default.xml}}&lt;br /&gt;
&lt;br /&gt;
Just like the PHP template files, we need to replace the hard-coded English in this file with the new language properties. Unlike the PHP files, however, we don&#039;t need any additional code to do so - simply replace the English strings with the language property names and Joomla! is clever enough to match them up for us.&lt;br /&gt;
&lt;br /&gt;
Remember: because these strings are used by Joomla! in its own systems (outside of our component&#039;s pages), they live in the special &amp;lt;tt&amp;gt;[[#admin/language/en-GB/en-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;3-4&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_MENU_HELLO_WORLD_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;message&amp;gt;&amp;lt;![CDATA[COM_HELLOWORLD_MENU_HELLO_WORLD_DESC]]&amp;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;
&lt;br /&gt;
== Testing the Component ==&lt;br /&gt;
&lt;br /&gt;
Just as before, zip up your new component version and upload it into your Joomla! install&#039;s admin panel. Once it has installed, go around and make sure that your pages and menu link appear exactly as they did before. If everything is working properly, there should be no change at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_Menu_Type_to_the_Site_Part|Prev: Adding a Menu Type to the Site Part|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_Model_to_the_Site_Part|Next: Adding a Model to the Site Part|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Joomla!_4.x]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
[[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>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Adding_a_View_to_the_Site_Part&amp;diff=771641</id>
		<title>J4.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=J4.x:Developing_an_MVC_Component/Adding_a_View_to_the_Site_Part&amp;diff=771641"/>
		<updated>2020-12-17T03:11:33Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Adding illustrative screenshots&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}}&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=Adding a View to the Site Part}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Notes/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Adding the View ==&lt;br /&gt;
&lt;br /&gt;
Though a component is split into &amp;quot;admin&amp;quot; and &amp;quot;site&amp;quot; parts, the process of adding a view is very similar in both. Just as in the basic view we made in the last article, we will require a controller, a view, and a template. &lt;br /&gt;
&lt;br /&gt;
To get started, let&#039;s first create the new files for the site page. As before, the source code for each file can be found under [[#File Details|File Details]].&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
 | 1&lt;br /&gt;
 | Create: [[#site/src/Controller/DisplayController|site/src/Controller/DisplayController]]&lt;br /&gt;
 | The default MVC Controller for the site part&lt;br /&gt;
 |-&lt;br /&gt;
 | 2&lt;br /&gt;
 | Create: [[#site/src/View/Hello/HtmlView.php|site/src/View/Hello/HtmlView.php]]&lt;br /&gt;
 | The MVC View object for the new &amp;quot;Hello&amp;quot; page&lt;br /&gt;
 |-&lt;br /&gt;
 | 3&lt;br /&gt;
 | Create: [[#site/tmpl/hello/default.php|site/tmpl/hello/default.php]]&lt;br /&gt;
 | The template for the new &amp;quot;Hello&amp;quot; page&lt;br /&gt;
 |-&lt;br /&gt;
 | 4&lt;br /&gt;
 | Update: [[#helloworld.xml|helloworld.xml]]&lt;br /&gt;
 | Need to add the new files to the component&#039;s manifest&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== File Details ==&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/src/Controller/DisplayController}}&lt;br /&gt;
&lt;br /&gt;
The default MVC controller in the site part. We have some basic code in here to fetch and render a view, but as before we&#039;re mostly delegating to the parent Joomla! class. As this is a PHP class, it lives under your PHP namespace root &amp;lt;tt&amp;gt;src/&amp;lt;/tt&amp;gt;, in the &amp;lt;tt&amp;gt;Controller&amp;lt;/tt&amp;gt; namespace.&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;
namespace JohnSmith\Component\HelloWorld\Site\Controller;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\MVC\Controller\BaseController;&lt;br /&gt;
use Joomla\CMS\Factory;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Site&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Component Controller&lt;br /&gt;
 * @since  0.0.2&lt;br /&gt;
 */&lt;br /&gt;
class DisplayController extends BaseController {&lt;br /&gt;
    &lt;br /&gt;
    public function display($cachable = false, $urlparams = array()) {        &lt;br /&gt;
        $document = Factory::getDocument();&lt;br /&gt;
        $viewName = $this-&amp;gt;input-&amp;gt;getCmd(&#039;view&#039;, &#039;login&#039;);&lt;br /&gt;
        $viewFormat = $document-&amp;gt;getType();&lt;br /&gt;
        &lt;br /&gt;
        $view = $this-&amp;gt;getView($viewName, $viewFormat);&lt;br /&gt;
        &lt;br /&gt;
        $view-&amp;gt;document = $document;&lt;br /&gt;
        $view-&amp;gt;display();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/src/View/Hello/HtmlView.php}}&lt;br /&gt;
&lt;br /&gt;
The MVC view for this &amp;quot;Hello World&amp;quot; page. As before, this file simply delegates to the parent object to get us started. As this is a PHP class, it lives under &amp;lt;tt&amp;gt;src/&amp;lt;/tt&amp;gt;, in the &amp;lt;tt&amp;gt;View/Hello&amp;lt;/tt&amp;gt; namespace that matches the view&#039;s name.&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;
namespace JohnSmith\Component\HelloWorld\Site\View\Hello;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Site&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * View for the user identity validation form&lt;br /&gt;
 */&lt;br /&gt;
class HtmlView extends BaseHtmlView {&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Display the view&lt;br /&gt;
     *&lt;br /&gt;
     * @param   string  $template  The name of the layout file to parse.&lt;br /&gt;
     * @return  void&lt;br /&gt;
     */&lt;br /&gt;
    public function display($template = null) {&lt;br /&gt;
        // Call the parent display to display the layout file&lt;br /&gt;
        parent::display($template);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/tmpl/hello/default.php}}&lt;br /&gt;
&lt;br /&gt;
The page template for our &amp;quot;Hello World&amp;quot; page in the site part. This is identical to the template we used in the admin part, to get us started. As a template, it lives under &amp;lt;tt&amp;gt;tmpl&amp;lt;/tt&amp;gt; in a folder that matches the view&#039;s name.&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;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted Access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Hello world!&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|helloworld.xml}}&lt;br /&gt;
&lt;br /&gt;
Finally, let&#039;s update the component&#039;s manifest to include the new files. We need to tell Joomla! that the new files exist so that it will copy them into place. We&#039;ll also update the extension&#039;s version number in the manifest - right now, this has no real effect, but in the future changing the version number will have more significance so it&#039;s a good habit to get into.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,32-35&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;4.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;name&amp;gt;Hello World&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;December 2020&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Dummy author, feel free to replace anywhere you see it--&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;John Smith&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;https://smith.ca&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;John Smith&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GPL v3&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;&lt;br /&gt;
        A hello world component!&lt;br /&gt;
    &amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- This is the PHP namespace under which the extension&#039;s&lt;br /&gt;
    code is organised. It should follow this format:&lt;br /&gt;
    &lt;br /&gt;
    Vendor\Component\ComponentName&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Vendor&amp;quot; can be your company or your own name&lt;br /&gt;
    &lt;br /&gt;
    The &amp;quot;ComponentName&amp;quot; section MUST match the name used &lt;br /&gt;
    everywhere else for your component. Whatever the name of &lt;br /&gt;
    this XML file is, the namespace must match (ignoring CamelCase). &lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;namespace path=&amp;quot;src/&amp;quot;&amp;gt;JohnSmith\Component\HelloWorld&amp;lt;/namespace&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;files folder=&amp;quot;site/&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;src&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&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;!-- The link that will appear in the Admin panel&#039;s &amp;quot;Components&amp;quot; menu --&amp;gt;&lt;br /&gt;
        &amp;lt;menu link=&amp;quot;index.php?option=com_helloworld&amp;quot;&amp;gt;Hello World&amp;lt;/menu&amp;gt;&lt;br /&gt;
        &amp;lt;!-- List of files and folders to copy, and where to copy them --&amp;gt;&lt;br /&gt;
        &amp;lt;files folder=&amp;quot;admin/&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;services&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;src&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;tmpl&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;
== Updating the Extension ==&lt;br /&gt;
&lt;br /&gt;
To test the changes to your extension, first you will need to zip up the &amp;lt;tt&amp;gt;com_helloworld&amp;lt;/tt&amp;gt; folder and install it just as you did before. We&#039;ll go through the process step-by-step one more time here:&lt;br /&gt;
&lt;br /&gt;
# Using your web browser, navigate to the Administrator panel of your Joomla! site. The address would be &amp;lt;tt&amp;gt;&amp;lt;joomla&amp;gt;/administrator/&amp;lt;/tt&amp;gt;. For example: &amp;lt;tt&amp;gt;http://localhost/joomla/administrator/&amp;lt;/tt&amp;gt;&lt;br /&gt;
# On the left menu, click the &amp;quot;System&amp;quot; link.&lt;br /&gt;
# On the &amp;quot;Install&amp;quot; card, click &amp;quot;Extensions&amp;quot;.&lt;br /&gt;
# On the &amp;quot;Upload Package File&amp;quot; tab, browse for and select the .zip file you just created.&lt;br /&gt;
&lt;br /&gt;
Once your new component version is installed, click the &amp;quot;System&amp;quot; link on the main menu again, then select &amp;quot;Extensions&amp;quot; on the &amp;quot;Manage&amp;quot; card this time. A list of the installed Joomla! extensions should appear. Type &amp;quot;hello&amp;quot; into the search bar at the top right and hit return. You should see your &amp;quot;Hello World&amp;quot; extension, now listed as version 0.0.2. &lt;br /&gt;
&lt;br /&gt;
[[File:Joomla 4.x Component Tutorial 0.0.2 Component Listing.png|frameless|The Hello World component, listed in the Joomla! extensions directory.]]&lt;br /&gt;
&lt;br /&gt;
== Testing the New Page ==&lt;br /&gt;
&lt;br /&gt;
The new page has no menu link yet (we will add that in the next article) so to test it we&#039;ll need to use a direct URL. Go to &amp;lt;tt&amp;gt;&amp;lt;joomla&amp;gt;/index.php?option=com_helloworld&amp;amp;view=hello&amp;lt;/tt&amp;gt; (not inside the &amp;lt;tt&amp;gt;/administrator&amp;lt;/tt&amp;gt; path), and you should see your new &amp;quot;Hello World&amp;quot; site page appear.&lt;br /&gt;
&lt;br /&gt;
[[File:Joomla_4.x_Component_Tutorial_0.0.2_Hello_World.png|frameless|The Hello World page as it appears on Joomla 4 Beta 5.]]&lt;br /&gt;
&lt;br /&gt;
Next, we will add menu configuration for this page, so that it can be used inside the Joomla! menu system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Prev: Developing a Basic Component|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_Menu_Type_to_the_Site_Part|Next: Adding a Menu Type to the Site Part|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Joomla!_4.x]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
[[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>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/en&amp;diff=771472</id>
		<title>Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!4.x - Contents/en</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!4.x_-_Contents/en&amp;diff=771472"/>
		<updated>2020-12-16T01:05:03Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: &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;div class=&amp;quot;large-4 columns&amp;quot; style=&amp;quot;float:right; background:#fff;margin:0 0 1.0em 1.0em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-12 columns panel radius mw-collapsible&amp;quot; style=&amp;quot;width:100%;background:#fff;font-size:.8em&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&#039;&#039;&#039;Articles in this Series&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-12 columns panel mw-collapsible-content&amp;quot; style=&amp;quot;border:none; background:#fff; min-width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Introduction|Introduction]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Developing a Basic Component]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_View_to_the_Site_Part|Adding a View to the Site Part]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_Menu_Type_to_the_Site_Part|Adding a Menu Type to the Site Part]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{-}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials in a Series{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Adding_a_Menu_Type_to_the_Site_Part&amp;diff=771471</id>
		<title>J4.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=J4.x:Developing_an_MVC_Component/Adding_a_Menu_Type_to_the_Site_Part&amp;diff=771471"/>
		<updated>2020-12-16T01:04:29Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Created page with &amp;quot;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}} {{-}} {{Top portal heading|color=white-bkgd|icon=file-code-o|icon-color=#5091cd|size=5x|text-color=#333|title=Adding a Menu Ty...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}}&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=Adding a Menu Type to the Site Part}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Notes/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Adding a Menu Item ==&lt;br /&gt;
&lt;br /&gt;
In this article we will cover how to add a menu item to our Hello World component. This is a very simple process, where we create a menu configuration file alongside our page template with a matching name. That file is then read by the Joomla! menu system, and our page will become an available link target.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s go ahead and create the configuration file for our &amp;quot;Hello World&amp;quot; template:&lt;br /&gt;
&lt;br /&gt;
{{vanchor|src/site/tmpl/hello/default.xml}}&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;metadata&amp;gt;&lt;br /&gt;
    &amp;lt;layout title=&amp;quot;Hello World!&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;message&amp;gt;&amp;lt;![CDATA[My first Joomla! page]]&amp;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;
&lt;br /&gt;
{{vanchor|helloworld.xml}}&lt;br /&gt;
&lt;br /&gt;
And as always, we update our extension&#039;s manifest file with the new version number.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13&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;4.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;name&amp;gt;Hello World&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;December 2020&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Dummy author, feel free to replace anywhere you see it--&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;John Smith&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;https://smith.ca&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;John Smith&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GPL v3&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;&lt;br /&gt;
        A hello world component!&lt;br /&gt;
    &amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- This is the PHP namespace under which the extension&#039;s&lt;br /&gt;
    code is organised. It should follow this format:&lt;br /&gt;
    &lt;br /&gt;
    Vendor\Component\ComponentName&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Vendor&amp;quot; can be your company or your own name&lt;br /&gt;
    &lt;br /&gt;
    The &amp;quot;ComponentName&amp;quot; section MUST match the name used &lt;br /&gt;
    everywhere else for your component. Whatever the name of &lt;br /&gt;
    this XML file is, the namespace must match (ignoring CamelCase). &lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;namespace path=&amp;quot;src/&amp;quot;&amp;gt;JohnSmith\Component\HelloWorld&amp;lt;/namespace&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;files folder=&amp;quot;site/&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;src&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&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;!-- The link that will appear in the Admin panel&#039;s &amp;quot;Components&amp;quot; menu --&amp;gt;&lt;br /&gt;
        &amp;lt;menu link=&amp;quot;index.php?option=com_helloworld&amp;quot;&amp;gt;Hello World&amp;lt;/menu&amp;gt;&lt;br /&gt;
        &amp;lt;!-- List of files and folders to copy, and where to copy them --&amp;gt;&lt;br /&gt;
        &amp;lt;files folder=&amp;quot;admin/&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;services&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;src&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;tmpl&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;
== Testing the Menu Item ==&lt;br /&gt;
&lt;br /&gt;
Zip up and install your extension as before. Once you have, expand the &amp;quot;Menus&amp;quot; section of the left hand menu, and click the plus-sign icon next to the Main Menu. This will take you to the &amp;quot;New Menu Item&amp;quot; screen. &lt;br /&gt;
&lt;br /&gt;
[[File:Joomla 4.x Component Tutorial 0.0.3 New Menu Item.png|frameless|Where to find the &amp;quot;New Menu Item&amp;quot; button in the Joomla! admin panel&#039;s menu.]]&lt;br /&gt;
&lt;br /&gt;
There are many options here, but the two that we care about are the link&#039;s name and its type. Give the menu link a name like &amp;quot;Hello World&amp;quot;, then select the menu item&#039;s type. You will see a list of all the available menu item types, organised by category.&lt;br /&gt;
&lt;br /&gt;
[[File:Joomla_4.x_Component_Tutorial_0.0.3_Menu_Item_Type.png|frameless|The new &amp;quot;Hello World&amp;quot; component&#039;s first link, appearing in the list of available menu item types.]]&lt;br /&gt;
&lt;br /&gt;
You should see our &amp;quot;Hello World&amp;quot; component as a new category. Expand that category and our newly created link type should appear. Go ahead and select it, then save the menu item. Head over to the public site part of your Joomla! install and you should see the &amp;quot;Hello World&amp;quot; link appear in the main menu. Clicking on it should take you to the &amp;quot;Hello World&amp;quot; page we created in the last article.&lt;br /&gt;
&lt;br /&gt;
See how easy that was! &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_View_to_the_Site_Part|Prev: Adding a View to the Site Part|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Language_Management|Next: Language Management|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Joomla!_4.x]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
[[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>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=File:Joomla_4.x_Component_Tutorial_0.0.3_New_Menu_Item.png&amp;diff=771470</id>
		<title>File:Joomla 4.x Component Tutorial 0.0.3 New Menu Item.png</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=File:Joomla_4.x_Component_Tutorial_0.0.3_New_Menu_Item.png&amp;diff=771470"/>
		<updated>2020-12-16T00:56:45Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Where to find the &amp;quot;New Menu Item&amp;quot; button in the Joomla! admin panel&amp;#039;s menu.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Where to find the &amp;quot;New Menu Item&amp;quot; button in the Joomla! admin panel&#039;s menu.&lt;br /&gt;
== Licensing ==&lt;br /&gt;
{{JEDL}}&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=File:Joomla_4.x_Component_Tutorial_0.0.3_Menu_Item_Type.png&amp;diff=771469</id>
		<title>File:Joomla 4.x Component Tutorial 0.0.3 Menu Item Type.png</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=File:Joomla_4.x_Component_Tutorial_0.0.3_Menu_Item_Type.png&amp;diff=771469"/>
		<updated>2020-12-16T00:56:08Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: The new &amp;quot;Hello World&amp;quot; component&amp;#039;s first link, appearing in the list of available menu item types.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
The new &amp;quot;Hello World&amp;quot; component&#039;s first link, appearing in the list of available menu item types.&lt;br /&gt;
== Licensing ==&lt;br /&gt;
{{JEDL}}&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=File:Joomla_4.x_Component_Tutorial_0.0.2_Component_Listing.png&amp;diff=771468</id>
		<title>File:Joomla 4.x Component Tutorial 0.0.2 Component Listing.png</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=File:Joomla_4.x_Component_Tutorial_0.0.2_Component_Listing.png&amp;diff=771468"/>
		<updated>2020-12-16T00:55:08Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Our new Joomla! Hello World component, listed in the Joomla! installation&amp;#039;s component directory.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Our new Joomla! Hello World component, listed in the Joomla! installation&#039;s component directory.&lt;br /&gt;
== Licensing ==&lt;br /&gt;
{{JEDL}}&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=File:Joomla_4.x_Component_Tutorial_0.0.2_Hello_World.png&amp;diff=771467</id>
		<title>File:Joomla 4.x Component Tutorial 0.0.2 Hello World.png</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=File:Joomla_4.x_Component_Tutorial_0.0.2_Hello_World.png&amp;diff=771467"/>
		<updated>2020-12-16T00:53:58Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Our newly created &amp;quot;Hello World&amp;quot; page, running in the public site section of our Joomla! installation.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Our newly created &amp;quot;Hello World&amp;quot; page, running in the public site section of our Joomla! installation.&lt;br /&gt;
== Licensing ==&lt;br /&gt;
{{JEDL}}&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/en&amp;diff=771241</id>
		<title>Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!4.x - Contents/en</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!4.x_-_Contents/en&amp;diff=771241"/>
		<updated>2020-12-15T06:37:21Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: &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;div class=&amp;quot;large-4 columns&amp;quot; style=&amp;quot;float:right; background:#fff;margin:0 0 1.0em 1.0em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-12 columns panel radius mw-collapsible&amp;quot; style=&amp;quot;width:100%;background:#fff;font-size:.8em&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&#039;&#039;&#039;Articles in this Series&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-12 columns panel mw-collapsible-content&amp;quot; style=&amp;quot;border:none; background:#fff; min-width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Introduction|Introduction]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Developing a Basic Component]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_View_to_the_Site_Part|Adding a View to the Site Part]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{-}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials in a Series{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Adding_a_View_to_the_Site_Part&amp;diff=771240</id>
		<title>J4.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=J4.x:Developing_an_MVC_Component/Adding_a_View_to_the_Site_Part&amp;diff=771240"/>
		<updated>2020-12-15T06:34:22Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Created page with &amp;quot;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}} {{-}} {{Top portal heading|color=white-bkgd|icon=file-code-o|icon-color=#5091cd|size=5x|text-color=#333|title=Adding a View to...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}}&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=Adding a View to the Site Part}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Notes/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Adding the View ==&lt;br /&gt;
&lt;br /&gt;
Though a component is split into &amp;quot;admin&amp;quot; and &amp;quot;site&amp;quot; parts, the process of adding a view is very similar in both. Just as in the basic view we made in the last article, we will require a controller, a view, and a template. &lt;br /&gt;
&lt;br /&gt;
To get started, let&#039;s first create the new files for the site page. As before, the source code for each file can be found under [[#File Details|File Details]].&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
 | 1&lt;br /&gt;
 | Create: [[#site/src/Controller/DisplayController|site/src/Controller/DisplayController]]&lt;br /&gt;
 | The default MVC Controller for the site part&lt;br /&gt;
 |-&lt;br /&gt;
 | 2&lt;br /&gt;
 | Create: [[#site/src/View/Hello/HtmlView.php|site/src/View/Hello/HtmlView.php]]&lt;br /&gt;
 | The MVC View object for the new &amp;quot;Hello&amp;quot; page&lt;br /&gt;
 |-&lt;br /&gt;
 | 3&lt;br /&gt;
 | Create: [[#site/tmpl/hello/default.php|site/tmpl/hello/default.php]]&lt;br /&gt;
 | The template for the new &amp;quot;Hello&amp;quot; page&lt;br /&gt;
 |-&lt;br /&gt;
 | 4&lt;br /&gt;
 | Update: [[#helloworld.xml|helloworld.xml]]&lt;br /&gt;
 | Need to add the new files to the component&#039;s manifest&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== File Details ==&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/src/Controller/DisplayController}}&lt;br /&gt;
&lt;br /&gt;
The default MVC controller in the site part. We have some basic code in here to fetch and render a view, but as before we&#039;re mostly delegating to the parent Joomla! class. As this is a PHP class, it lives under your PHP namespace root &amp;lt;tt&amp;gt;src/&amp;lt;/tt&amp;gt;, in the &amp;lt;tt&amp;gt;Controller&amp;lt;/tt&amp;gt; namespace.&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;
namespace JohnSmith\Component\HelloWorld\Site\Controller;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\MVC\Controller\BaseController;&lt;br /&gt;
use Joomla\CMS\Factory;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Site&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Component Controller&lt;br /&gt;
 * @since  0.0.2&lt;br /&gt;
 */&lt;br /&gt;
class DisplayController extends BaseController {&lt;br /&gt;
    &lt;br /&gt;
    public function display($cachable = false, $urlparams = array()) {        &lt;br /&gt;
        $document = Factory::getDocument();&lt;br /&gt;
        $viewName = $this-&amp;gt;input-&amp;gt;getCmd(&#039;view&#039;, &#039;login&#039;);&lt;br /&gt;
        $viewFormat = $document-&amp;gt;getType();&lt;br /&gt;
        &lt;br /&gt;
        $view = $this-&amp;gt;getView($viewName, $viewFormat);&lt;br /&gt;
        &lt;br /&gt;
        $view-&amp;gt;document = $document;&lt;br /&gt;
        $view-&amp;gt;display();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/src/View/Hello/HtmlView.php}}&lt;br /&gt;
&lt;br /&gt;
The MVC view for this &amp;quot;Hello World&amp;quot; page. As before, this file simply delegates to the parent object to get us started. As this is a PHP class, it lives under &amp;lt;tt&amp;gt;src/&amp;lt;/tt&amp;gt;, in the &amp;lt;tt&amp;gt;View/Hello&amp;lt;/tt&amp;gt; namespace that matches the view&#039;s name.&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;
namespace JohnSmith\Component\HelloWorld\Site\View\Hello;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Site&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * View for the user identity validation form&lt;br /&gt;
 */&lt;br /&gt;
class HtmlView extends BaseHtmlView {&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Display the view&lt;br /&gt;
     *&lt;br /&gt;
     * @param   string  $template  The name of the layout file to parse.&lt;br /&gt;
     * @return  void&lt;br /&gt;
     */&lt;br /&gt;
    public function display($template = null) {&lt;br /&gt;
        // Call the parent display to display the layout file&lt;br /&gt;
        parent::display($template);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/tmpl/hello/default.php}}&lt;br /&gt;
&lt;br /&gt;
The page template for our &amp;quot;Hello World&amp;quot; page in the site part. This is identical to the template we used in the admin part, to get us started. As a template, it lives under &amp;lt;tt&amp;gt;tmpl&amp;lt;/tt&amp;gt; in a folder that matches the view&#039;s name.&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;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted Access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Hello world!&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|helloworld.xml}}&lt;br /&gt;
&lt;br /&gt;
Finally, let&#039;s update the component&#039;s manifest to include the new files. We need to tell Joomla! that the new files exist so that it will copy them into place. We&#039;ll also update the extension&#039;s version number in the manifest - right now, this has no real effect, but in the future changing the version number will have more significance so it&#039;s a good habit to get into.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,32-35&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;4.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;name&amp;gt;Hello World&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;December 2020&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Dummy author, feel free to replace anywhere you see it--&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;John Smith&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;https://smith.ca&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;John Smith&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GPL v3&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;&lt;br /&gt;
        A hello world component!&lt;br /&gt;
    &amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- This is the PHP namespace under which the extension&#039;s&lt;br /&gt;
    code is organised. It should follow this format:&lt;br /&gt;
    &lt;br /&gt;
    Vendor\Component\ComponentName&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Vendor&amp;quot; can be your company or your own name&lt;br /&gt;
    &lt;br /&gt;
    The &amp;quot;ComponentName&amp;quot; section MUST match the name used &lt;br /&gt;
    everywhere else for your component. Whatever the name of &lt;br /&gt;
    this XML file is, the namespace must match (ignoring CamelCase). &lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;namespace path=&amp;quot;src/&amp;quot;&amp;gt;JohnSmith\Component\HelloWorld&amp;lt;/namespace&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;files folder=&amp;quot;site/&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;src&amp;lt;/folder&amp;gt;&lt;br /&gt;
        &amp;lt;folder&amp;gt;tmpl&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;!-- The link that will appear in the Admin panel&#039;s &amp;quot;Components&amp;quot; menu --&amp;gt;&lt;br /&gt;
        &amp;lt;menu link=&amp;quot;index.php?option=com_helloworld&amp;quot;&amp;gt;Hello World&amp;lt;/menu&amp;gt;&lt;br /&gt;
        &amp;lt;!-- List of files and folders to copy, and where to copy them --&amp;gt;&lt;br /&gt;
        &amp;lt;files folder=&amp;quot;admin/&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;services&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;src&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;tmpl&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;
== Updating the Extension ==&lt;br /&gt;
&lt;br /&gt;
To test the changes to your extension, first you will need to zip up the &amp;lt;tt&amp;gt;com_helloworld&amp;lt;/tt&amp;gt; folder and install it just as you did before. We&#039;ll go through the process step-by-step one more time here:&lt;br /&gt;
&lt;br /&gt;
# Using your web browser, navigate to the Administrator panel of your Joomla! site. The address would be &amp;lt;tt&amp;gt;&amp;lt;joomla&amp;gt;/administrator/&amp;lt;/tt&amp;gt;. For example: &amp;lt;tt&amp;gt;http://localhost/joomla/administrator/&amp;lt;/tt&amp;gt;&lt;br /&gt;
# On the left menu, click the &amp;quot;System&amp;quot; link.&lt;br /&gt;
# On the &amp;quot;Install&amp;quot; card, click &amp;quot;Extensions&amp;quot;.&lt;br /&gt;
# On the &amp;quot;Upload Package File&amp;quot; tab, browse for and select the .zip file you just created.&lt;br /&gt;
&lt;br /&gt;
Once your new component version is installed, click the &amp;quot;System&amp;quot; link on the main menu again, then select &amp;quot;Extensions&amp;quot; on the &amp;quot;Manage&amp;quot; card this time. A list of the installed Joomla! extensions should appear. Type &amp;quot;hello&amp;quot; into the search bar at the top right and hit return. You should see your &amp;quot;Hello World&amp;quot; extension, now listed as version 0.0.2. &lt;br /&gt;
&lt;br /&gt;
== Testing the New Page ==&lt;br /&gt;
&lt;br /&gt;
The new page has no menu link yet (we will add that in the next article) so to test it we&#039;ll need to use a direct URL. Go to &amp;lt;tt&amp;gt;&amp;lt;joomla&amp;gt;/index.php?option=com_helloworld&amp;amp;view=hello&amp;lt;/tt&amp;gt; (not inside the &amp;lt;tt&amp;gt;/administrator&amp;lt;/tt&amp;gt; path), and you should see your new &amp;quot;Hello World&amp;quot; site page appear.&lt;br /&gt;
&lt;br /&gt;
Next, we will add menu configuration for this page, so that it can be used inside the Joomla! menu system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Prev: Developing a Basic Component|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_Menu_Type_to_the_Site_Part|Next: Adding a Menu Type to the Site Part|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Joomla!_4.x]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
[[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>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component&amp;diff=771226</id>
		<title>J4.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=J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component&amp;diff=771226"/>
		<updated>2020-12-15T04:48:37Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Renaming &amp;quot;test&amp;quot; view to &amp;quot;hello&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}}&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=Developing a Basic Component}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Notes/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Your First Component ==&lt;br /&gt;
&lt;br /&gt;
In this article we will cover how to create and install a basic Joomla! component, which we will inventively call the &amp;quot;Hello World&amp;quot; component.&lt;br /&gt;
&lt;br /&gt;
To begin, you must first use your preferred file manager to create a directory for the Hello World! component. This directory can be anywhere on your file system, as long as it is outside of your Joomla! installation directory. For this example we will name the directory &amp;lt;tt&amp;gt;com_helloworld&amp;lt;/tt&amp;gt;, because that is how a component directory looks once it&#039;s inside Joomla. (The &amp;lt;tt&amp;gt;com&amp;lt;/tt&amp;gt; prefix means &amp;quot;component&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Next, inside this directory we need to create some files. Using your preferred file manager, create the following files; as you create the files, add the source code for each file which can be found in [[#File Details|File Details]]. &lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
 | 1&lt;br /&gt;
 | &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
 | An XML manifest file that tells Joomla! how to install our component.&lt;br /&gt;
 |-&lt;br /&gt;
 | 2&lt;br /&gt;
 | &#039;&#039;[[#admin/services/provider.php|admin/services/provider.php]]&#039;&#039;&lt;br /&gt;
 | Tells Joomla! how to initialise the component&lt;br /&gt;
 |-&lt;br /&gt;
 | 3&lt;br /&gt;
 | &#039;&#039;[[#admin/src/Controller/DisplayController|admin/src/Controller/DisplayController]]&#039;&#039;&lt;br /&gt;
 | The MVC Controller for the &amp;quot;Hello World&amp;quot; page we&#039;ll start with.&lt;br /&gt;
 |-&lt;br /&gt;
 | 4&lt;br /&gt;
 | &#039;&#039;[[#admin/src/View/Hello/HtmlView.php|admin/src/View/Hello/HtmlView.php]]&#039;&#039;&lt;br /&gt;
 | The MVC View for the &amp;quot;Hello World&amp;quot; page we&#039;ll start with.&lt;br /&gt;
 |-&lt;br /&gt;
 | 5&lt;br /&gt;
 | &#039;&#039;[[#admin/tmpl/hello/default.php|admin/tmpl/hello/default.php]]&#039;&#039;&lt;br /&gt;
 | The HTML/PHP template for the &amp;quot;Hello World&amp;quot; page&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== File Details ==&lt;br /&gt;
&lt;br /&gt;
{{vanchor|helloworld.xml}}&lt;br /&gt;
&lt;br /&gt;
This is a manifest file, which describes the component and its configuration to Joomla! It is utilised during installation to copy the component&#039;s files into the correct locations, trigger database installation, configure the component&#039;s PHP namespace, and so on.&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;component&amp;quot; version=&amp;quot;4.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;name&amp;gt;Hello World&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;December 2020&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Dummy author, feel free to replace anywhere you see it--&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;John Smith&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;https://smith.ca&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;John Smith&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GPL v3&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;&lt;br /&gt;
        A hello world component!&lt;br /&gt;
    &amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- This is the PHP namespace under which the extension&#039;s&lt;br /&gt;
    code is organised. It should follow this format:&lt;br /&gt;
    &lt;br /&gt;
    Vendor\Component\ComponentName&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Vendor&amp;quot; can be your company or your own name&lt;br /&gt;
    &lt;br /&gt;
    The &amp;quot;ComponentName&amp;quot; section MUST match the name used &lt;br /&gt;
    everywhere else for your component. Whatever the name of &lt;br /&gt;
    this XML file is, the namespace must match (ignoring CamelCase). &lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;namespace path=&amp;quot;src/&amp;quot;&amp;gt;JohnSmith\Component\HelloWorld&amp;lt;/namespace&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
    &amp;lt;administration&amp;gt;&lt;br /&gt;
        &amp;lt;!-- The link that will appear in the Admin panel&#039;s &amp;quot;Components&amp;quot; menu --&amp;gt;&lt;br /&gt;
        &amp;lt;menu link=&amp;quot;index.php?option=com_helloworld&amp;quot;&amp;gt;Hello World&amp;lt;/menu&amp;gt;&lt;br /&gt;
        &amp;lt;!-- List of files and folders to copy, and where to copy them --&amp;gt;&lt;br /&gt;
        &amp;lt;files folder=&amp;quot;admin/&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;services&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;src&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;tmpl&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|admin/services/provider.php}}&lt;br /&gt;
&lt;br /&gt;
This is a special file that tells Joomla! how to initialise the component - which services it requires and how they should be provided.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface;&lt;br /&gt;
use Joomla\CMS\Extension\ComponentInterface;&lt;br /&gt;
use Joomla\CMS\Extension\MVCComponent;&lt;br /&gt;
use Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory;&lt;br /&gt;
use Joomla\CMS\Extension\Service\Provider\MVCFactory;&lt;br /&gt;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;&lt;br /&gt;
use Joomla\DI\Container;&lt;br /&gt;
use Joomla\DI\ServiceProviderInterface;&lt;br /&gt;
&lt;br /&gt;
return new class implements ServiceProviderInterface {&lt;br /&gt;
    &lt;br /&gt;
    public function register(Container $container): void {&lt;br /&gt;
        $container-&amp;gt;registerServiceProvider(new MVCFactory(&#039;\\JohnSmith\\Component\\HelloWorld&#039;));&lt;br /&gt;
        $container-&amp;gt;registerServiceProvider(new ComponentDispatcherFactory(&#039;\\JohnSmith\\Component\\HelloWorld&#039;));&lt;br /&gt;
        $container-&amp;gt;set(&lt;br /&gt;
            ComponentInterface::class,&lt;br /&gt;
            function (Container $container) {&lt;br /&gt;
                $component = new MVCComponent($container-&amp;gt;get(ComponentDispatcherFactoryInterface::class));&lt;br /&gt;
                $component-&amp;gt;setMVCFactory($container-&amp;gt;get(MVCFactoryInterface::class));&lt;br /&gt;
&lt;br /&gt;
                return $component;&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;
{{vanchor|admin/src/Controller/DisplayController}}&lt;br /&gt;
&lt;br /&gt;
The MVC controller for our first view, &amp;quot;hello&amp;quot;. As our component grows in complexity, a page&#039;s controller will handle model fetching, form submissions, and so on. Here, it simply sets its default view and leaves the rest to its parent.&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;
namespace JohnSmith\Component\HelloWorld\Administrator\Controller;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\MVC\Controller\BaseController;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Default Controller of HelloWorld component&lt;br /&gt;
 *&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 */&lt;br /&gt;
class DisplayController extends BaseController {&lt;br /&gt;
    /**&lt;br /&gt;
     * The default view for the display method.&lt;br /&gt;
     *&lt;br /&gt;
     * @var string&lt;br /&gt;
     */&lt;br /&gt;
    protected $default_view = &#039;hello&#039;;&lt;br /&gt;
    &lt;br /&gt;
    public function display($cachable = false, $urlparams = array()) {&lt;br /&gt;
        return parent::display();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|admin/src/View/Hello/HtmlView.php}}&lt;br /&gt;
&lt;br /&gt;
This is the MVC view object for our first page. The job of a view object is to handle the setup work for a view template - selecting a layout, fetching Javascript, generating toolbars, etc. To simply get our &amp;quot;hello world&amp;quot; page to load, we will delegate the work of initialising the view to Joomla!&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;
namespace JohnSmith\Component\HelloWorld\Administrator\View\Hello;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Main &amp;quot;Hello World&amp;quot; Admin View&lt;br /&gt;
 */&lt;br /&gt;
class HtmlView extends BaseHtmlView {&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Display the main &amp;quot;Hello World&amp;quot; view&lt;br /&gt;
     *&lt;br /&gt;
     * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.&lt;br /&gt;
     * @return  void&lt;br /&gt;
     */&lt;br /&gt;
    function display($tpl = null) {&lt;br /&gt;
        parent::display($tpl);&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;
{{vanchor|admin/tmpl/hello/default.php}}&lt;br /&gt;
&lt;br /&gt;
This file holds the template for the page. It is used to render the page utilising the setup done by the view object.&lt;br /&gt;
&lt;br /&gt;
When no specific layout is requested for a view, Joomla! will load the template in the &amp;lt;tt&amp;gt;default.php&amp;lt;/tt&amp;gt; file, which is why we&#039;re using that filename.&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;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted Access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Hello world!&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing the Component ==&lt;br /&gt;
&lt;br /&gt;
Using your preferred file manager, create a .zip file of the &amp;lt;tt&amp;gt;com_helloworld&amp;lt;/tt&amp;gt; directory - include the directory itself and make sure to preserve the directory structure.&lt;br /&gt;
&lt;br /&gt;
Now we need to install the component. Follow this process:&lt;br /&gt;
&lt;br /&gt;
# Using your web browser, navigate to the Administrator panel of your Joomla! site. The address would be &amp;lt;tt&amp;gt;&amp;lt;joomla&amp;gt;/administrator/&amp;lt;/tt&amp;gt;. For example: &amp;lt;tt&amp;gt;http://localhost/joomla/administrator/&amp;lt;/tt&amp;gt;&lt;br /&gt;
# On the left menu, click the &amp;quot;System&amp;quot; link.&lt;br /&gt;
# On the &amp;quot;Install&amp;quot; card, click &amp;quot;Extensions&amp;quot;.&lt;br /&gt;
# On the &amp;quot;Upload Package File&amp;quot; tab, browse for and select the .zip file you just created.&lt;br /&gt;
&lt;br /&gt;
The page should automatically process the installation of the component, and you will receive a message telling you whether it was successful or not.&lt;br /&gt;
&lt;br /&gt;
== Testing the Component ==&lt;br /&gt;
&lt;br /&gt;
Once the component is installed, click the &amp;quot;Components&amp;quot; section of the menu on the left of the admin panel. You should now see a new link under this section labelled &amp;quot;Hello World&amp;quot;. This is the link detailed in the component&#039;s manifest file. If you click it, you should see the &amp;quot;Hello World&amp;quot; page. &lt;br /&gt;
&lt;br /&gt;
Congratulations! You&#039;ve created your first Joomla! component. Now, let&#039;s start making it useful.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Introduction|Prev: Introduction|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_View_to_the_Site_Part|Next: Adding a View to the Site Part|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Joomla!_4.x]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
[[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>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component&amp;diff=771225</id>
		<title>J4.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=J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component&amp;diff=771225"/>
		<updated>2020-12-15T02:01:01Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Moving common notes to their own chunk&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}}&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=Developing a Basic Component}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Notes/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Your First Component ==&lt;br /&gt;
&lt;br /&gt;
In this article we will cover how to create and install a basic Joomla! component, which we will inventively call the &amp;quot;Hello World&amp;quot; component.&lt;br /&gt;
&lt;br /&gt;
To begin, you must first use your preferred file manager to create a directory for the Hello World! component. This directory can be anywhere on your file system, as long as it is outside of your Joomla! installation directory. For this example we will name the directory &amp;lt;tt&amp;gt;com_helloworld&amp;lt;/tt&amp;gt;, because that is how a component directory looks once it&#039;s inside Joomla. (The &amp;lt;tt&amp;gt;com&amp;lt;/tt&amp;gt; prefix means &amp;quot;component&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Next, inside this directory we need to create some files. Using your preferred file manager, create the following files; as you create the files, add the source code for each file which can be found in [[#File Details|File Details]]. &lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
 | 1&lt;br /&gt;
 | &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
 | An XML manifest file that tells Joomla! how to install our component.&lt;br /&gt;
 |-&lt;br /&gt;
 | 2&lt;br /&gt;
 | &#039;&#039;[[#admin/services/provider.php|admin/services/provider.php]]&#039;&#039;&lt;br /&gt;
 | Tells Joomla! how to initialise the component&lt;br /&gt;
 |-&lt;br /&gt;
 | 3&lt;br /&gt;
 | &#039;&#039;[[#admin/src/Controller/DisplayController|admin/src/Controller/DisplayController]]&#039;&#039;&lt;br /&gt;
 | The MVC Controller for the &amp;quot;Hello World&amp;quot; page we&#039;ll start with.&lt;br /&gt;
 |-&lt;br /&gt;
 | 4&lt;br /&gt;
 | &#039;&#039;[[#admin/src/View/Test/HtmlView.php|admin/src/View/Test/HtmlView.php]]&#039;&#039;&lt;br /&gt;
 | The MVC View for the &amp;quot;Hello World&amp;quot; page we&#039;ll start with.&lt;br /&gt;
 |-&lt;br /&gt;
 | 5&lt;br /&gt;
 | &#039;&#039;[[#admin/tmpl/test/default.php|admin/tmpl/test/default.php]]&#039;&#039;&lt;br /&gt;
 | The HTML/PHP template for the &amp;quot;Hello World&amp;quot; page&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== File Details ==&lt;br /&gt;
&lt;br /&gt;
{{vanchor|helloworld.xml}}&lt;br /&gt;
&lt;br /&gt;
This is a manifest file, which describes the component and its configuration to Joomla! It is utilised during installation to copy the component&#039;s files into the correct locations, trigger database installation, configure the component&#039;s PHP namespace, and so on.&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;component&amp;quot; version=&amp;quot;4.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;name&amp;gt;Hello World&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;December 2020&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Dummy author, feel free to replace anywhere you see it--&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;John Smith&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;https://smith.ca&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;John Smith&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GPL v3&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;&lt;br /&gt;
        A hello world component!&lt;br /&gt;
    &amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- This is the PHP namespace under which the extension&#039;s&lt;br /&gt;
    code is organised. It should follow this format:&lt;br /&gt;
    &lt;br /&gt;
    Vendor\Component\ComponentName&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Vendor&amp;quot; can be your company or your own name&lt;br /&gt;
    &lt;br /&gt;
    The &amp;quot;ComponentName&amp;quot; section MUST match the name used &lt;br /&gt;
    everywhere else for your component. Whatever the name of &lt;br /&gt;
    this XML file is, the namespace must match (ignoring CamelCase). &lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;namespace path=&amp;quot;src/&amp;quot;&amp;gt;JohnSmith\Component\HelloWorld&amp;lt;/namespace&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
    &amp;lt;administration&amp;gt;&lt;br /&gt;
        &amp;lt;!-- The link that will appear in the Admin panel&#039;s &amp;quot;Components&amp;quot; menu --&amp;gt;&lt;br /&gt;
        &amp;lt;menu link=&amp;quot;index.php?option=com_helloworld&amp;quot;&amp;gt;Hello World&amp;lt;/menu&amp;gt;&lt;br /&gt;
        &amp;lt;!-- List of files and folders to copy, and where to copy them --&amp;gt;&lt;br /&gt;
        &amp;lt;files folder=&amp;quot;admin/&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;services&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;src&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;tmpl&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|admin/services/provider.php}}&lt;br /&gt;
&lt;br /&gt;
This is a special file that tells Joomla! how to initialise the component - which services it requires and how they should be provided.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface;&lt;br /&gt;
use Joomla\CMS\Extension\ComponentInterface;&lt;br /&gt;
use Joomla\CMS\Extension\MVCComponent;&lt;br /&gt;
use Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory;&lt;br /&gt;
use Joomla\CMS\Extension\Service\Provider\MVCFactory;&lt;br /&gt;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;&lt;br /&gt;
use Joomla\DI\Container;&lt;br /&gt;
use Joomla\DI\ServiceProviderInterface;&lt;br /&gt;
&lt;br /&gt;
return new class implements ServiceProviderInterface {&lt;br /&gt;
    &lt;br /&gt;
    public function register(Container $container): void {&lt;br /&gt;
        $container-&amp;gt;registerServiceProvider(new MVCFactory(&#039;\\JohnSmith\\Component\\HelloWorld&#039;));&lt;br /&gt;
        $container-&amp;gt;registerServiceProvider(new ComponentDispatcherFactory(&#039;\\JohnSmith\\Component\\HelloWorld&#039;));&lt;br /&gt;
        $container-&amp;gt;set(&lt;br /&gt;
            ComponentInterface::class,&lt;br /&gt;
            function (Container $container) {&lt;br /&gt;
                $component = new MVCComponent($container-&amp;gt;get(ComponentDispatcherFactoryInterface::class));&lt;br /&gt;
                $component-&amp;gt;setMVCFactory($container-&amp;gt;get(MVCFactoryInterface::class));&lt;br /&gt;
&lt;br /&gt;
                return $component;&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;
{{vanchor|admin/src/Controller/DisplayController}}&lt;br /&gt;
&lt;br /&gt;
The MVC controller for our first view, &amp;quot;test&amp;quot;. As our component grows in complexity, a page&#039;s controller will handle model fetching, form submissions, and so on. Here, it simply sets its default view and leaves the rest to its parent.&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;
namespace JohnSmith\Component\HelloWorld\Administrator\Controller;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\MVC\Controller\BaseController;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Default Controller of HelloWorld component&lt;br /&gt;
 *&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 */&lt;br /&gt;
class DisplayController extends BaseController {&lt;br /&gt;
    /**&lt;br /&gt;
     * The default view for the display method.&lt;br /&gt;
     *&lt;br /&gt;
     * @var string&lt;br /&gt;
     */&lt;br /&gt;
    protected $default_view = &#039;test&#039;;&lt;br /&gt;
    &lt;br /&gt;
    public function display($cachable = false, $urlparams = array()) {&lt;br /&gt;
        return parent::display();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|admin/src/View/Test/HtmlView.php}}&lt;br /&gt;
&lt;br /&gt;
This is the MVC view object for our first page. The job of a view object is to handle the setup work for a view template - selecting a layout, fetching Javascript, generating toolbars, etc. To simply get our &amp;quot;hello world&amp;quot; page to load, we will delegate the work of initialising the view to Joomla!&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;
namespace JohnSmith\Component\HelloWorld\Administrator\View\Test;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Main &amp;quot;Hello World&amp;quot; Admin View&lt;br /&gt;
 */&lt;br /&gt;
class HtmlView extends BaseHtmlView {&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Display the main &amp;quot;Hello World&amp;quot; view&lt;br /&gt;
     *&lt;br /&gt;
     * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.&lt;br /&gt;
     * @return  void&lt;br /&gt;
     */&lt;br /&gt;
    function display($tpl = null) {&lt;br /&gt;
        parent::display($tpl);&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;
{{vanchor|admin/tmpl/test/default.php}}&lt;br /&gt;
&lt;br /&gt;
This file holds the template for the page. It is used to render the page utilising the setup done by the view object.&lt;br /&gt;
&lt;br /&gt;
When no specific layout is requested for a view, Joomla! will load the template in the &amp;lt;tt&amp;gt;default.php&amp;lt;/tt&amp;gt; file, which is why we&#039;re using that filename.&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;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted Access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Hello world!&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing the Component ==&lt;br /&gt;
&lt;br /&gt;
Using your preferred file manager, create a .zip file of the &amp;lt;tt&amp;gt;com_helloworld&amp;lt;/tt&amp;gt; directory - include the directory itself and make sure to preserve the directory structure.&lt;br /&gt;
&lt;br /&gt;
Now we need to install the component. Follow this process:&lt;br /&gt;
&lt;br /&gt;
# Using your web browser, navigate to the Administrator panel of your Joomla! site. The address would be &amp;lt;tt&amp;gt;&amp;lt;joomla&amp;gt;/administrator/&amp;lt;/tt&amp;gt;. For example: &amp;lt;tt&amp;gt;http://localhost/joomla/administrator/&amp;lt;/tt&amp;gt;&lt;br /&gt;
# On the left menu, click the &amp;quot;System&amp;quot; link.&lt;br /&gt;
# On the &amp;quot;Install&amp;quot; card, click &amp;quot;Extensions&amp;quot;.&lt;br /&gt;
# On the &amp;quot;Upload Package File&amp;quot; tab, browse for and select the .zip file you just created.&lt;br /&gt;
&lt;br /&gt;
The page should automatically process the installation of the component, and you will receive a message telling you whether it was successful or not.&lt;br /&gt;
&lt;br /&gt;
== Testing the Component ==&lt;br /&gt;
&lt;br /&gt;
Once the component is installed, click the &amp;quot;Components&amp;quot; section of the menu on the left of the admin panel. You should now see a new link under this section labelled &amp;quot;Hello World&amp;quot;. This is the link detailed in the component&#039;s manifest file. If you click it, you should see the &amp;quot;Hello World&amp;quot; page. &lt;br /&gt;
&lt;br /&gt;
Congratulations! You&#039;ve created your first Joomla! component. Now, let&#039;s start making it useful.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Introduction|Prev: Introduction|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_View_to_the_Site_Part|Next: Adding a View to the Site Part|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Joomla!_4.x]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
[[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>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/en&amp;diff=771223</id>
		<title>Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!4.x - Contents/en</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!4.x_-_Contents/en&amp;diff=771223"/>
		<updated>2020-12-15T01:40:33Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Undo revision 771221 by GregJPreece (talk)&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;div class=&amp;quot;large-4 columns&amp;quot; style=&amp;quot;float:right; background:#fff;margin:0 0 1.0em 1.0em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-12 columns panel radius mw-collapsible&amp;quot; style=&amp;quot;width:100%;background:#fff;font-size:.8em&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&#039;&#039;&#039;Articles in this Series&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-12 columns panel mw-collapsible-content&amp;quot; style=&amp;quot;border:none; background:#fff; min-width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Introduction|Introduction]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Developing a Basic Component]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{-}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials in a Series{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component&amp;diff=771222</id>
		<title>J4.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=J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component&amp;diff=771222"/>
		<updated>2020-12-15T01:38:29Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}}&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=Developing a Basic Component}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Your First Component ==&lt;br /&gt;
&lt;br /&gt;
In this article we will cover how to create and install a basic Joomla! component, which we will inventively call the &amp;quot;Hello World&amp;quot; component.&lt;br /&gt;
&lt;br /&gt;
To begin, you must first use your preferred file manager to create a directory for the Hello World! component. This directory can be anywhere on your file system, as long as it is outside of your Joomla! installation directory. For this example we will name the directory &amp;lt;tt&amp;gt;com_helloworld&amp;lt;/tt&amp;gt;, because that is how a component directory looks once it&#039;s inside Joomla. (The &amp;lt;tt&amp;gt;com&amp;lt;/tt&amp;gt; prefix means &amp;quot;component&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Next, inside this directory we need to create some files. Using your preferred file manager, create the following files; as you create the files, add the source code for each file which can be found in [[#File Details|File Details]]. &lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
 | 1&lt;br /&gt;
 | &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
 | An XML manifest file that tells Joomla! how to install our component.&lt;br /&gt;
 |-&lt;br /&gt;
 | 2&lt;br /&gt;
 | &#039;&#039;[[#admin/services/provider.php|admin/services/provider.php]]&#039;&#039;&lt;br /&gt;
 | Tells Joomla! how to initialise the component&lt;br /&gt;
 |-&lt;br /&gt;
 | 3&lt;br /&gt;
 | &#039;&#039;[[#admin/src/Controller/DisplayController|admin/src/Controller/DisplayController]]&#039;&#039;&lt;br /&gt;
 | The MVC Controller for the &amp;quot;Hello World&amp;quot; page we&#039;ll start with.&lt;br /&gt;
 |-&lt;br /&gt;
 | 4&lt;br /&gt;
 | &#039;&#039;[[#admin/src/View/Test/HtmlView.php|admin/src/View/Test/HtmlView.php]]&#039;&#039;&lt;br /&gt;
 | The MVC View for the &amp;quot;Hello World&amp;quot; page we&#039;ll start with.&lt;br /&gt;
 |-&lt;br /&gt;
 | 5&lt;br /&gt;
 | &#039;&#039;[[#admin/tmpl/test/default.php|admin/tmpl/test/default.php]]&#039;&#039;&lt;br /&gt;
 | The HTML/PHP template for the &amp;quot;Hello World&amp;quot; page&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== File Details ==&lt;br /&gt;
&lt;br /&gt;
{{vanchor|helloworld.xml}}&lt;br /&gt;
&lt;br /&gt;
This is a manifest file, which describes the component and its configuration to Joomla! It is utilised during installation to copy the component&#039;s files into the correct locations, trigger database installation, configure the component&#039;s PHP namespace, and so on.&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;component&amp;quot; version=&amp;quot;4.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;name&amp;gt;Hello World&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;December 2020&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Dummy author, feel free to replace anywhere you see it--&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;John Smith&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;https://smith.ca&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;John Smith&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GPL v3&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;&lt;br /&gt;
        A hello world component!&lt;br /&gt;
    &amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- This is the PHP namespace under which the extension&#039;s&lt;br /&gt;
    code is organised. It should follow this format:&lt;br /&gt;
    &lt;br /&gt;
    Vendor\Component\ComponentName&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Vendor&amp;quot; can be your company or your own name&lt;br /&gt;
    &lt;br /&gt;
    The &amp;quot;ComponentName&amp;quot; section MUST match the name used &lt;br /&gt;
    everywhere else for your component. Whatever the name of &lt;br /&gt;
    this XML file is, the namespace must match (ignoring CamelCase). &lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;namespace path=&amp;quot;src/&amp;quot;&amp;gt;JohnSmith\Component\HelloWorld&amp;lt;/namespace&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
    &amp;lt;administration&amp;gt;&lt;br /&gt;
        &amp;lt;!-- The link that will appear in the Admin panel&#039;s &amp;quot;Components&amp;quot; menu --&amp;gt;&lt;br /&gt;
        &amp;lt;menu link=&amp;quot;index.php?option=com_helloworld&amp;quot;&amp;gt;Hello World&amp;lt;/menu&amp;gt;&lt;br /&gt;
        &amp;lt;!-- List of files and folders to copy, and where to copy them --&amp;gt;&lt;br /&gt;
        &amp;lt;files folder=&amp;quot;admin/&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;services&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;src&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;tmpl&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|admin/services/provider.php}}&lt;br /&gt;
&lt;br /&gt;
This is a special file that tells Joomla! how to initialise the component - which services it requires and how they should be provided.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface;&lt;br /&gt;
use Joomla\CMS\Extension\ComponentInterface;&lt;br /&gt;
use Joomla\CMS\Extension\MVCComponent;&lt;br /&gt;
use Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory;&lt;br /&gt;
use Joomla\CMS\Extension\Service\Provider\MVCFactory;&lt;br /&gt;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;&lt;br /&gt;
use Joomla\DI\Container;&lt;br /&gt;
use Joomla\DI\ServiceProviderInterface;&lt;br /&gt;
&lt;br /&gt;
return new class implements ServiceProviderInterface {&lt;br /&gt;
    &lt;br /&gt;
    public function register(Container $container): void {&lt;br /&gt;
        $container-&amp;gt;registerServiceProvider(new MVCFactory(&#039;\\JohnSmith\\Component\\HelloWorld&#039;));&lt;br /&gt;
        $container-&amp;gt;registerServiceProvider(new ComponentDispatcherFactory(&#039;\\JohnSmith\\Component\\HelloWorld&#039;));&lt;br /&gt;
        $container-&amp;gt;set(&lt;br /&gt;
            ComponentInterface::class,&lt;br /&gt;
            function (Container $container) {&lt;br /&gt;
                $component = new MVCComponent($container-&amp;gt;get(ComponentDispatcherFactoryInterface::class));&lt;br /&gt;
                $component-&amp;gt;setMVCFactory($container-&amp;gt;get(MVCFactoryInterface::class));&lt;br /&gt;
&lt;br /&gt;
                return $component;&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;
{{vanchor|admin/src/Controller/DisplayController}}&lt;br /&gt;
&lt;br /&gt;
The MVC controller for our first view, &amp;quot;test&amp;quot;. As our component grows in complexity, a page&#039;s controller will handle model fetching, form submissions, and so on. Here, it simply sets its default view and leaves the rest to its parent.&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;
namespace JohnSmith\Component\HelloWorld\Administrator\Controller;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\MVC\Controller\BaseController;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Default Controller of HelloWorld component&lt;br /&gt;
 *&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 */&lt;br /&gt;
class DisplayController extends BaseController {&lt;br /&gt;
    /**&lt;br /&gt;
     * The default view for the display method.&lt;br /&gt;
     *&lt;br /&gt;
     * @var string&lt;br /&gt;
     */&lt;br /&gt;
    protected $default_view = &#039;test&#039;;&lt;br /&gt;
    &lt;br /&gt;
    public function display($cachable = false, $urlparams = array()) {&lt;br /&gt;
        return parent::display();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|admin/src/View/Test/HtmlView.php}}&lt;br /&gt;
&lt;br /&gt;
This is the MVC view object for our first page. The job of a view object is to handle the setup work for a view template - selecting a layout, fetching Javascript, generating toolbars, etc. To simply get our &amp;quot;hello world&amp;quot; page to load, we will delegate the work of initialising the view to Joomla!&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;
namespace JohnSmith\Component\HelloWorld\Administrator\View\Test;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Main &amp;quot;Hello World&amp;quot; Admin View&lt;br /&gt;
 */&lt;br /&gt;
class HtmlView extends BaseHtmlView {&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Display the main &amp;quot;Hello World&amp;quot; view&lt;br /&gt;
     *&lt;br /&gt;
     * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.&lt;br /&gt;
     * @return  void&lt;br /&gt;
     */&lt;br /&gt;
    function display($tpl = null) {&lt;br /&gt;
        parent::display($tpl);&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;
{{vanchor|admin/tmpl/test/default.php}}&lt;br /&gt;
&lt;br /&gt;
This file holds the template for the page. It is used to render the page utilising the setup done by the view object.&lt;br /&gt;
&lt;br /&gt;
When no specific layout is requested for a view, Joomla! will load the template in the &amp;lt;tt&amp;gt;default.php&amp;lt;/tt&amp;gt; file, which is why we&#039;re using that filename.&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;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted Access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Hello world!&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing the Component ==&lt;br /&gt;
&lt;br /&gt;
Using your preferred file manager, create a .zip file of the &amp;lt;tt&amp;gt;com_helloworld&amp;lt;/tt&amp;gt; directory - include the directory itself and make sure to preserve the directory structure.&lt;br /&gt;
&lt;br /&gt;
Now we need to install the component. Follow this process:&lt;br /&gt;
&lt;br /&gt;
# Using your web browser, navigate to the Administrator panel of your Joomla! site. The address would be &amp;lt;tt&amp;gt;&amp;lt;joomla&amp;gt;/administrator/&amp;lt;/tt&amp;gt;. For example: &amp;lt;tt&amp;gt;http://localhost/joomla/administrator/&amp;lt;/tt&amp;gt;&lt;br /&gt;
# On the left menu, click the &amp;quot;System&amp;quot; link.&lt;br /&gt;
# On the &amp;quot;Install&amp;quot; card, click &amp;quot;Extensions&amp;quot;.&lt;br /&gt;
# On the &amp;quot;Upload Package File&amp;quot; tab, browse for and select the .zip file you just created.&lt;br /&gt;
&lt;br /&gt;
The page should automatically process the installation of the component, and you will receive a message telling you whether it was successful or not.&lt;br /&gt;
&lt;br /&gt;
== Testing the Component ==&lt;br /&gt;
&lt;br /&gt;
Once the component is installed, click the &amp;quot;Components&amp;quot; section of the menu on the left of the admin panel. You should now see a new link under this section labelled &amp;quot;Hello World&amp;quot;. This is the link detailed in the component&#039;s manifest file. If you click it, you should see the &amp;quot;Hello World&amp;quot; page. &lt;br /&gt;
&lt;br /&gt;
Congratulations! You&#039;ve created your first Joomla! component. Now, let&#039;s start making it useful.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Introduction|Prev: Introduction|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_View_to_the_Site_Part|Next: Adding a View to the Site Part|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Joomla!_4.x]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
[[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>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/en&amp;diff=771221</id>
		<title>Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!4.x - Contents/en</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!4.x_-_Contents/en&amp;diff=771221"/>
		<updated>2020-12-15T01:38:22Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-4 columns&amp;quot; style=&amp;quot;float:right; background:#fff;margin:0 0 1.0em 1.0em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-12 columns panel radius mw-collapsible&amp;quot; style=&amp;quot;width:100%;background:#fff;font-size:.8em&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&#039;&#039;&#039;Articles in this Series&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-12 columns panel mw-collapsible-content&amp;quot; style=&amp;quot;border:none; background:#fff; min-width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Introduction|Introduction]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Developing a Basic Component]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This article is part of the tutorial [[J4.x:Developing_an_MVC_Component/Introduction|&amp;quot;Developing an MVC Component for Joomla 4.x&amp;quot;]]. It is intended to be a follow-along programming tutorial, so if you have not read the previous parts of the tutorial you are encouraged to do so.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{-}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials in a Series{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/en&amp;diff=771220</id>
		<title>Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!4.x - Contents/en</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!4.x_-_Contents/en&amp;diff=771220"/>
		<updated>2020-12-14T22:45:17Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Fixing Introduction page link&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;div class=&amp;quot;large-4 columns&amp;quot; style=&amp;quot;float:right; background:#fff;margin:0 0 1.0em 1.0em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-12 columns panel radius mw-collapsible&amp;quot; style=&amp;quot;width:100%;background:#fff;font-size:.8em&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&#039;&#039;&#039;Articles in this Series&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-12 columns panel mw-collapsible-content&amp;quot; style=&amp;quot;border:none; background:#fff; min-width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Introduction|Introduction]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Developing a Basic Component]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{-}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials in a Series{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component&amp;diff=771219</id>
		<title>J4.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=J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component&amp;diff=771219"/>
		<updated>2020-12-14T22:44:26Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Adding tutorial series index&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}}&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=Developing a Basic Component}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
This article is part of the tutorial [[J4.x:Developing_an_MVC_Component/Introduction|&amp;quot;Developing an MVC Component for Joomla 4.x&amp;quot;]]. It is intended to be a follow-along programming tutorial, so if you have not read the previous parts of the tutorial you are encouraged to do so.&lt;br /&gt;
&lt;br /&gt;
== Your First Component ==&lt;br /&gt;
&lt;br /&gt;
In this article we will cover how to create and install a basic Joomla! component, which we will inventively call the &amp;quot;Hello World&amp;quot; component.&lt;br /&gt;
&lt;br /&gt;
To begin, you must first use your preferred file manager to create a directory for the Hello World! component. This directory can be anywhere on your file system, as long as it is outside of your Joomla! installation directory. For this example we will name the directory &amp;lt;tt&amp;gt;com_helloworld&amp;lt;/tt&amp;gt;, because that is how a component directory looks once it&#039;s inside Joomla. (The &amp;lt;tt&amp;gt;com&amp;lt;/tt&amp;gt; prefix means &amp;quot;component&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Next, inside this directory we need to create some files. Using your preferred file manager, create the following files; as you create the files, add the source code for each file which can be found in [[#File Details|File Details]]. &lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
 | 1&lt;br /&gt;
 | &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
 | An XML manifest file that tells Joomla! how to install our component.&lt;br /&gt;
 |-&lt;br /&gt;
 | 2&lt;br /&gt;
 | &#039;&#039;[[#admin/services/provider.php|admin/services/provider.php]]&#039;&#039;&lt;br /&gt;
 | Tells Joomla! how to initialise the component&lt;br /&gt;
 |-&lt;br /&gt;
 | 3&lt;br /&gt;
 | &#039;&#039;[[#admin/src/Controller/DisplayController|admin/src/Controller/DisplayController]]&#039;&#039;&lt;br /&gt;
 | The MVC Controller for the &amp;quot;Hello World&amp;quot; page we&#039;ll start with.&lt;br /&gt;
 |-&lt;br /&gt;
 | 4&lt;br /&gt;
 | &#039;&#039;[[#admin/src/View/Test/HtmlView.php|admin/src/View/Test/HtmlView.php]]&#039;&#039;&lt;br /&gt;
 | The MVC View for the &amp;quot;Hello World&amp;quot; page we&#039;ll start with.&lt;br /&gt;
 |-&lt;br /&gt;
 | 5&lt;br /&gt;
 | &#039;&#039;[[#admin/tmpl/test/default.php|admin/tmpl/test/default.php]]&#039;&#039;&lt;br /&gt;
 | The HTML/PHP template for the &amp;quot;Hello World&amp;quot; page&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== File Details ==&lt;br /&gt;
&lt;br /&gt;
{{vanchor|helloworld.xml}}&lt;br /&gt;
&lt;br /&gt;
This is a manifest file, which describes the component and its configuration to Joomla! It is utilised during installation to copy the component&#039;s files into the correct locations, trigger database installation, configure the component&#039;s PHP namespace, and so on.&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;component&amp;quot; version=&amp;quot;4.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;name&amp;gt;Hello World&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;December 2020&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Dummy author, feel free to replace anywhere you see it--&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;John Smith&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;https://smith.ca&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;John Smith&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GPL v3&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;&lt;br /&gt;
        A hello world component!&lt;br /&gt;
    &amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- This is the PHP namespace under which the extension&#039;s&lt;br /&gt;
    code is organised. It should follow this format:&lt;br /&gt;
    &lt;br /&gt;
    Vendor\Component\ComponentName&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Vendor&amp;quot; can be your company or your own name&lt;br /&gt;
    &lt;br /&gt;
    The &amp;quot;ComponentName&amp;quot; section MUST match the name used &lt;br /&gt;
    everywhere else for your component. Whatever the name of &lt;br /&gt;
    this XML file is, the namespace must match (ignoring CamelCase). &lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;namespace path=&amp;quot;src/&amp;quot;&amp;gt;JohnSmith\Component\HelloWorld&amp;lt;/namespace&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
    &amp;lt;administration&amp;gt;&lt;br /&gt;
        &amp;lt;!-- The link that will appear in the Admin panel&#039;s &amp;quot;Components&amp;quot; menu --&amp;gt;&lt;br /&gt;
        &amp;lt;menu link=&amp;quot;index.php?option=com_helloworld&amp;quot;&amp;gt;Hello World&amp;lt;/menu&amp;gt;&lt;br /&gt;
        &amp;lt;!-- List of files and folders to copy, and where to copy them --&amp;gt;&lt;br /&gt;
        &amp;lt;files folder=&amp;quot;admin/&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;services&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;src&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;tmpl&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|admin/services/provider.php}}&lt;br /&gt;
&lt;br /&gt;
This is a special file that tells Joomla! how to initialise the component - which services it requires and how they should be provided.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface;&lt;br /&gt;
use Joomla\CMS\Extension\ComponentInterface;&lt;br /&gt;
use Joomla\CMS\Extension\MVCComponent;&lt;br /&gt;
use Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory;&lt;br /&gt;
use Joomla\CMS\Extension\Service\Provider\MVCFactory;&lt;br /&gt;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;&lt;br /&gt;
use Joomla\DI\Container;&lt;br /&gt;
use Joomla\DI\ServiceProviderInterface;&lt;br /&gt;
&lt;br /&gt;
return new class implements ServiceProviderInterface {&lt;br /&gt;
    &lt;br /&gt;
    public function register(Container $container): void {&lt;br /&gt;
        $container-&amp;gt;registerServiceProvider(new MVCFactory(&#039;\\JohnSmith\\Component\\HelloWorld&#039;));&lt;br /&gt;
        $container-&amp;gt;registerServiceProvider(new ComponentDispatcherFactory(&#039;\\JohnSmith\\Component\\HelloWorld&#039;));&lt;br /&gt;
        $container-&amp;gt;set(&lt;br /&gt;
            ComponentInterface::class,&lt;br /&gt;
            function (Container $container) {&lt;br /&gt;
                $component = new MVCComponent($container-&amp;gt;get(ComponentDispatcherFactoryInterface::class));&lt;br /&gt;
                $component-&amp;gt;setMVCFactory($container-&amp;gt;get(MVCFactoryInterface::class));&lt;br /&gt;
&lt;br /&gt;
                return $component;&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;
{{vanchor|admin/src/Controller/DisplayController}}&lt;br /&gt;
&lt;br /&gt;
The MVC controller for our first view, &amp;quot;test&amp;quot;. As our component grows in complexity, a page&#039;s controller will handle model fetching, form submissions, and so on. Here, it simply sets its default view and leaves the rest to its parent.&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;
namespace JohnSmith\Component\HelloWorld\Administrator\Controller;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\MVC\Controller\BaseController;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Default Controller of HelloWorld component&lt;br /&gt;
 *&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 */&lt;br /&gt;
class DisplayController extends BaseController {&lt;br /&gt;
    /**&lt;br /&gt;
     * The default view for the display method.&lt;br /&gt;
     *&lt;br /&gt;
     * @var string&lt;br /&gt;
     */&lt;br /&gt;
    protected $default_view = &#039;test&#039;;&lt;br /&gt;
    &lt;br /&gt;
    public function display($cachable = false, $urlparams = array()) {&lt;br /&gt;
        return parent::display();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|admin/src/View/Test/HtmlView.php}}&lt;br /&gt;
&lt;br /&gt;
This is the MVC view object for our first page. The job of a view object is to handle the setup work for a view template - selecting a layout, fetching Javascript, generating toolbars, etc. To simply get our &amp;quot;hello world&amp;quot; page to load, we will delegate the work of initialising the view to Joomla!&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;
namespace JohnSmith\Component\HelloWorld\Administrator\View\Test;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Main &amp;quot;Hello World&amp;quot; Admin View&lt;br /&gt;
 */&lt;br /&gt;
class HtmlView extends BaseHtmlView {&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Display the main &amp;quot;Hello World&amp;quot; view&lt;br /&gt;
     *&lt;br /&gt;
     * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.&lt;br /&gt;
     * @return  void&lt;br /&gt;
     */&lt;br /&gt;
    function display($tpl = null) {&lt;br /&gt;
        parent::display($tpl);&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;
{{vanchor|admin/tmpl/test/default.php}}&lt;br /&gt;
&lt;br /&gt;
This file holds the template for the page. It is used to render the page utilising the setup done by the view object.&lt;br /&gt;
&lt;br /&gt;
When no specific layout is requested for a view, Joomla! will load the template in the &amp;lt;tt&amp;gt;default.php&amp;lt;/tt&amp;gt; file, which is why we&#039;re using that filename.&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;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted Access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Hello world!&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing the Component ==&lt;br /&gt;
&lt;br /&gt;
Using your preferred file manager, create a .zip file of the &amp;lt;tt&amp;gt;com_helloworld&amp;lt;/tt&amp;gt; directory - include the directory itself and make sure to preserve the directory structure.&lt;br /&gt;
&lt;br /&gt;
Now we need to install the component. Follow this process:&lt;br /&gt;
&lt;br /&gt;
# Using your web browser, navigate to the Administrator panel of your Joomla! site. The address would be &amp;lt;tt&amp;gt;&amp;lt;joomla&amp;gt;/administrator/&amp;lt;/tt&amp;gt;. For example: &amp;lt;tt&amp;gt;http://localhost/joomla/administrator/&amp;lt;/tt&amp;gt;&lt;br /&gt;
# On the left menu, click the &amp;quot;System&amp;quot; link.&lt;br /&gt;
# On the &amp;quot;Install&amp;quot; card, click &amp;quot;Extensions&amp;quot;.&lt;br /&gt;
# On the &amp;quot;Upload Package File&amp;quot; tab, browse for and select the .zip file you just created.&lt;br /&gt;
&lt;br /&gt;
The page should automatically process the installation of the component, and you will receive a message telling you whether it was successful or not.&lt;br /&gt;
&lt;br /&gt;
== Testing the Component ==&lt;br /&gt;
&lt;br /&gt;
Once the component is installed, click the &amp;quot;Components&amp;quot; section of the menu on the left of the admin panel. You should now see a new link under this section labelled &amp;quot;Hello World&amp;quot;. This is the link detailed in the component&#039;s manifest file. If you click it, you should see the &amp;quot;Hello World&amp;quot; page. &lt;br /&gt;
&lt;br /&gt;
Congratulations! You&#039;ve created your first Joomla! component. Now, let&#039;s start making it useful.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Introduction|Prev: Introduction|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_View_to_the_Site_Part|Next: Adding a View to the Site Part|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Joomla!_4.x]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
[[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>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Introduction&amp;diff=771218</id>
		<title>J4.x:Developing an MVC Component/Introduction</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Introduction&amp;diff=771218"/>
		<updated>2020-12-14T22:43:12Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Adding tutorial series index&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}}&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=Developing an MVC Component for Joomla 4.x}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
This tutorial will teach you how to develop a component for Joomla 4.x. A component is a type of Joomla extension that provides its own pages to the user, rather than augmenting existing content. A component is the most powerful type of Joomla extension, able to add a large amount of new functionality to a site.&lt;br /&gt;
&lt;br /&gt;
Joomla components are split into two main parts: an administrator part and a site part. The administrator part provides an interface to manage the component, and the site part provides the pages requested by users visiting the website. This tutorial will teach you how to construct both parts.&lt;br /&gt;
&lt;br /&gt;
For a more detailed overview of Components and the Model-View-Controller design pattern they use, please see the [[Absolute_Basics_of_How_a_Component_Functions|Component Basics Guide]]. However, please be aware that the specific file structure, naming standards and code detailed in the guide relate to Joomla 3.x, and should be ignored for the purposes of this tutorial.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
You will need to have Joomla 4.x for this tutorial. Developing for Joomla 4.x requires: &lt;br /&gt;
&lt;br /&gt;
* A minimum PHP version of 7.2.5 to be installed&lt;br /&gt;
* Composer, to manage PHP dependencies&lt;br /&gt;
* NodeJS version 10 or above, to manage front-end dependencies&lt;br /&gt;
* A MySQL database of version 5.6 or above, &#039;&#039;&#039;or&#039;&#039;&#039;&lt;br /&gt;
* A PostgreSQL database of version 11 or above&lt;br /&gt;
* The Git version control system&lt;br /&gt;
&lt;br /&gt;
If you have not set up a local development environment, you will need to do so before attempting this tutorial. To set up your local development environment, please consult the [[J4.x:Setting_Up_Your_Local_Environment|Local Environment Guide]].&lt;br /&gt;
&lt;br /&gt;
== Migrating from Joomla 3.x ==&lt;br /&gt;
&lt;br /&gt;
For the majority of cases, migrating from Joomla 3.x to 4.x is a straightforward process. Most of the changes needed are naming/namespacing changes and moving files around. This author intends to create a migration guide once this tutorial is complete, which will be linked here.&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
* [[User:Ribafs|Ribafs]] (Authored Joomla 3.x version)&lt;br /&gt;
* [[User:Kevinkabatra | Kevin Kabatra]] (Authored Joomla 3.x version)&lt;br /&gt;
* [[User:GregJPreece | Greg J Preece]] (Rewriting 3.x guide for 4.x)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component|Prev: Overview|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Next: Developing a Basic Component|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Joomla!_4.x]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
[[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>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component&amp;diff=771217</id>
		<title>J4.x:Developing an MVC Component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component&amp;diff=771217"/>
		<updated>2020-12-14T22:40:54Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Adding tutorial series index&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;Tutorial}}&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;Developing an MVC Component for Joomla 4.x&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/&amp;lt;translate&amp;gt;en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;translate&amp;gt;This is intended to be a multiple-article series of tutorials on how to develop a Model-View-Controller [[S:MyLanguage/Component|Component]] for Joomla! Version 4.x. &amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Under Construction==&lt;br /&gt;
&lt;br /&gt;
This section of the documentation is currently under heavy work, rewriting the Joomla 3 tutorial to be up-to-date. Joomla 4 is also still in the beta stage at the time of writing. While the information here should remain accurate, please be aware that pages will be missing and details may change until this notice is removed.&lt;br /&gt;
&lt;br /&gt;
As per the [[JDOC:Page_Translation_Explained|Page Translation Guide]], translation tagging will not be added to this tutorial until it is complete and the text is stabilised.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;large-4 columns&amp;quot;&amp;gt;{{Basic button|&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Introduction|Let&#039;s start with the introduction&amp;lt;/translate&amp;gt;|class=expand success}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Joomla!_4.x]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
[[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>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Chunk:Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!4.x_-_Contents/en&amp;diff=771216</id>
		<title>Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!4.x - Contents/en</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!4.x_-_Contents/en&amp;diff=771216"/>
		<updated>2020-12-14T22:37:34Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Created page with &amp;quot;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt; &amp;lt;div class=&amp;quot;large-4 columns&amp;quot; style=&amp;quot;float:right; background:#fff;margin:0 0 1.0em 1.0em;&amp;quot;&amp;gt; &amp;lt;div class=&amp;quot;large-12 columns panel radius mw-co...&amp;quot;&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;div class=&amp;quot;large-4 columns&amp;quot; style=&amp;quot;float:right; background:#fff;margin:0 0 1.0em 1.0em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-12 columns panel radius mw-collapsible&amp;quot; style=&amp;quot;width:100%;background:#fff;font-size:.8em&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&#039;&#039;&#039;Articles in this Series&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-12 columns panel mw-collapsible-content&amp;quot; style=&amp;quot;border:none; background:#fff; min-width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
# [[S:MyLanguage/S:MyLanguage/J4.x:Developing_an_MVC_Component/Introduction|Introduction]]&lt;br /&gt;
# [[S:MyLanguage/J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Developing a Basic Component]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{-}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Tutorials in a Series{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component&amp;diff=771215</id>
		<title>J4.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=J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component&amp;diff=771215"/>
		<updated>2020-12-14T22:15:16Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Created page with &amp;quot;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}} {{-}} {{Top portal heading|color=white-bkgd|icon=file-code-o|icon-color=#5091cd|size=5x|text-color=#333|title=Developing a Bas...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}}&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=Developing a Basic Component}}&lt;br /&gt;
{{-}}&lt;br /&gt;
&lt;br /&gt;
This article is part of the tutorial [[J4.x:Developing_an_MVC_Component/Introduction|&amp;quot;Developing an MVC Component for Joomla 4.x&amp;quot;]]. It is intended to be a follow-along programming tutorial, so if you have not read the previous parts of the tutorial you are encouraged to do so.&lt;br /&gt;
&lt;br /&gt;
== Your First Component ==&lt;br /&gt;
&lt;br /&gt;
In this article we will cover how to create and install a basic Joomla! component, which we will inventively call the &amp;quot;Hello World&amp;quot; component.&lt;br /&gt;
&lt;br /&gt;
To begin, you must first use your preferred file manager to create a directory for the Hello World! component. This directory can be anywhere on your file system, as long as it is outside of your Joomla! installation directory. For this example we will name the directory &amp;lt;tt&amp;gt;com_helloworld&amp;lt;/tt&amp;gt;, because that is how a component directory looks once it&#039;s inside Joomla. (The &amp;lt;tt&amp;gt;com&amp;lt;/tt&amp;gt; prefix means &amp;quot;component&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Next, inside this directory we need to create some files. Using your preferred file manager, create the following files; as you create the files, add the source code for each file which can be found in [[#File Details|File Details]]. &lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
 | 1&lt;br /&gt;
 | &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
 | An XML manifest file that tells Joomla! how to install our component.&lt;br /&gt;
 |-&lt;br /&gt;
 | 2&lt;br /&gt;
 | &#039;&#039;[[#admin/services/provider.php|admin/services/provider.php]]&#039;&#039;&lt;br /&gt;
 | Tells Joomla! how to initialise the component&lt;br /&gt;
 |-&lt;br /&gt;
 | 3&lt;br /&gt;
 | &#039;&#039;[[#admin/src/Controller/DisplayController|admin/src/Controller/DisplayController]]&#039;&#039;&lt;br /&gt;
 | The MVC Controller for the &amp;quot;Hello World&amp;quot; page we&#039;ll start with.&lt;br /&gt;
 |-&lt;br /&gt;
 | 4&lt;br /&gt;
 | &#039;&#039;[[#admin/src/View/Test/HtmlView.php|admin/src/View/Test/HtmlView.php]]&#039;&#039;&lt;br /&gt;
 | The MVC View for the &amp;quot;Hello World&amp;quot; page we&#039;ll start with.&lt;br /&gt;
 |-&lt;br /&gt;
 | 5&lt;br /&gt;
 | &#039;&#039;[[#admin/tmpl/test/default.php|admin/tmpl/test/default.php]]&#039;&#039;&lt;br /&gt;
 | The HTML/PHP template for the &amp;quot;Hello World&amp;quot; page&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== File Details ==&lt;br /&gt;
&lt;br /&gt;
{{vanchor|helloworld.xml}}&lt;br /&gt;
&lt;br /&gt;
This is a manifest file, which describes the component and its configuration to Joomla! It is utilised during installation to copy the component&#039;s files into the correct locations, trigger database installation, configure the component&#039;s PHP namespace, and so on.&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;component&amp;quot; version=&amp;quot;4.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;name&amp;gt;Hello World&amp;lt;/name&amp;gt;&lt;br /&gt;
    &amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
    &amp;lt;creationDate&amp;gt;December 2020&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Dummy author, feel free to replace anywhere you see it--&amp;gt;&lt;br /&gt;
    &amp;lt;author&amp;gt;John Smith&amp;lt;/author&amp;gt;&lt;br /&gt;
    &amp;lt;authorUrl&amp;gt;https://smith.ca&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
    &amp;lt;copyright&amp;gt;John Smith&amp;lt;/copyright&amp;gt;&lt;br /&gt;
    &amp;lt;license&amp;gt;GPL v3&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;&lt;br /&gt;
        A hello world component!&lt;br /&gt;
    &amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- This is the PHP namespace under which the extension&#039;s&lt;br /&gt;
    code is organised. It should follow this format:&lt;br /&gt;
    &lt;br /&gt;
    Vendor\Component\ComponentName&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;Vendor&amp;quot; can be your company or your own name&lt;br /&gt;
    &lt;br /&gt;
    The &amp;quot;ComponentName&amp;quot; section MUST match the name used &lt;br /&gt;
    everywhere else for your component. Whatever the name of &lt;br /&gt;
    this XML file is, the namespace must match (ignoring CamelCase). &lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;namespace path=&amp;quot;src/&amp;quot;&amp;gt;JohnSmith\Component\HelloWorld&amp;lt;/namespace&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
    &amp;lt;administration&amp;gt;&lt;br /&gt;
        &amp;lt;!-- The link that will appear in the Admin panel&#039;s &amp;quot;Components&amp;quot; menu --&amp;gt;&lt;br /&gt;
        &amp;lt;menu link=&amp;quot;index.php?option=com_helloworld&amp;quot;&amp;gt;Hello World&amp;lt;/menu&amp;gt;&lt;br /&gt;
        &amp;lt;!-- List of files and folders to copy, and where to copy them --&amp;gt;&lt;br /&gt;
        &amp;lt;files folder=&amp;quot;admin/&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;services&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;src&amp;lt;/folder&amp;gt;&lt;br /&gt;
            &amp;lt;folder&amp;gt;tmpl&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|admin/services/provider.php}}&lt;br /&gt;
&lt;br /&gt;
This is a special file that tells Joomla! how to initialise the component - which services it requires and how they should be provided.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface;&lt;br /&gt;
use Joomla\CMS\Extension\ComponentInterface;&lt;br /&gt;
use Joomla\CMS\Extension\MVCComponent;&lt;br /&gt;
use Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory;&lt;br /&gt;
use Joomla\CMS\Extension\Service\Provider\MVCFactory;&lt;br /&gt;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;&lt;br /&gt;
use Joomla\DI\Container;&lt;br /&gt;
use Joomla\DI\ServiceProviderInterface;&lt;br /&gt;
&lt;br /&gt;
return new class implements ServiceProviderInterface {&lt;br /&gt;
    &lt;br /&gt;
    public function register(Container $container): void {&lt;br /&gt;
        $container-&amp;gt;registerServiceProvider(new MVCFactory(&#039;\\JohnSmith\\Component\\HelloWorld&#039;));&lt;br /&gt;
        $container-&amp;gt;registerServiceProvider(new ComponentDispatcherFactory(&#039;\\JohnSmith\\Component\\HelloWorld&#039;));&lt;br /&gt;
        $container-&amp;gt;set(&lt;br /&gt;
            ComponentInterface::class,&lt;br /&gt;
            function (Container $container) {&lt;br /&gt;
                $component = new MVCComponent($container-&amp;gt;get(ComponentDispatcherFactoryInterface::class));&lt;br /&gt;
                $component-&amp;gt;setMVCFactory($container-&amp;gt;get(MVCFactoryInterface::class));&lt;br /&gt;
&lt;br /&gt;
                return $component;&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;
{{vanchor|admin/src/Controller/DisplayController}}&lt;br /&gt;
&lt;br /&gt;
The MVC controller for our first view, &amp;quot;test&amp;quot;. As our component grows in complexity, a page&#039;s controller will handle model fetching, form submissions, and so on. Here, it simply sets its default view and leaves the rest to its parent.&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;
namespace JohnSmith\Component\HelloWorld\Administrator\Controller;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\MVC\Controller\BaseController;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Default Controller of HelloWorld component&lt;br /&gt;
 *&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 */&lt;br /&gt;
class DisplayController extends BaseController {&lt;br /&gt;
    /**&lt;br /&gt;
     * The default view for the display method.&lt;br /&gt;
     *&lt;br /&gt;
     * @var string&lt;br /&gt;
     */&lt;br /&gt;
    protected $default_view = &#039;test&#039;;&lt;br /&gt;
    &lt;br /&gt;
    public function display($cachable = false, $urlparams = array()) {&lt;br /&gt;
        return parent::display();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{vanchor|admin/src/View/Test/HtmlView.php}}&lt;br /&gt;
&lt;br /&gt;
This is the MVC view object for our first page. The job of a view object is to handle the setup work for a view template - selecting a layout, fetching Javascript, generating toolbars, etc. To simply get our &amp;quot;hello world&amp;quot; page to load, we will delegate the work of initialising the view to Joomla!&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;
namespace JohnSmith\Component\HelloWorld\Administrator\View\Test;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Main &amp;quot;Hello World&amp;quot; Admin View&lt;br /&gt;
 */&lt;br /&gt;
class HtmlView extends BaseHtmlView {&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Display the main &amp;quot;Hello World&amp;quot; view&lt;br /&gt;
     *&lt;br /&gt;
     * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.&lt;br /&gt;
     * @return  void&lt;br /&gt;
     */&lt;br /&gt;
    function display($tpl = null) {&lt;br /&gt;
        parent::display($tpl);&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;
{{vanchor|admin/tmpl/test/default.php}}&lt;br /&gt;
&lt;br /&gt;
This file holds the template for the page. It is used to render the page utilising the setup done by the view object.&lt;br /&gt;
&lt;br /&gt;
When no specific layout is requested for a view, Joomla! will load the template in the &amp;lt;tt&amp;gt;default.php&amp;lt;/tt&amp;gt; file, which is why we&#039;re using that filename.&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;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2020 John Smith. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 3; see LICENSE&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted Access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Hello world!&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing the Component ==&lt;br /&gt;
&lt;br /&gt;
Using your preferred file manager, create a .zip file of the &amp;lt;tt&amp;gt;com_helloworld&amp;lt;/tt&amp;gt; directory - include the directory itself and make sure to preserve the directory structure.&lt;br /&gt;
&lt;br /&gt;
Now we need to install the component. Follow this process:&lt;br /&gt;
&lt;br /&gt;
# Using your web browser, navigate to the Administrator panel of your Joomla! site. The address would be &amp;lt;tt&amp;gt;&amp;lt;joomla&amp;gt;/administrator/&amp;lt;/tt&amp;gt;. For example: &amp;lt;tt&amp;gt;http://localhost/joomla/administrator/&amp;lt;/tt&amp;gt;&lt;br /&gt;
# On the left menu, click the &amp;quot;System&amp;quot; link.&lt;br /&gt;
# On the &amp;quot;Install&amp;quot; card, click &amp;quot;Extensions&amp;quot;.&lt;br /&gt;
# On the &amp;quot;Upload Package File&amp;quot; tab, browse for and select the .zip file you just created.&lt;br /&gt;
&lt;br /&gt;
The page should automatically process the installation of the component, and you will receive a message telling you whether it was successful or not.&lt;br /&gt;
&lt;br /&gt;
== Testing the Component ==&lt;br /&gt;
&lt;br /&gt;
Once the component is installed, click the &amp;quot;Components&amp;quot; section of the menu on the left of the admin panel. You should now see a new link under this section labelled &amp;quot;Hello World&amp;quot;. This is the link detailed in the component&#039;s manifest file. If you click it, you should see the &amp;quot;Hello World&amp;quot; page. &lt;br /&gt;
&lt;br /&gt;
Congratulations! You&#039;ve created your first Joomla! component. Now, let&#039;s start making it useful.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Introduction|Prev: Introduction|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Adding_a_View_to_the_Site_Part|Next: Adding a View to the Site Part|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Joomla!_4.x]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
[[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>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x_talk:Developing_an_MVC_Component&amp;diff=771197</id>
		<title>J4.x talk:Developing an MVC Component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x_talk:Developing_an_MVC_Component&amp;diff=771197"/>
		<updated>2020-12-13T23:22:35Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Created page with &amp;quot;M-b-o, I appreciate you adding language tagging, but as per the translation guide I am not intending to do so until I am confident the text is correct. --~~~~&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;M-b-o, I appreciate you adding language tagging, but as per the translation guide I am not intending to do so until I am confident the text is correct. --[[User:GregJPreece|GregJPreece]] ([[User talk:GregJPreece|talk]]) 17:22, 13 December 2020 (CST)&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Introduction&amp;diff=771190</id>
		<title>J4.x:Developing an MVC Component/Introduction</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Introduction&amp;diff=771190"/>
		<updated>2020-12-13T01:27:56Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Adding &amp;quot;back&amp;quot; button&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}}&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=Developing an MVC Component for Joomla 4.x}}&lt;br /&gt;
{{-}}&lt;br /&gt;
&lt;br /&gt;
This tutorial will teach you how to develop a component for Joomla 4.x. A component is a type of Joomla extension that provides its own pages to the user, rather than augmenting existing content. A component is the most powerful type of Joomla extension, able to add a large amount of new functionality to a site.&lt;br /&gt;
&lt;br /&gt;
Joomla components are split into two main parts: an administrator part and a site part. The administrator part provides an interface to manage the component, and the site part provides the pages requested by users visiting the website. This tutorial will teach you how to construct both parts.&lt;br /&gt;
&lt;br /&gt;
For a more detailed overview of Components and the Model-View-Controller design pattern they use, please see the [[Absolute_Basics_of_How_a_Component_Functions|Component Basics Guide]]. However, please be aware that the specific file structure, naming standards and code detailed in the guide relate to Joomla 3.x, and should be ignored for the purposes of this tutorial.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
You will need to have Joomla 4.x for this tutorial. Developing for Joomla 4.x requires: &lt;br /&gt;
&lt;br /&gt;
* A minimum PHP version of 7.2.5 to be installed&lt;br /&gt;
* Composer, to manage PHP dependencies&lt;br /&gt;
* NodeJS version 10 or above, to manage front-end dependencies&lt;br /&gt;
* A MySQL database of version 5.6 or above, &#039;&#039;&#039;or&#039;&#039;&#039;&lt;br /&gt;
* A PostgreSQL database of version 11 or above&lt;br /&gt;
* The Git version control system&lt;br /&gt;
&lt;br /&gt;
If you have not set up a local development environment, you will need to do so before attempting this tutorial. To set up your local development environment, please consult the [[J4.x:Setting_Up_Your_Local_Environment|Local Environment Guide]].&lt;br /&gt;
&lt;br /&gt;
== Migrating from Joomla 3.x ==&lt;br /&gt;
&lt;br /&gt;
For the majority of cases, migrating from Joomla 3.x to 4.x is a straightforward process. Most of the changes needed are naming/namespacing changes and moving files around. This author intends to create a migration guide once this tutorial is complete, which will be linked here.&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
* [[User:Ribafs|Ribafs]] (Authored Joomla 3.x version)&lt;br /&gt;
* [[User:Kevinkabatra | Kevin Kabatra]] (Authored Joomla 3.x version)&lt;br /&gt;
* [[User:GregJPreece | Greg J Preece]] (Rewriting 3.x guide for 4.x)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component|Prev: Overview|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Next: Developing a Basic Component|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Joomla!_4.x]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
[[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>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Introduction&amp;diff=771189</id>
		<title>J4.x:Developing an MVC Component/Introduction</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Introduction&amp;diff=771189"/>
		<updated>2020-12-13T01:25:22Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Adding categories&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}}&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=Developing an MVC Component for Joomla 4.x}}&lt;br /&gt;
{{-}}&lt;br /&gt;
&lt;br /&gt;
This tutorial will teach you how to develop a component for Joomla 4.x. A component is a type of Joomla extension that provides its own pages to the user, rather than augmenting existing content. A component is the most powerful type of Joomla extension, able to add a large amount of new functionality to a site.&lt;br /&gt;
&lt;br /&gt;
Joomla components are split into two main parts: an administrator part and a site part. The administrator part provides an interface to manage the component, and the site part provides the pages requested by users visiting the website. This tutorial will teach you how to construct both parts.&lt;br /&gt;
&lt;br /&gt;
For a more detailed overview of Components and the Model-View-Controller design pattern they use, please see the [[Absolute_Basics_of_How_a_Component_Functions|Component Basics Guide]]. However, please be aware that the specific file structure, naming standards and code detailed in the guide relate to Joomla 3.x, and should be ignored for the purposes of this tutorial.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
You will need to have Joomla 4.x for this tutorial. Developing for Joomla 4.x requires: &lt;br /&gt;
&lt;br /&gt;
* A minimum PHP version of 7.2.5 to be installed&lt;br /&gt;
* Composer, to manage PHP dependencies&lt;br /&gt;
* NodeJS version 10 or above, to manage front-end dependencies&lt;br /&gt;
* A MySQL database of version 5.6 or above, &#039;&#039;&#039;or&#039;&#039;&#039;&lt;br /&gt;
* A PostgreSQL database of version 11 or above&lt;br /&gt;
* The Git version control system&lt;br /&gt;
&lt;br /&gt;
If you have not set up a local development environment, you will need to do so before attempting this tutorial. To set up your local development environment, please consult the [[J4.x:Setting_Up_Your_Local_Environment|Local Environment Guide]].&lt;br /&gt;
&lt;br /&gt;
== Migrating from Joomla 3.x ==&lt;br /&gt;
&lt;br /&gt;
For the majority of cases, migrating from Joomla 3.x to 4.x is a straightforward process. Most of the changes needed are naming/namespacing changes and moving files around. This author intends to create a migration guide once this tutorial is complete, which will be linked here.&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
* [[User:Ribafs|Ribafs]] (Authored Joomla 3.x version)&lt;br /&gt;
* [[User:Kevinkabatra | Kevin Kabatra]] (Authored Joomla 3.x version)&lt;br /&gt;
* [[User:GregJPreece | Greg J Preece]] (Rewriting 3.x guide for 4.x)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Next: Developing a Basic Component|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Joomla!_4.x]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
[[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>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Introduction&amp;diff=771188</id>
		<title>J4.x:Developing an MVC Component/Introduction</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component/Introduction&amp;diff=771188"/>
		<updated>2020-12-12T22:39:30Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Created page with &amp;quot;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}} {{-}} {{Top portal heading|color=white-bkgd|icon=file-code-o|icon-color=#5091cd|size=5x|text-color=#333|title=Developing an MV...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}}&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=Developing an MVC Component for Joomla 4.x}}&lt;br /&gt;
{{-}}&lt;br /&gt;
&lt;br /&gt;
This tutorial will teach you how to develop a component for Joomla 4.x. A component is a type of Joomla extension that provides its own pages to the user, rather than augmenting existing content. A component is the most powerful type of Joomla extension, able to add a large amount of new functionality to a site.&lt;br /&gt;
&lt;br /&gt;
Joomla components are split into two main parts: an administrator part and a site part. The administrator part provides an interface to manage the component, and the site part provides the pages requested by users visiting the website. This tutorial will teach you how to construct both parts.&lt;br /&gt;
&lt;br /&gt;
For a more detailed overview of Components and the Model-View-Controller design pattern they use, please see the [[Absolute_Basics_of_How_a_Component_Functions|Component Basics Guide]]. However, please be aware that the specific file structure, naming standards and code detailed in the guide relate to Joomla 3.x, and should be ignored for the purposes of this tutorial.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
You will need to have Joomla 4.x for this tutorial. Developing for Joomla 4.x requires: &lt;br /&gt;
&lt;br /&gt;
* A minimum PHP version of 7.2.5 to be installed&lt;br /&gt;
* Composer, to manage PHP dependencies&lt;br /&gt;
* NodeJS version 10 or above, to manage front-end dependencies&lt;br /&gt;
* A MySQL database of version 5.6 or above, &#039;&#039;&#039;or&#039;&#039;&#039;&lt;br /&gt;
* A PostgreSQL database of version 11 or above&lt;br /&gt;
* The Git version control system&lt;br /&gt;
&lt;br /&gt;
If you have not set up a local development environment, you will need to do so before attempting this tutorial. To set up your local development environment, please consult the [[J4.x:Setting_Up_Your_Local_Environment|Local Environment Guide]].&lt;br /&gt;
&lt;br /&gt;
== Migrating from Joomla 3.x ==&lt;br /&gt;
&lt;br /&gt;
For the majority of cases, migrating from Joomla 3.x to 4.x is a straightforward process. Most of the changes needed are naming/namespacing changes and moving files around. This author intends to create a migration guide once this tutorial is complete, which will be linked here.&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
* [[User:Ribafs|Ribafs]] (Authored Joomla 3.x version)&lt;br /&gt;
* [[User:Kevinkabatra | Kevin Kabatra]] (Authored Joomla 3.x version)&lt;br /&gt;
* [[User:GregJPreece | Greg J Preece]] (Rewriting 3.x guide for 4.x)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Next: Developing a Basic Component|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component&amp;diff=771187</id>
		<title>J4.x:Developing an MVC Component</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J4.x:Developing_an_MVC_Component&amp;diff=771187"/>
		<updated>2020-12-12T21:28:32Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Joomla version|version=4.x|comment=&amp;gt;Tutorial}}&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=Developing an MVC Component for Joomla 4.x}}&lt;br /&gt;
{{-}}&lt;br /&gt;
&lt;br /&gt;
This is intended to be a multiple-article series of tutorials on how to develop a Model-View-Controller [[S:MyLanguage/Component|Component]] for Joomla! Version 4.x. &lt;br /&gt;
&lt;br /&gt;
==Under Construction==&lt;br /&gt;
&lt;br /&gt;
This section of the documentation is currently under heavy work, rewriting the Joomla 3 tutorial to be up-to-date. Joomla 4 is also still in the beta stage at the time of writing. While the information here should remain accurate, please be aware that pages will be missing and details may change until this notice is removed.&lt;br /&gt;
&lt;br /&gt;
As per the [[JDOC:Page_Translation_Explained|Page Translation Guide]], translation tagging will not be added to this tutorial until it is complete and the text is stabilised.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;large-4 columns&amp;quot;&amp;gt;{{Basic button|&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
S:MyLanguage/J4.x:Developing_an_MVC_Component/Introduction|Let&#039;s start with the introduction&amp;lt;/translate&amp;gt;|class=expand success}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Joomla!_4.x]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
[[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>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=JDOC_talk:Joomla_4_Tutorials_Project&amp;diff=645590</id>
		<title>JDOC talk:Joomla 4 Tutorials Project</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=JDOC_talk:Joomla_4_Tutorials_Project&amp;diff=645590"/>
		<updated>2020-01-21T17:21:47Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[User:GregJPreece|GregJPreece]] ([[User talk:GregJPreece|talk]]) 21:01, 3 January 2020 (CST) MVC Component Tutorial&lt;br /&gt;
&lt;br /&gt;
I&#039;ve been considering rewriting the component tutorial for Joomla 3.x, as many elements of it need modernising, and I really don&#039;t like the way it still uses legacy class names. If J4 is on the way and needs a similar tutorial, it seems sensible to start there.&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
Yes, please do. I’ve been holding off working my way through it as it seamed dated to a degree.&lt;br /&gt;
&lt;br /&gt;
If you want a reviewer for the changes, I’d be up for it.&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
Cool, thank you. I&#039;ll get started soon. My first component is making its way into the JED right now, so I&#039;ll be working on J4 compatibility for that in the next release. I&#039;ll write the docs here as I go.&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=JDOC_talk:Joomla_4_Tutorials_Project&amp;diff=645150</id>
		<title>JDOC talk:Joomla 4 Tutorials Project</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=JDOC_talk:Joomla_4_Tutorials_Project&amp;diff=645150"/>
		<updated>2020-01-04T03:01:13Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Created page with &amp;quot;~~~~ MVC Component Tutorial  I&amp;#039;ve been considering rewriting the component tutorial for Joomla 3.x, as many elements of it need modernising, and I really don&amp;#039;t like the way it...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[User:GregJPreece|GregJPreece]] ([[User talk:GregJPreece|talk]]) 21:01, 3 January 2020 (CST) MVC Component Tutorial&lt;br /&gt;
&lt;br /&gt;
I&#039;ve been considering rewriting the component tutorial for Joomla 3.x, as many elements of it need modernising, and I really don&#039;t like the way it still uses legacy class names. If J4 is on the way and needs a similar tutorial, it seems sensible to start there.&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Using_the_JToolbar_class_in_the_frontend&amp;diff=645091</id>
		<title>J3.x:Using the JToolbar class in the frontend</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Using_the_JToolbar_class_in_the_frontend&amp;diff=645091"/>
		<updated>2019-12-30T22:13:37Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightTOC}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
In the Joomla administrator panel a common toolbar system is provided to present common action items to the user, such as deleting records, publishing items, etc. This toolbar can also be used in the front-end, for presenting lists to the user, but some code will need to be manually brought into the front-end context that is not automatically provided there. &lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
There are several advantages to doing this:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
* Much of the code for creating and rendering the toolbar will still be provided by the Joomla framework, reducing the amount of code you have to write&lt;br /&gt;
* From a UI coding and theming perspective, code rendered by the Joomla framework is guaranteed to be compatible and theme-capable&lt;br /&gt;
* From a user perspective, you are providing a consistent experience that they recognise and can utilise immediately&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== How are toolbars rendered in the back-end? ==&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
Two classes are used primarily to render a toolbar into the UI:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
* &amp;lt;code lang=&amp;quot;php&amp;quot;&amp;gt;[https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Toolbar/Toolbar.php Joomla\CMS\Toolbar\Toolbar]&amp;lt;/code&amp;gt;, which configures and renders the toolbar&lt;br /&gt;
* &amp;lt;code lang=&amp;quot;php&amp;quot;&amp;gt;[https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Toolbar/ToolbarHelper.php Joomla\CMS\Toolbar\ToolbarHelper]&amp;lt;/code&amp;gt;, which greatly simplifies the configuration of a Toolbar object, and will be the entity you generally interact with when creating toolbars.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
In the back-end layout, there is a module called &amp;lt;code&amp;gt;mod_toolbar&amp;lt;/code&amp;gt;, and an associated page location called &amp;lt;code&amp;gt;toolbar&amp;lt;/code&amp;gt; into which a page&#039;s toolbar module is rendered:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$toolbar = JToolbar::getInstance(&#039;toolbar&#039;)-&amp;gt;render(&#039;toolbar&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== What work is needed in the front-end to support toolbars? ==&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
In the frontend we &#039;&#039;&#039;don&#039;t have&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
* A module that renders the toolbar&lt;br /&gt;
* A module position &amp;quot;toolbar&amp;quot; in the template&lt;br /&gt;
* Styling for the Toolbar and its components&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
In order to use a Toolbar object in the front-end, we will need to replicate these pieces of functionality, mostly by stealing them wholesale from the back-end!&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Step 1: Defining a Toolbar in your view ===&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
In your view file, use the &amp;lt;code&amp;gt;ToolbarHelper&amp;lt;/code&amp;gt; class to create a function that generates and renders your toolbar. You&#039;ll call this method from the view to put your toolbar in place.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
use Joomla\CMS\Language\Text;&lt;br /&gt;
use Joomla\CMS\MVC\View\HtmlView;&lt;br /&gt;
use Joomla\CMS\Toolbar\ToolbarHelper;&lt;br /&gt;
use Joomla\CMS\Toolbar\Toolbar;&lt;br /&gt;
&lt;br /&gt;
class MyExtensionViewMyView extends HtmlView {&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    protected function renderToolbar(): string {&lt;br /&gt;
        $title = Text::_(&#039;COM_MYEXTENSION_SOME_TITLE&#039;);&lt;br /&gt;
        &lt;br /&gt;
        ToolbarHelper::title($title);&lt;br /&gt;
        ToolbarHelper::addNew(&#039;youritem.add&#039;, &#039;COM_MYEXTENSION_BUTTON_CODE_NEW&#039;);&lt;br /&gt;
        ToolbarHelper::back()&lt;br /&gt;
&lt;br /&gt;
        return Toolbar::getInstance()-&amp;gt;render();&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;
As you can see, we are using the &amp;lt;code&amp;gt;ToolbarHelper&amp;lt;/code&amp;gt; class to add a title to the bar, a &amp;quot;new item&amp;quot; button that will call the &amp;lt;code&amp;gt;youritem.add&amp;lt;/code&amp;gt; action when clicked, and a back button. The &amp;lt;code&amp;gt;ToolbarHelper&amp;lt;/code&amp;gt; has many assistance methods for different actions, such as handling list items, rendering a preferences link, and so on. To see the full list of available methods, see [https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Toolbar/ToolbarHelper.php ToolbarHelper&#039;s source code].&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
Then, at the location in your view template that you wish the toolbar to appear:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?= $this-&amp;gt;renderToolbar(); ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
This will render your toolbar out to the page. However, it will look pretty awful at present, because we have not yet brought in the necessary CSS to style it.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Step 2: Including styling for the Toolbar ===&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
The styles required for the toolbar are part of the standard Isis control panel theme, and can be generated easily via Less. Below is an extract of that CSS code, corrected for use in the front-end. Create a file called &amp;lt;code&amp;gt;toolbar.css&amp;lt;/code&amp;gt; in an appropriate place within your extension and add this code into it.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-highlight mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-weight:bold;padding:1rem;&amp;quot;&amp;gt;Styling code for the Toolbar, taken from the Isis template. Click to expand.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
/* &lt;br /&gt;
 * Generated by LESS from the standard Isis administrator theme&lt;br /&gt;
 * Some styles related to colour have been removed, to prevent&lt;br /&gt;
 * issues with the user&#039;s front-end theme&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Subhead */&lt;br /&gt;
.subhead {&lt;br /&gt;
  color: #0C192E;&lt;br /&gt;
  text-shadow: 0 1px 0 #FFF;&lt;br /&gt;
  margin-bottom: 10px;&lt;br /&gt;
  min-height: 51px;&lt;br /&gt;
}&lt;br /&gt;
.subhead-collapse {&lt;br /&gt;
  margin-bottom: 19px;&lt;br /&gt;
}&lt;br /&gt;
.subhead-collapse.collapse {&lt;br /&gt;
  height: auto;&lt;br /&gt;
  overflow: visible;&lt;br /&gt;
}&lt;br /&gt;
.btn-toolbar {&lt;br /&gt;
  margin-bottom: 5px;&lt;br /&gt;
}&lt;br /&gt;
.btn-toolbar .btn-wrapper {&lt;br /&gt;
  display: inline-block;&lt;br /&gt;
  margin: 0 0 8px 5px;&lt;br /&gt;
}&lt;br /&gt;
.subhead-fixed {&lt;br /&gt;
  position: fixed;&lt;br /&gt;
  width: 100%;&lt;br /&gt;
  top: 30px;&lt;br /&gt;
  z-index: 100;&lt;br /&gt;
}&lt;br /&gt;
@media (max-width: 767px) {&lt;br /&gt;
  /* Fix ios scrolling inside bootstrap modals */&lt;br /&gt;
  body {&lt;br /&gt;
    -webkit-overflow-scrolling: touch;&lt;br /&gt;
  }&lt;br /&gt;
  .subhead {&lt;br /&gt;
    margin-left: -20px;&lt;br /&gt;
    margin-right: -20px;&lt;br /&gt;
    padding-left: 10px;&lt;br /&gt;
    padding-right: 10px;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
.subhead h1 {&lt;br /&gt;
  font-size: 17px;&lt;br /&gt;
  font-weight: normal;&lt;br /&gt;
  margin-left: 10px;&lt;br /&gt;
  margin-top: 6px;&lt;br /&gt;
}&lt;br /&gt;
/* Toolbar */&lt;br /&gt;
#toolbar {&lt;br /&gt;
  margin-bottom: 2px;&lt;br /&gt;
  margin-top: 12px;&lt;br /&gt;
}&lt;br /&gt;
#toolbar .btn {&lt;br /&gt;
  line-height: 24px;&lt;br /&gt;
  margin-right: 4px;&lt;br /&gt;
  padding: 0 10px;&lt;br /&gt;
}&lt;br /&gt;
#toolbar .btn-success {&lt;br /&gt;
  min-width: 148px;&lt;br /&gt;
}&lt;br /&gt;
#toolbar .btn-primary [class^=&amp;quot;icon-&amp;quot;],&lt;br /&gt;
#toolbar .btn-warning [class^=&amp;quot;icon-&amp;quot;],&lt;br /&gt;
#toolbar .btn-danger [class^=&amp;quot;icon-&amp;quot;],&lt;br /&gt;
#toolbar .btn-success [class^=&amp;quot;icon-&amp;quot;],&lt;br /&gt;
#toolbar .btn-info [class^=&amp;quot;icon-&amp;quot;],&lt;br /&gt;
#toolbar .btn-inverse [class^=&amp;quot;icon-&amp;quot;],&lt;br /&gt;
#toolbar .btn-primary [class*=&amp;quot; icon-&amp;quot;],&lt;br /&gt;
#toolbar .btn-warning [class*=&amp;quot; icon-&amp;quot;],&lt;br /&gt;
#toolbar .btn-danger [class*=&amp;quot; icon-&amp;quot;],&lt;br /&gt;
#toolbar .btn-success [class*=&amp;quot; icon-&amp;quot;],&lt;br /&gt;
#toolbar .btn-info [class*=&amp;quot; icon-&amp;quot;],&lt;br /&gt;
#toolbar .btn-inverse [class*=&amp;quot; icon-&amp;quot;] {&lt;br /&gt;
  background-color: transparent;&lt;br /&gt;
  border-right: 0;&lt;br /&gt;
  border-left: 0;&lt;br /&gt;
  width: 16px;&lt;br /&gt;
  margin-left: 0;&lt;br /&gt;
  margin-right: 0;&lt;br /&gt;
}&lt;br /&gt;
#toolbar #toolbar-options,&lt;br /&gt;
#toolbar #toolbar-help {&lt;br /&gt;
  float: right;&lt;br /&gt;
}&lt;br /&gt;
#toolbar [class^=&amp;quot;icon-&amp;quot;],&lt;br /&gt;
#toolbar [class*=&amp;quot; icon-&amp;quot;] {&lt;br /&gt;
  background-color: #e6e6e6;&lt;br /&gt;
  border-radius: 3px 0 0 3px;&lt;br /&gt;
  border-right: 1px solid #b3b3b3;&lt;br /&gt;
  height: auto;&lt;br /&gt;
  line-height: inherit;&lt;br /&gt;
  margin: 0 6px 0 -10px;&lt;br /&gt;
  opacity: 1;&lt;br /&gt;
  text-shadow: none;&lt;br /&gt;
  width: 28px;&lt;br /&gt;
  z-index: -1;&lt;br /&gt;
}&lt;br /&gt;
#toolbar iframe .btn-group .btn {&lt;br /&gt;
  margin-left: -1px !important;&lt;br /&gt;
}&lt;br /&gt;
html[dir=rtl] #toolbar #toolbar-options,&lt;br /&gt;
html[dir=rtl] #toolbar #toolbar-help {&lt;br /&gt;
  float: left;&lt;br /&gt;
}&lt;br /&gt;
@media (max-width: 767px) {&lt;br /&gt;
  .subhead-fixed {&lt;br /&gt;
    position: static;&lt;br /&gt;
    width: auto;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
/* Subhead (toolbar) Collapse Button */&lt;br /&gt;
.btn-subhead {&lt;br /&gt;
  display: none;&lt;br /&gt;
}&lt;br /&gt;
@media (min-width: 480px) {&lt;br /&gt;
  #filter-bar {&lt;br /&gt;
    height: 29px;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
@media (max-width: 479px) {&lt;br /&gt;
  .navbar .btn {&lt;br /&gt;
    margin: 0;&lt;br /&gt;
  }&lt;br /&gt;
  .btn-subhead {&lt;br /&gt;
    display: block;&lt;br /&gt;
    margin: 10px 0;&lt;br /&gt;
  }&lt;br /&gt;
  .subhead-collapse.collapse {&lt;br /&gt;
    height: 0;&lt;br /&gt;
    overflow: hidden;&lt;br /&gt;
  }&lt;br /&gt;
  .btn-toolbar .btn-wrapper {&lt;br /&gt;
    display: block;&lt;br /&gt;
    margin: 0px 10px 5px 10px;&lt;br /&gt;
  }&lt;br /&gt;
  .btn-toolbar .btn-wrapper .btn {&lt;br /&gt;
    width: 100% !important;&lt;br /&gt;
  }&lt;br /&gt;
  .subhead {&lt;br /&gt;
    background: none repeat scroll 0 0 transparent;&lt;br /&gt;
    border-bottom: 0 solid #dedede;&lt;br /&gt;
  }&lt;br /&gt;
  #toolbar [class^=&amp;quot;icon-&amp;quot;],&lt;br /&gt;
  #toolbar [class*=&amp;quot; icon-&amp;quot;] {&lt;br /&gt;
    background-color: transparent;&lt;br /&gt;
    border-right: medium none;&lt;br /&gt;
    width: 10px;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
@media (max-width: 319px) {&lt;br /&gt;
  .view-login .navbar-fixed-bottom {&lt;br /&gt;
    display: none;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
With this code saved in the file, register the stylesheet inside your view file&#039;s &amp;lt;code&amp;gt;display()&amp;lt;/code&amp;gt; method, during document setup:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
use Joomla\CMS\Factory;&lt;br /&gt;
use Joomla\CMS\Uri\Uri;&lt;br /&gt;
&lt;br /&gt;
class MyExtensionViewMyView extends HtmlView {&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    function display($tpl = null) {&lt;br /&gt;
&lt;br /&gt;
        // ...&lt;br /&gt;
&lt;br /&gt;
        $document = Factory::getDocument();&lt;br /&gt;
        $document-&amp;gt;addStyleSheet(Uri::root() . &#039;/components/com_myextension/path/to/your/toolbar.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;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
Your toolbar should now be styled appropriately.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Restricting actions by permission ==&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
It&#039;s usually a good idea to have your toolbar buttons restricted according to the active user&#039;s permissions. This can be easily done using the &amp;lt;code&amp;gt;ContentHelper&amp;lt;/code&amp;gt; class:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
use Joomla\CMS\Helper\ContentHelper;&lt;br /&gt;
use Joomla\CMS\Language\Text;&lt;br /&gt;
use Joomla\CMS\MVC\View\HtmlView;&lt;br /&gt;
use Joomla\CMS\Toolbar\ToolbarHelper;&lt;br /&gt;
use Joomla\CMS\Toolbar\Toolbar;&lt;br /&gt;
&lt;br /&gt;
class MyExtensionViewMyView extends HtmlView {&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    protected function renderToolbar(): string {        &lt;br /&gt;
        $this-&amp;gt;canDo = ContentHelper::getActions(&#039;com_myextension&#039;);&lt;br /&gt;
        $title = Text::_(&#039;COM_MYEXTENSION_SOME_TITLE&#039;);&lt;br /&gt;
&lt;br /&gt;
        ToolbarHelper::title($title);&lt;br /&gt;
&lt;br /&gt;
        if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.create&#039;)) {&lt;br /&gt;
            ToolbarHelper::addNew(&#039;youritem.add&#039;, &#039;COM_MYEXTENSION_BUTTON_CODE_NEW&#039;);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        ToolbarHelper::back();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Handling List Actions ==&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
Depending on the methods and actions you enable in your Toolbar, you may need to emulate a few other elements of the back-end form handling code. As list-handling is such a common use case, this section will show how to integrate those tasks into your front-end view.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
This section will not describe general list handling - using the &amp;lt;code&amp;gt;ListModel&amp;lt;/code&amp;gt; class, generating a list query, pagination, etc - as those are documented elsewhere.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Step 1: Enabling the list functionality ===&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
In the &amp;lt;code&amp;gt;display()&amp;lt;/code&amp;gt; method of your view file, use Joomla&#039;s &amp;lt;code&amp;gt;HtmlHelper&amp;lt;/code&amp;gt; class to load the appropriate Javascript to handle lists.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
use Joomla\CMS\HTML\HTMLHelper;&lt;br /&gt;
&lt;br /&gt;
class MyExtensionViewMyView extends HtmlView {&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    function display($tpl = null) {&lt;br /&gt;
&lt;br /&gt;
        // ...&lt;br /&gt;
&lt;br /&gt;
        HTMLHelper::_(&#039;formbehavior.chosen&#039;, &#039;select&#039;);&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;
This will enable the Javascript and other front-end assets that are needed for list functionality in the toolbar.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Step 2: Defining the Toolbar ===&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
You&#039;ll need to define the buttons that you wish to appear, and the actions they trigger. The most common options to use with a list are obviously add, edit and delete:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
use Joomla\CMS\Helper\ContentHelper;&lt;br /&gt;
use Joomla\CMS\Language\Text;&lt;br /&gt;
use Joomla\CMS\MVC\View\HtmlView;&lt;br /&gt;
use Joomla\CMS\Toolbar\ToolbarHelper;&lt;br /&gt;
use Joomla\CMS\Toolbar\Toolbar;&lt;br /&gt;
&lt;br /&gt;
class MyExtensionViewMyView extends HtmlView {&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    protected function renderToolbar(): string {        &lt;br /&gt;
        $this-&amp;gt;canDo = ContentHelper::getActions(&#039;com_myextension&#039;);&lt;br /&gt;
        $title = Text::_(&#039;COM_MYEXTENSION_SOME_TITLE&#039;);&lt;br /&gt;
&lt;br /&gt;
        ToolbarHelper::title($title);&lt;br /&gt;
&lt;br /&gt;
        if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.create&#039;)) {&lt;br /&gt;
            ToolbarHelper::addNew(&#039;youritem.add&#039;, &#039;COM_MYEXTENSION_BUTTON_CODE_NEW&#039;);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.edit&#039;) || $this-&amp;gt;canDo-&amp;gt;get(&#039;core.edit.own&#039;)) {&lt;br /&gt;
            ToolbarHelper::editList(&#039;youritem.edit&#039;, &#039;COM_MYEXTENSION_BUTTON_CODE_EDIT&#039;);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.delete&#039;)) {&lt;br /&gt;
            ToolbarHelper::deleteList(&#039;COM_MYEXTENSION_DELETE_CONFIRM&#039;, &#039;youritem.delete&#039;, &#039;COM_MYEXTENSION_BUTTON_CODE_DELETE&#039;);&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;
The implementation of these actions - &amp;lt;code&amp;gt;youritem.edit&amp;lt;/code&amp;gt; and so on - is left as an exercise for the reader, as the code for those is very dependent on your extension&#039;s implementation and not really relevant to the toolbar. However, if you&#039;re unsure how to proceed, here are a few tips:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
* To check for an item being edited and retrieve it on your create/edit page, use &amp;lt;code&amp;gt;$this-&amp;gt;get(&#039;Item&#039;);&amp;lt;/code&amp;gt; in your view&#039;s &amp;lt;code&amp;gt;display()&amp;lt;/code&amp;gt; method&lt;br /&gt;
* To retrieve the list of items being selecetd when processing an action such as &amp;quot;delete&amp;quot;, use &amp;lt;code&amp;gt;$this-&amp;gt;input-&amp;gt;get(&#039;cid&#039;, array(), &#039;array&#039;);&amp;lt;/code&amp;gt; in your controller&lt;br /&gt;
* For working examples of how to handle group deletes, see the control panel&#039;s [https://github.com/joomla/joomla-cms/blob/staging/libraries/src/MVC/Controller/AdminController.php AdminController] and [https://github.com/joomla/joomla-cms/blob/staging/libraries/src/MVC/Model/AdminModel.php AdminModel] classes&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Step 3: Rendering the list ===&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
At the top of your list in your view template, you will need to wrap the list in a form, and add a few hidden fields as shown below. These hidden fields will be set by the Toolbar&#039;s Javascript as actions and items are selected.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;form action=&amp;quot;&amp;lt;?= Route::_(&#039;index.php?option=com_myextension&amp;amp;view=thisview&#039;) ?&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot; id=&amp;quot;adminForm&amp;quot; name=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;?= HTMLHelper::_(&#039;form.token&#039;); ?&amp;gt;&lt;br /&gt;
        &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;option&amp;quot; value=&amp;quot;com_myextension&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;&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;boxchecked&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;!-- Rest of list --&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
Naturally, you will want to add a checkbox to each row of your item list, so that they can be selected and acted on by the toolbar. This checkbox can be easily rendered using the &amp;lt;code&amp;gt;HtmlHelper&amp;lt;/code&amp;gt; class:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;?php foreach ($this-&amp;gt;items as $i =&amp;gt; $row) : ?&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
            &amp;lt;td&amp;gt;&lt;br /&gt;
                &amp;lt;?= HTMLHelper::_(&#039;grid.id&#039;, $i, $row-&amp;gt;id); ?&amp;gt;&lt;br /&gt;
            &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
            &amp;lt;!-- Other columns in the list --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;?php endforeach; ?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
If you wish to add a &amp;quot;check all&amp;quot; checkbox to the column header, this can also be provided by &amp;lt;code&amp;gt;HtmlHelper&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;thead&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
            &amp;lt;th width=&amp;quot;2%&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;?= HTMLHelper::_(&#039;grid.checkall&#039;); ?&amp;gt;&lt;br /&gt;
            &amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
            &amp;lt;!-- Other columns in the list --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Routing and SEF URLs ==&lt;br /&gt;
{{underconstruction}}&lt;br /&gt;
&lt;br /&gt;
== Custom frontend buttons ==&lt;br /&gt;
{{underconstruction}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Joomla!_3.x]]&lt;br /&gt;
[[Category:Component_Development]]&lt;br /&gt;
[[Category:Extension_development]]&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=How_to_use_JDate&amp;diff=640698</id>
		<title>How to use JDate</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=How_to_use_JDate&amp;diff=640698"/>
		<updated>2019-10-24T15:28:07Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Fleshing out missing usage info about Date object, removing old-style class aliases from code examples.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Introduction == &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
Joomla&#039;s Date class is a helper class, extended from PHP&#039;s DateTime class, which allows developers to handle date formatting more efficiently. The class allows developers to format dates for readable strings, MySQL interaction, UNIX timestamp calculation, and also provides helper methods for working in different timezones.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Regarding the &amp;quot;JDate&amp;quot; class name:&#039;&#039;&#039; This page has been updated to utilise namespaced class names. `JDate`, `JApplication` and other similarly named classes you will see throughout the Joomla documentation are actually class aliases, maintained for legacy reasons. It is recommended to use namespaced access to Joomla classes, which will improve your development experience by providing better code hints and checks in your editor, leading to fewer errors. &lt;br /&gt;
&lt;br /&gt;
You can view the full list of aliased classes [https://github.com/joomla/joomla-cms/blob/staging/libraries/classmap.php in this file inside the Joomla codebase].&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Creating a Date Instance == &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
All of the date helper methods require an instance of the Date class. To begin, you must create one. A Date object may be created in two ways. One is the typical native method of simply creating a new instance:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
use Joomla\CMS\Date\Date;&lt;br /&gt;
&lt;br /&gt;
$date = new Date(); // Creates a new Date object equal to the current time.&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:4--&amp;gt;&lt;br /&gt;
You may also create an instance using the static method defined in Date:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
use Joomla\CMS\Date\Date;&lt;br /&gt;
&lt;br /&gt;
$date = Date::getInstance(); // Alias of &#039;new Date();&#039;&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:5--&amp;gt;&lt;br /&gt;
There is no difference between these methods, as Date::getInstance simply creates a new instance of Date exactly like the first method shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
Alternatively, you may also retrieve the current date (as a Date object) from the Application object, by using:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
use Joomla\CMS\Factory;&lt;br /&gt;
&lt;br /&gt;
$date = Factory::getDate();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Arguments == &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
The Date constructor (and getInstance static method) accepts two optional parameters: A date string to format, and a timezone. Not passing a date string will create a Date object with the current date and time, while not passing a timezone will allow the Date object to use the default timezone set.&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:9--&amp;gt;&lt;br /&gt;
The first argument, if used, should be a string that can be parsed using PHP&#039;s native DateTime constructor. E.g:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
use Joomla\CMS\Date\Date;&lt;br /&gt;
&lt;br /&gt;
$currentTime = new Date(&#039;now&#039;); // Current date and time&lt;br /&gt;
$tomorrowTime = new Date(&#039;now +1 day&#039;); // Current date and time, + 1 day.&lt;br /&gt;
$plus1MonthTime = new Date(&#039;now +1 month&#039;); // Current date and time, + 1 month.&lt;br /&gt;
$plus1YearTime = new Date(&#039;now +1 year&#039;); // Current date and time, + 1 year.&lt;br /&gt;
$plus1YearAnd1MonthTime = new Date(&#039;now +1 year +1 month&#039;); // Current date and time, + 1 year and 1 month.&lt;br /&gt;
$plusTimeToTime = new Date(&#039;now +1 hour +30 minutes +3 seconds&#039;); // Current date and time, + 1 hour, 30 minutes and 3 seconds&lt;br /&gt;
$plusTimeToTime = new Date(&#039;now -1 hour +30 minutes +3 seconds&#039;); // Current date and time, + 1 hour, 30 minutes and 3 seconds&lt;br /&gt;
$combinedTimeToTime = new Date(&#039;now -1 hour -30 minutes 23 seconds&#039;); // Current date and time, - 1 hour, +30 minutes and +23 seconds&lt;br /&gt;
&lt;br /&gt;
$date = new Date(&#039;2012-12-1 15:20:00&#039;); // 3:20 PM, December 1st, 2012&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
A Unix timestamp (in seconds) can also be passed as the first argument, in which case it will be internally uplifted into a date. If a timezone has been specified as the second argument to the constructor, it will be converted to that timezone.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Outputting Dates == &amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One note of caution when outputting Date objects in a user context: do not simply print them to the screen. The Date object&#039;s toString() method simply calls its parent&#039;s format() method, without consideration for timezones or localized date formatting. This will not result in a good user experience, and will lead to inconsistencies between the formatting in your extension, and elsewhere in Joomla. Instead, you should always output Dates using the methods shown below.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Common Date Formats ===&lt;br /&gt;
&lt;br /&gt;
A number of date formats are predefined in Joomla as part of the base language packs. This is beneficial because it means date formats can be easily internationalised. A sample of the available format strings is below, from the en-GB language pack. It is highly recommended to utilise these formatting strings when outputting dates, so that your dates will be automatically re-formatted according to a user&#039;s locale. They can be retrieved in the same way as any language string (see below for examples).&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
DATE_FORMAT_LC=&amp;quot;l, d F Y&amp;quot;&lt;br /&gt;
DATE_FORMAT_LC1=&amp;quot;l, d F Y&amp;quot;&lt;br /&gt;
DATE_FORMAT_LC2=&amp;quot;l, d F Y H:i&amp;quot;&lt;br /&gt;
DATE_FORMAT_LC3=&amp;quot;d F Y&amp;quot;&lt;br /&gt;
DATE_FORMAT_LC4=&amp;quot;Y-m-d&amp;quot;&lt;br /&gt;
DATE_FORMAT_LC5=&amp;quot;Y-m-d H:i&amp;quot;&lt;br /&gt;
DATE_FORMAT_LC6=&amp;quot;Y-m-d H:i:s&amp;quot;&lt;br /&gt;
DATE_FORMAT_JS1=&amp;quot;y-m-d&amp;quot;&lt;br /&gt;
DATE_FORMAT_CALENDAR_DATE=&amp;quot;%Y-%m-%d&amp;quot;&lt;br /&gt;
DATE_FORMAT_CALENDAR_DATETIME=&amp;quot;%Y-%m-%d %H:%M:%S&amp;quot;&lt;br /&gt;
DATE_FORMAT_FILTER_DATE=&amp;quot;Y-m-d&amp;quot;&lt;br /&gt;
DATE_FORMAT_FILTER_DATETIME=&amp;quot;Y-m-d H:i:s&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== The HtmlHelper Method (Recommended) ===&lt;br /&gt;
&lt;br /&gt;
As with many common output items, the HtmlHelper class is here to...help! HtmlHelper&#039;s date() method will take any date-time string that the Date constructor would accept, along with a formatting string, and output the date appropriately for the current user&#039;s timezone settings. As such, this is the recommended method for outputting dates for the user.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
use Joomla\CMS\HTML\HTMLHelper;&lt;br /&gt;
use Joomla\CMS\Language\Text;&lt;br /&gt;
&lt;br /&gt;
$myDateString = &#039;2012-12-1 15:20:00&#039;;&lt;br /&gt;
echo HtmlHelper::date($myDateString, Text::_(&#039;DATE_FORMAT_FILTER_DATETIME&#039;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== The Date Object&#039;s format() Method ===&lt;br /&gt;
&lt;br /&gt;
Another option is to format the Date manually. If this method is used, you will have to also manually retrieve and set the user&#039;s timezone. This method is more useful for formatting dates outside of the user interface, such as in system logs or API calls.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
use Joomla\CMS\Language\Text;&lt;br /&gt;
use Joomla\CMS\Date\Date;&lt;br /&gt;
use Joomla\CMS\Factory;&lt;br /&gt;
&lt;br /&gt;
$myDateString = &#039;2012-12-1 15:20:00&#039;;&lt;br /&gt;
$timezone = Factory::getUser()-&amp;gt;getTimezone();&lt;br /&gt;
&lt;br /&gt;
$date = new Date($myDateString);&lt;br /&gt;
$date-&amp;gt;setTimezone($timezone);&lt;br /&gt;
echo $date-&amp;gt;format(Text::_(&#039;DATE_FORMAT_FILTER_DATETIME&#039;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Other Useful Code Examples ==&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Quickly Outputting the Current Time ===&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:18--&amp;gt;&lt;br /&gt;
There are two easy ways of doing this.&lt;br /&gt;
# The HtmlHelper&#039;s date() method, if no date value is provided, will default to the current time. &lt;br /&gt;
# Factory::getDate() gets the current date as a Date object, which we can then format.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
use Joomla\CMS\Factory;&lt;br /&gt;
use Joomla\CMS\HTML\HTMLHelper;&lt;br /&gt;
use Joomla\CMS\Language\Text;&lt;br /&gt;
&lt;br /&gt;
// These two are functionally equivalent&lt;br /&gt;
echo HtmlHelper::date(&#039;now&#039;, Text::_(&#039;DATE_FORMAT_FILTER_DATETIME&#039;));&lt;br /&gt;
&lt;br /&gt;
$timezone = Factory::getUser()-&amp;gt;getTimezone();&lt;br /&gt;
echo Factory::getDate()-&amp;gt;setTimezone($timezone)-&amp;gt;format(Text::_(&#039;DATE_FORMAT_FILTER_DATETIME&#039;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Adding and Subtracting from Dates ===&lt;br /&gt;
&lt;br /&gt;
Because the Joomla Date object extends the PHP DateTime object, it provides methods for adding and subtracting from dates. The easiest of these methods to use is the modify() method, which accepts any relative modification string that the PHP [https://www.php.net/manual/en/function.strtotime.php strtotime]() method would accept. For example:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
use Joomla\CMS\Date\Date;&lt;br /&gt;
&lt;br /&gt;
$date = new Date(&#039;2012-12-1 15:20:00&#039;);&lt;br /&gt;
$date-&amp;gt;modify(&#039;+1 year&#039;);&lt;br /&gt;
echo $date-&amp;gt;toSQL(); // 2013-12-01 15:20:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
There are also separate add() and sub() methods, for adding or subtracting time from a date object respectively. These accept PHP-standard [https://www.php.net/manual/en/class.dateinterval.php DateInterval] objects:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
use Joomla\CMS\Date\Date;&lt;br /&gt;
&lt;br /&gt;
$interval = new \DateInterval(&#039;P1Y1D&#039;); // Interval represents 1 year and 1 day&lt;br /&gt;
&lt;br /&gt;
$date1 = new Date(&#039;2012-12-1 15:20:00&#039;);&lt;br /&gt;
$date1-&amp;gt;add($interval);&lt;br /&gt;
echo $date1-&amp;gt;toSQL(); // 2013-12-02 15:20:00&lt;br /&gt;
&lt;br /&gt;
$date2 = new Date(&#039;2012-12-1 15:20:00&#039;);&lt;br /&gt;
$date2-&amp;gt;sub($interval);&lt;br /&gt;
echo $date2-&amp;gt;toSQL(); // 2011-11-30 15:20:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Outputting Dates in ISO 8601 Format ===&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$date = new Date(&#039;2012-12-1 15:20:00&#039;);&lt;br /&gt;
$date-&amp;gt;toISO8601(); // 20121201T152000Z&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Outputting Dates in RFC 822 Format ===&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$date = new Date(&#039;2012-12-1 15:20:00&#039;);&lt;br /&gt;
$date-&amp;gt;toRFC822(); // Sat, 01 Dec 2012 15:20:00 +0000&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Outputting Dates in SQL Date-Time Format ===&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$date = new Date(&#039;20121201T152000Z&#039;);&lt;br /&gt;
$date-&amp;gt;toSQL(); // 2012-12-01 15:20:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Outputting Dates as Unix Timestamps ===&lt;br /&gt;
&lt;br /&gt;
A Unix timestamp is expressed as the number of seconds that have passed since the Unix Epoch (the first second of Jan 1st 1970).&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$date = new Date(&#039;20121201T152000Z&#039;);&lt;br /&gt;
$date-&amp;gt;toSQL(); // 1354375200&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:13--&amp;gt;&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_verifications&amp;diff=630233</id>
		<title>J3.x:Developing an MVC Component/Adding verifications</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_verifications&amp;diff=630233"/>
		<updated>2019-09-24T17:19:30Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Noting that Joomla core behaviours need to be specified, or JS will error on load&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{:J3.1:Developing an MVC Component/&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;translate&amp;gt;== Introduction == &amp;lt;!--T:2--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
This tutorial is part of the [[S:MyLanguage/J3.2:Developing an MVC Component|Developing an MVC Component for Joomla! 3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
See [[S:MyLanguage/Form validation|Form validation]] for some more general info on form validation (rules).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt; You can watch a video associated with this step at [https://youtu.be/xzYRI3R--CE Step 11, adding verifications]. This and subsequent videos are recorded in HD; click on the YouTube settings wheel to vieiw at best resolution.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{{#widget:YouTube|id=xzYRI3R--CE}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Verifying the form (client side) == &amp;lt;!--T:5--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
See [[S:MyLanguage/Client-side_form_validation|Client-side form validation]] for further tutorial information relating to client-side verification.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
Forms can be verified on the client side using javascript code.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
In the &#039;&#039;[[#admin/views/helloworld/tmpl/edit.php|admin/views/helloworld/tmpl/edit.php]]&#039;&#039; file, put these lines:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworld/tmpl/edit.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/views/helloworld/tmpl/edit.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;15&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 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;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;form action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php?option=com_helloworld&amp;amp;layout=edit&amp;amp;id=&#039; . (int) $this-&amp;gt;item-&amp;gt;id); ?&amp;gt;&amp;quot;&lt;br /&gt;
    method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot; id=&amp;quot;adminForm&amp;quot; class=&amp;quot;form-validate&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;form-horizontal&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;fieldset class=&amp;quot;adminform&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;legend&amp;gt;&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_DETAILS&#039;); ?&amp;gt;&amp;lt;/legend&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&amp;quot;row-fluid&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&amp;quot;span6&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;?php foreach ($this-&amp;gt;form-&amp;gt;getFieldset() as $field): ?&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&amp;quot;control-group&amp;quot;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&amp;quot;control-label&amp;quot;&amp;gt;&amp;lt;?php echo $field-&amp;gt;label; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&amp;quot;controls&amp;quot;&amp;gt;&amp;lt;?php echo $field-&amp;gt;input; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;?php endforeach; ?&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;helloworld.edit&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;?php echo JHtml::_(&#039;form.token&#039;); ?&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
You may have noted that the html form contained in the &#039;&#039;[[#admin/views/helloworld/tmpl/edit.php|admin/views/helloworld/tmpl/edit.php]]&#039;&#039; file now has the &#039;&#039;form-validate&#039;&#039; css class.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
Modify the &amp;lt;tt&amp;gt;admin/models/forms/helloworld.xml&amp;lt;/tt&amp;gt; file to indicate that the &#039;&#039;greeting&#039;&#039; field has to be verified:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/forms/helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;2-4,16-18&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;form&lt;br /&gt;
				addrulepath=&amp;quot;/administrator/components/com_helloworld/models/rules&amp;quot;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset&amp;gt;&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
				name=&amp;quot;id&amp;quot;&lt;br /&gt;
				type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
				/&amp;gt;&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
				name=&amp;quot;greeting&amp;quot;&lt;br /&gt;
				type=&amp;quot;text&amp;quot;&lt;br /&gt;
				label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_GREETING_LABEL&amp;quot;&lt;br /&gt;
				description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_GREETING_DESC&amp;quot;&lt;br /&gt;
				size=&amp;quot;40&amp;quot;&lt;br /&gt;
				class=&amp;quot;inputbox validate-greeting&amp;quot;&lt;br /&gt;
				validate=&amp;quot;greeting&amp;quot;&lt;br /&gt;
				required=&amp;quot;true&amp;quot;&lt;br /&gt;
				default=&amp;quot;&amp;quot;&lt;br /&gt;
				/&amp;gt;&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
Note for the moment that the css class is now &#039;&#039;&amp;quot;inputbox validate-greeting&amp;quot;&#039;&#039; and that the attribute &#039;&#039;required&#039;&#039; is set to &#039;&#039;true&#039;&#039;. It means that this field is required and has to be verified by a handler of the form validator framework of Joomla.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
With your favourite file manager and editor put a file &amp;lt;tt&amp;gt;admin/models/forms/helloworld.js&amp;lt;/tt&amp;gt; containing:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/forms/helloworld.js&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/models/forms/helloworld.js&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
jQuery(function() {&lt;br /&gt;
    document.formvalidator.setHandler(&#039;greeting&#039;,&lt;br /&gt;
        function (value) {&lt;br /&gt;
            regex=/^[^0-9]+$/;&lt;br /&gt;
            return regex.test(value);&lt;br /&gt;
        });&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
It adds a handler to the form validator of Joomla for fields having the &#039;&#039;&amp;quot;validate-greeting&amp;quot;&#039;&#039; css class. Each time the &#039;&#039;greeting&#039;&#039; field is modified, the handler will be executed to verify its validity (no digits).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
The final step is to verify the form when the save button is clicked.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
With your favourite file manager and editor put a file &amp;lt;tt&amp;gt;admin/views/helloworld/submitbutton.js&amp;lt;/tt&amp;gt; containing:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworld/submitbutton.js&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/views/helloworld/submitbutton.js&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
Joomla.submitbutton = function(task)&lt;br /&gt;
{&lt;br /&gt;
	if (task == &#039;&#039;)&lt;br /&gt;
	{&lt;br /&gt;
		return false;&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		var isValid=true;&lt;br /&gt;
		var action = task.split(&#039;.&#039;);&lt;br /&gt;
		if (action[1] != &#039;cancel&#039; &amp;amp;&amp;amp; action[1] != &#039;close&#039;)&lt;br /&gt;
		{&lt;br /&gt;
			var forms = jQuery(&#039;form.form-validate&#039;);&lt;br /&gt;
			for (var i = 0; i &amp;lt; forms.length; i++)&lt;br /&gt;
			{&lt;br /&gt;
				if (!document.formvalidator.isValid(forms[i]))&lt;br /&gt;
				{&lt;br /&gt;
					isValid = false;&lt;br /&gt;
					break;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	&lt;br /&gt;
		if (isValid)&lt;br /&gt;
		{&lt;br /&gt;
			Joomla.submitform(task);&lt;br /&gt;
			return true;&lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			alert(Joomla.JText._(&#039;COM_HELLOWORLD_HELLOWORLD_ERROR_UNACCEPTABLE&#039;,&lt;br /&gt;
			                     &#039;Some values are unacceptable&#039;));&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
This function will verify that all forms which have the &#039;&#039;&amp;quot;form-validate&amp;quot;&#039;&#039; css class are valid. Note that it will display an alert message translated by the Joomla framework.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
The &#039;&#039;HelloWorldViewHelloWorld&#039;&#039; view class has to be modified to use these javascript files:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworld/view.html.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/views/helloworld/view.html.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;39,100-101,107-110&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 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;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld View&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorld extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * View form&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var         form&lt;br /&gt;
	 */&lt;br /&gt;
	protected $form = null;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Display the Hello World view&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  void&lt;br /&gt;
	 */&lt;br /&gt;
	public function display($tpl = null)&lt;br /&gt;
	{&lt;br /&gt;
		// Get the Data&lt;br /&gt;
		$this-&amp;gt;form = $this-&amp;gt;get(&#039;Form&#039;);&lt;br /&gt;
		$this-&amp;gt;item = $this-&amp;gt;get(&#039;Item&#039;);&lt;br /&gt;
		$this-&amp;gt;script = $this-&amp;gt;get(&#039;Script&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Check for errors.&lt;br /&gt;
		if (count($errors = $this-&amp;gt;get(&#039;Errors&#039;)))&lt;br /&gt;
		{&lt;br /&gt;
			JError::raiseError(500, implode(&#039;&amp;lt;br /&amp;gt;&#039;, $errors));&lt;br /&gt;
&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		// Set the toolbar&lt;br /&gt;
		$this-&amp;gt;addToolBar();&lt;br /&gt;
&lt;br /&gt;
		// Display the template&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
&lt;br /&gt;
		// Set the document&lt;br /&gt;
		$this-&amp;gt;setDocument();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Add the page title and toolbar.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  void&lt;br /&gt;
	 *&lt;br /&gt;
	 * @since   1.6&lt;br /&gt;
	 */&lt;br /&gt;
	protected function addToolBar()&lt;br /&gt;
	{&lt;br /&gt;
		$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
&lt;br /&gt;
		// Hide Joomla Administrator Main menu&lt;br /&gt;
		$input-&amp;gt;set(&#039;hidemainmenu&#039;, true);&lt;br /&gt;
&lt;br /&gt;
		$isNew = ($this-&amp;gt;item-&amp;gt;id == 0);&lt;br /&gt;
&lt;br /&gt;
		if ($isNew)&lt;br /&gt;
		{&lt;br /&gt;
			$title = JText::_(&#039;COM_HELLOWORLD_MANAGER_HELLOWORLD_NEW&#039;);&lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			$title = JText::_(&#039;COM_HELLOWORLD_MANAGER_HELLOWORLD_EDIT&#039;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		JToolbarHelper::title($title, &#039;helloworld&#039;);&lt;br /&gt;
		JToolbarHelper::save(&#039;helloworld.save&#039;);&lt;br /&gt;
		JToolbarHelper::cancel(&lt;br /&gt;
			&#039;helloworld.cancel&#039;,&lt;br /&gt;
			$isNew ? &#039;JTOOLBAR_CANCEL&#039; : &#039;JTOOLBAR_CLOSE&#039;&lt;br /&gt;
		);&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to set up the document properties&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return void&lt;br /&gt;
	 */&lt;br /&gt;
	protected function setDocument() &lt;br /&gt;
	{&lt;br /&gt;
		&lt;br /&gt;
		JHtml::_(&#039;behavior.framework&#039;);&lt;br /&gt;
		JHtml::_(&#039;behavior.formvalidator&#039;);&lt;br /&gt;
&lt;br /&gt;
		$isNew = ($this-&amp;gt;item-&amp;gt;id &amp;lt; 1);&lt;br /&gt;
		$document = JFactory::getDocument();&lt;br /&gt;
		$document-&amp;gt;setTitle($isNew ? JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_CREATING&#039;) :&lt;br /&gt;
                JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_EDITING&#039;));&lt;br /&gt;
		$document-&amp;gt;addScript(JURI::root() . $this-&amp;gt;script);&lt;br /&gt;
		$document-&amp;gt;addScript(JURI::root() . &amp;quot;/administrator/components/com_helloworld&amp;quot;&lt;br /&gt;
		                                  . &amp;quot;/views/helloworld/submitbutton.js&amp;quot;);&lt;br /&gt;
		JText::script(&#039;COM_HELLOWORLD_HELLOWORLD_ERROR_UNACCEPTABLE&#039;);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
This view now:&lt;br /&gt;
* verifies if the model has no error;&lt;br /&gt;
* adds two javascript files;&lt;br /&gt;
* injects javascript translation using the Joomla &amp;lt;tt&amp;gt;JText::script&amp;lt;/tt&amp;gt; function.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will also notice our two lines adding additional behaviors when injecting our scripts. By default, Joomla injects the Javascript we specify into the page &amp;lt;i&amp;gt;before&amp;lt;/i&amp;gt; its own global Javascript libraries, such as jQuery and Joomla Core. As our Javascript code directly utilises the &amp;lt;tt&amp;gt;Joomla&amp;lt;/tt&amp;gt; object, loading it onto the page before the global Javascript libraries will result in immediate failure, and the form validation will not run. &lt;br /&gt;
&lt;br /&gt;
By specifying these two behaviors via the JHtml helper class prior to injecting our own Javascript, we ensure they are loaded first on the page, and our code will execute correctly. You would normally see JHtml used inside a template, but as our Javascript is added for each child template, it&#039;s better to specify the external dependency here.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
The final step is to implement a &amp;lt;tt&amp;gt;getScript&amp;lt;/tt&amp;gt; function in the &#039;&#039;HelloWorldModelHelloWorld&#039;&#039; model:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/models/helloworld.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;65-73&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 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;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelAdmin&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a table object, load it if necessary.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   string  $type    The table name. Optional.&lt;br /&gt;
	 * @param   string  $prefix  The class prefix. Optional.&lt;br /&gt;
	 * @param   array   $config  Configuration array for model. Optional.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  JTable  A JTable object&lt;br /&gt;
	 *&lt;br /&gt;
	 * @since   1.6&lt;br /&gt;
	 */&lt;br /&gt;
	public function getTable($type = &#039;HelloWorld&#039;, $prefix = &#039;HelloWorldTable&#039;, $config = array())&lt;br /&gt;
	{&lt;br /&gt;
		return JTable::getInstance($type, $prefix, $config);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get the record form.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   array    $data      Data for the form.&lt;br /&gt;
	 * @param   boolean  $loadData  True if the form is to load its own data (default case), false if not.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  mixed    A JForm object on success, false on failure&lt;br /&gt;
	 *&lt;br /&gt;
	 * @since   1.6&lt;br /&gt;
	 */&lt;br /&gt;
	public function getForm($data = array(), $loadData = true)&lt;br /&gt;
	{&lt;br /&gt;
		// Get the form.&lt;br /&gt;
		$form = $this-&amp;gt;loadForm(&lt;br /&gt;
			&#039;com_helloworld.helloworld&#039;,&lt;br /&gt;
			&#039;helloworld&#039;,&lt;br /&gt;
			array(&lt;br /&gt;
				&#039;control&#039; =&amp;gt; &#039;jform&#039;,&lt;br /&gt;
				&#039;load_data&#039; =&amp;gt; $loadData&lt;br /&gt;
			)&lt;br /&gt;
		);&lt;br /&gt;
&lt;br /&gt;
		if (empty($form))&lt;br /&gt;
		{&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $form;&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get the script that have to be included on the form&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return string	Script files&lt;br /&gt;
	 */&lt;br /&gt;
	public function getScript() &lt;br /&gt;
	{&lt;br /&gt;
		return &#039;administrator/components/com_helloworld/models/forms/helloworld.js&#039;;&lt;br /&gt;
	}&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get the data that should be injected in the form.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  mixed  The data for the form.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @since   1.6&lt;br /&gt;
	 */&lt;br /&gt;
	protected function loadFormData()&lt;br /&gt;
	{&lt;br /&gt;
		// Check the session for previously entered form data.&lt;br /&gt;
		$data = JFactory::getApplication()-&amp;gt;getUserState(&lt;br /&gt;
			&#039;com_helloworld.edit.helloworld.data&#039;,&lt;br /&gt;
			array()&lt;br /&gt;
		);&lt;br /&gt;
&lt;br /&gt;
		if (empty($data))&lt;br /&gt;
		{&lt;br /&gt;
			$data = $this-&amp;gt;getItem();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $data;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Verifying the form (server side) == &amp;lt;!--T:19--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
See [[S:MyLanguage/Server-side_form_validation|Server-side form validation]] for further tutorial information relating to server-side verification.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Verifying the form on the server side is done by inheritance of &amp;lt;tt&amp;gt;JControllerForm&amp;lt;/tt&amp;gt; class. We have specified in the &#039;&#039;[[#admin/models/forms/helloworld.xml|admin/models/forms/helloworld.xml]]&#039;&#039; file that the validate server function will use a &amp;lt;tt&amp;gt;greeting.php&amp;lt;/tt&amp;gt; file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
With your favourite file manager and editor, put a &amp;lt;tt&amp;gt;admin/models/rules/greeting.php&amp;lt;/tt&amp;gt; file containing:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/rules/greeting.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/models/rules/greeting.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 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;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
 &lt;br /&gt;
/**&lt;br /&gt;
 * Form Rule class for the Joomla Framework.&lt;br /&gt;
 */&lt;br /&gt;
class JFormRuleGreeting extends JFormRule&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The regular expression.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @access	protected&lt;br /&gt;
	 * @var		string&lt;br /&gt;
	 * @since	2.5&lt;br /&gt;
	 */&lt;br /&gt;
	protected $regex = &#039;^[^0-9]+$&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
Note there is no function here - this is inherited from JFormRule (located in: libraries/joomla/form /rule.php). All that is needed is the regex string to test against.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Packaging the component == &amp;lt;!--T:23--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
Content of your code directory. Each file link below takes you to the step in the tutorial which has the latest version of that source code file.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Using_the_database#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Using_the_database#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* [[S:MyLanguage/J3.x:Developing an MVC Component/Adding language management#site.2Flanguage.2Fen-GB.2Fen-GB.com_helloworld.ini|site/language/en-GB/en-GB.com_helloworld.ini]]&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_decorations_to_the_backend#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Basic_backend#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Using_the_database#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Using_the_database#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_decorations_to_the_backend#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_verifications#admin/models/helloworld.php|admin/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding decorations to the backend#admin/models/forms/filter_helloworlds.xml|admin/models/forms/filter_helloworlds.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_verifications#admin/models/forms/helloworld.js|admin/models/forms/helloworld.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_verifications#admin/models/forms/helloworld.xml|admin/models/forms/helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_verifications#admin/models/rules/greeting.php|admin/models/rules/greeting.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/rules/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_backend_actions#admin/controllers/helloworld.php|admin/controllers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_backend_actions#admin/controllers/helloworlds.php|admin/controllers/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_verifications#admin/views/helloworld/view.html.php|admin/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_verifications#admin/views/helloworld/tmpl/edit.php|admin/views/helloworld/tmpl/edit.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_verifications#admin/views/helloworld/submitbutton.js|admin/views/helloworld/submitbutton.js]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_decorations_to_the_backend#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_decorations_to_the_backend#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Using_the_database#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/language/index.html|admin/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/language/en-GB/index.html|admin/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.x:Developing an MVC Component/Adding_decorations_to_the_backend#admin.2Flanguage.2Fen-GB.2Fen-GB.com_helloworld.ini|admin/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.x:Developing an MVC Component/Adding_decorations_to_the_backend#admin.2Flanguage.2Fen-GB.2Fen-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|media/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|media/images/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding_decorations_to_the_backend#Adding_some_icons|media/images/tux-16x16.png]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding_decorations_to_the_backend#Adding_some_icons|media/images/tux-48x48.png]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Create a compressed file of this directory [https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-11-adding-verifications.zip archive] or directly download the archive and install it using the extension manager of Joomla. You can add a menu item of this component using the menu manager in the backend.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13&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.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;COM_HELLOWORLD&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2018&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.11&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;COM_HELLOWORLD_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;languages folder=&amp;quot;site/language&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
        &amp;lt;/languages&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;media destination=&amp;quot;com_helloworld&amp;quot; folder=&amp;quot;media&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;images&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/media&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039; img=&amp;quot;../media/com_helloworld/images/tux-16x16.png&amp;quot;&amp;gt;COM_HELLOWORLD_MENU&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- views files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- controllers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
		&amp;lt;languages folder=&amp;quot;admin/language&amp;quot;&amp;gt;&lt;br /&gt;
        		&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
                        &amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB/en-GB.com_helloworld.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;/languages&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Contributors == &amp;lt;!--T:26--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User:Scionescire|Scionescire]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding decorations to the backend|Prev: Adding decorations to the backend&amp;lt;/translate&amp;gt;|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding categories|Next: Adding categories&amp;lt;/translate&amp;gt;|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[Category:Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Form_field&amp;diff=627052</id>
		<title>Form field</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Form_field&amp;diff=627052"/>
		<updated>2019-08-29T16:14:43Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Adding note re: renderField() requirement for showon and others. Translations welcome!&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;onlyinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;== Introduction == &amp;lt;!--T:1--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
Form fields are fields in a HTML &amp;lt;code&amp;gt;&amp;lt;form&amp;gt;&amp;lt;/code&amp;gt;. Joomla! 2.5 {{JVer|2.5}} and newer supply the JForm class to conveniently and flexibly create forms with a large amount of form fields. Each form field type is a subclass of JFormField.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
In addition to being a flexible page creation tool, JFormFields are used by Joomla! to allow [[S:MyLanguage/Administrator (User)|administrators]] to configure Joomla! or its extensions without changing the underlying code. In Joomla! 1.5, this was handled by the now deprecated [[S:MyLanguage/API15:JParameter|JParameter]] and [[S:MyLanguage/API15:JElement|JElement]] classes.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
To define form fields in the configuration of an extension, you must include them in a named fieldset, such as &amp;lt;code&amp;gt;&amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&amp;lt;/code&amp;gt;, that is within the &amp;lt;code&amp;gt;&amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&amp;lt;/code&amp;gt; section of the &amp;lt;code&amp;gt;&amp;lt;config&amp;gt;&amp;lt;/code&amp;gt; element in your [[S:MyLanguage/Manifest files|XML manifest file]].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Form validation == &amp;lt;!--T:5--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{:Form validation/&amp;lt;translate&amp;gt;&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;translate&amp;gt;== Standard form field types == &amp;lt;!--T:6--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{:Standard form field types/&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;translate&amp;gt;== Custom form field types == &amp;lt;!--T:7--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
An [[S:MyLanguage/extension|extension]] can define its own form field types, which can then be used in its own forms or forms created by another extension. See [[S:MyLanguage/Creating a custom form field type|Creating a custom form field type]] for instructions.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Modal form field types === &amp;lt;!--T:9--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
If you have a field with a lot of values that don&#039;t fit a selection box, you can always make a modal form field that will allow the user to pick an item from a modal page with a table, filtering options, etc. (just like any administrator table, e.g. &amp;quot;Articles&amp;quot;).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
See [[S:MyLanguage/Creating a modal form field|Creating a modal form field]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Common attributes == &amp;lt;!--T:12--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Labelclass === &amp;lt;!--T:13--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
Adding the attribute &amp;lt;code&amp;gt;labelclass&amp;lt;/code&amp;gt; adds a CSS class for form field&#039;s label. Source:&amp;lt;/translate&amp;gt; http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;amp;tracker_item_id=28450&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;=== Showon === &amp;lt;!--T:15--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
Adding the attribute &amp;lt;code&amp;gt;showon&amp;lt;/code&amp;gt; allows to hide the field based on the value(s) of another field.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
Syntax to show the field &amp;lt;tt&amp;gt;bar&amp;lt;/tt&amp;gt; only when &amp;lt;tt&amp;gt;foo&amp;lt;/tt&amp;gt; is set to &amp;quot;1&amp;quot; and &amp;lt;tt&amp;gt;baz&amp;lt;/tt&amp;gt; is set to &amp;quot;1&amp;quot;:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;field&lt;br /&gt;
    name=&amp;quot;foo&amp;quot;&lt;br /&gt;
    type=&amp;quot;list&amp;quot;&lt;br /&gt;
    &amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JYES&amp;lt;/option&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JNO&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;bar&amp;quot;&lt;br /&gt;
    type=&amp;quot;text&amp;quot;&lt;br /&gt;
    showon=&amp;quot;foo:1&amp;quot;&lt;br /&gt;
/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
To match multiple values one can provide a comma-separated list of values. Like &amp;lt;code&amp;gt;showon=&amp;quot;foo:1,2&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
To combine multiple fields you can use &amp;lt;code&amp;gt;[AND]&amp;lt;/code&amp;gt;. Like &amp;lt;code&amp;gt;showon=&amp;quot;foo:1[AND]bar:1&amp;quot;&amp;lt;/code&amp;gt;&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;
Syntax to show the field &amp;quot;bar&amp;quot; only when &amp;quot;foo&amp;quot; is set to &amp;quot;1&amp;quot; and &amp;quot;baz&amp;quot; is set to &amp;quot;1&amp;quot;:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;field&lt;br /&gt;
    name=&amp;quot;foo&amp;quot;&lt;br /&gt;
    type=&amp;quot;list&amp;quot;&lt;br /&gt;
    &amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JYES&amp;lt;/option&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JNO&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;baz&amp;quot;&lt;br /&gt;
    type=&amp;quot;list&amp;quot;&lt;br /&gt;
    &amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JYES&amp;lt;/option&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JNO&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;bar&amp;quot;&lt;br /&gt;
    type=&amp;quot;text&amp;quot;&lt;br /&gt;
    showon=&amp;quot;foo:1[AND]baz:1&amp;quot;&lt;br /&gt;
/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
To create a choice between multiple fields you can use &amp;lt;tt&amp;gt;[OR]&amp;lt;/tt&amp;gt;. Like &amp;lt;tt&amp;gt;showon=&amp;quot;foo:1[OR]bar:1&amp;quot;&amp;lt;/tt&amp;gt;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
Syntax to show the field &amp;quot;bar&amp;quot; only when &amp;quot;foo&amp;quot; is set to &amp;quot;1&amp;quot; or &amp;quot;baz&amp;quot; is set to &amp;quot;1&amp;quot;:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;field&lt;br /&gt;
    name=&amp;quot;foo&amp;quot;&lt;br /&gt;
    type=&amp;quot;list&amp;quot;&lt;br /&gt;
    &amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JYES&amp;lt;/option&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JNO&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;baz&amp;quot;&lt;br /&gt;
    type=&amp;quot;list&amp;quot;&lt;br /&gt;
    &amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JYES&amp;lt;/option&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JNO&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;bar&amp;quot;&lt;br /&gt;
    type=&amp;quot;text&amp;quot;&lt;br /&gt;
    showon=&amp;quot;foo:1[OR]baz:1&amp;quot;&lt;br /&gt;
/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
You can also use value does not equal like &amp;lt;tt&amp;gt;showon=&amp;quot;field1!:1&amp;quot;&amp;lt;/tt&amp;gt;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
Syntax to show the field &amp;quot;bar&amp;quot; only when &amp;quot;foo&amp;quot; is not equal to &amp;quot;1&amp;quot;:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;field&lt;br /&gt;
    name=&amp;quot;foo&amp;quot;&lt;br /&gt;
    type=&amp;quot;list&amp;quot;&lt;br /&gt;
    &amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JYES&amp;lt;/option&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JNO&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&amp;lt;field&lt;br /&gt;
    name=&amp;quot;baz&amp;quot;&lt;br /&gt;
    type=&amp;quot;list&amp;quot;&lt;br /&gt;
    showon=&amp;quot;foo!:1&amp;quot;&lt;br /&gt;
    &amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JYES&amp;lt;/option&amp;gt;&lt;br /&gt;
    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JNO&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;lt;/field&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
To show a field when another field (e.g. foo) has been selected (so when that other field is not empty), you can use &amp;lt;tt&amp;gt;showon=&amp;quot;foo!:&amp;quot;&amp;lt;/tt&amp;gt; (so without a value specified).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
This was introduced with PullRequest: https://github.com/joomla/joomla-cms/pull/3379, available starting with Joomla 3.2.4.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting: Attributes not working ===&lt;br /&gt;
&lt;br /&gt;
If you have read an older version of our developer documentation, or took your form display code from an existing extension, you may be experiencing issues with attributes like &amp;lt;code&amp;gt;showon&amp;lt;/code&amp;gt; not working at all. In order for some special attributes to function, your fields must be rendered using their &amp;lt;code&amp;gt;renderField()&amp;lt;/code&amp;gt; method. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;row-fluid&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;span6&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;?php &lt;br /&gt;
            foreach($this-&amp;gt;form-&amp;gt;getFieldset() as $field) {&lt;br /&gt;
                echo $field-&amp;gt;renderField();        &lt;br /&gt;
            }&lt;br /&gt;
        ?&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Landing Pages{{#translation:}}]]&lt;br /&gt;
[[Category:Form fields{{#translation:}}]]&lt;br /&gt;
[[Category:Development{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_backend_actions&amp;diff=627051</id>
		<title>J3.x:Developing an MVC Component/Adding backend actions</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_backend_actions&amp;diff=627051"/>
		<updated>2019-08-29T15:47:54Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Outputting form fields via renderField() ensures that options are correctly/fully parsed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{:J3.1:Developing an MVC Component/&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
en&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&amp;lt;translate&amp;gt;== Introduction == &amp;lt;!--T:2--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
This tutorial is part of the [[S:MyLanguage/J3.2:Developing an MVC Component | Developing an MVC Component for Joomla! 3.2]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:29--&amp;gt; There is a series of 5 videos associated with this step in the tutorial, covering (1) [https://youtu.be/ODEHeAtsGx8 Changes to the Helloworlds view and layout], (2) [https://youtu.be/6pidS152n58 Handling Deletes], and then three on the functionality required to support New and Edit: (3) [https://youtu.be/bUUh8grjhkc Handling New/Edit Redirect], (4) [https://youtu.be/R1-XVPhI-Ms Display the Helloworld message editing form] and (5) [https://youtu.be/ZXKIhIwGszE Handling Save and Cancel].&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{#widget:YouTube|id=ODEHeAtsGx8}}&lt;br /&gt;
&lt;br /&gt;
{{#widget:YouTube|id=6pidS152n58}}&lt;br /&gt;
&lt;br /&gt;
{{#widget:YouTube|id=bUUh8grjhkc}}&lt;br /&gt;
&lt;br /&gt;
{{#widget:YouTube|id=R1-XVPhI-Ms}}&lt;br /&gt;
&lt;br /&gt;
{{#widget:YouTube|id=ZXKIhIwGszE}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Adding a toolbar == &amp;lt;!--T:4--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
In Joomla, the administrator interacts generally with components through the use of a toolbar. In the file &amp;lt;tt&amp;gt;admin/views/helloworlds/view.html.php&amp;lt;/tt&amp;gt; put this content. It will create a basic toolbar and a title for the component.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
The arguments used in, for example, JToolbarHelper::addNew is used to set a controller instance which will be used after button is clicked. Further details below in the [[#Adding_specific_controllers | adding specific controllers]] section.&amp;lt;/translate&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;span id =&amp;quot;admin/views/helloworlds/view.html.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/views/helloworlds/view.html.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;41,42,55-61&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 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;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorlds View&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorlds extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Display the Hello World view&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  void&lt;br /&gt;
	 */&lt;br /&gt;
	function display($tpl = null)&lt;br /&gt;
	{&lt;br /&gt;
		// Get data from the model&lt;br /&gt;
		$this-&amp;gt;items		= $this-&amp;gt;get(&#039;Items&#039;);&lt;br /&gt;
		$this-&amp;gt;pagination	= $this-&amp;gt;get(&#039;Pagination&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Check for errors.&lt;br /&gt;
		if (count($errors = $this-&amp;gt;get(&#039;Errors&#039;)))&lt;br /&gt;
		{&lt;br /&gt;
			JError::raiseError(500, implode(&#039;&amp;lt;br /&amp;gt;&#039;, $errors));&lt;br /&gt;
&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		// Set the toolbar&lt;br /&gt;
		$this-&amp;gt;addToolBar();&lt;br /&gt;
&lt;br /&gt;
		// Display the template&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Add the page title and toolbar.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  void&lt;br /&gt;
	 *&lt;br /&gt;
	 * @since   1.6&lt;br /&gt;
	 */&lt;br /&gt;
	protected function addToolBar()&lt;br /&gt;
	{&lt;br /&gt;
		JToolbarHelper::title(JText::_(&#039;COM_HELLOWORLD_MANAGER_HELLOWORLDS&#039;));&lt;br /&gt;
		JToolbarHelper::addNew(&#039;helloworld.add&#039;);&lt;br /&gt;
		JToolbarHelper::editList(&#039;helloworld.edit&#039;);&lt;br /&gt;
		JToolbarHelper::deleteList(&#039;&#039;, &#039;helloworlds.delete&#039;);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
You can find other classic backend actions in the &amp;lt;tt&amp;gt;administrator/includes/toolbar.php&amp;lt;/tt&amp;gt; file of your Joomla installation.&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;
Since the view can perform some actions, we have to add some input data. With your favourite file manager and editor, put in the file &amp;lt;tt&amp;gt;admin/views/helloworlds/tmpl/default.php&amp;lt;/tt&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworlds/tmpl/default.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/views/helloworlds/tmpl/default.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;42,50,65,66,67&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 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;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted Access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;form action=&amp;quot;index.php?option=com_helloworld&amp;amp;view=helloworlds&amp;quot; method=&amp;quot;post&amp;quot; id=&amp;quot;adminForm&amp;quot; name=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;table class=&amp;quot;table table-striped table-hover&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;thead&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;th width=&amp;quot;1%&amp;quot;&amp;gt;&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_NUM&#039;); ?&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
			&amp;lt;th width=&amp;quot;2%&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;?php echo JHtml::_(&#039;grid.checkall&#039;); ?&amp;gt;&lt;br /&gt;
			&amp;lt;/th&amp;gt;&lt;br /&gt;
			&amp;lt;th width=&amp;quot;90%&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_HELLOWORLDS_NAME&#039;) ;?&amp;gt;&lt;br /&gt;
			&amp;lt;/th&amp;gt;&lt;br /&gt;
			&amp;lt;th width=&amp;quot;5%&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_PUBLISHED&#039;); ?&amp;gt;&lt;br /&gt;
			&amp;lt;/th&amp;gt;&lt;br /&gt;
			&amp;lt;th width=&amp;quot;2%&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_ID&#039;); ?&amp;gt;&lt;br /&gt;
			&amp;lt;/th&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
		&amp;lt;/thead&amp;gt;&lt;br /&gt;
		&amp;lt;tfoot&amp;gt;&lt;br /&gt;
			&amp;lt;tr&amp;gt;&lt;br /&gt;
				&amp;lt;td colspan=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;?php echo $this-&amp;gt;pagination-&amp;gt;getListFooter(); ?&amp;gt;&lt;br /&gt;
				&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;/tr&amp;gt;&lt;br /&gt;
		&amp;lt;/tfoot&amp;gt;&lt;br /&gt;
		&amp;lt;tbody&amp;gt;&lt;br /&gt;
			&amp;lt;?php if (!empty($this-&amp;gt;items)) : ?&amp;gt;&lt;br /&gt;
				&amp;lt;?php foreach ($this-&amp;gt;items as $i =&amp;gt; $row) :&lt;br /&gt;
					$link = JRoute::_(&#039;index.php?option=com_helloworld&amp;amp;task=helloworld.edit&amp;amp;id=&#039; . $row-&amp;gt;id);&lt;br /&gt;
				?&amp;gt;&lt;br /&gt;
					&amp;lt;tr&amp;gt;&lt;br /&gt;
						&amp;lt;td&amp;gt;&amp;lt;?php echo $this-&amp;gt;pagination-&amp;gt;getRowOffset($i); ?&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
						&amp;lt;td&amp;gt;&lt;br /&gt;
							&amp;lt;?php echo JHtml::_(&#039;grid.id&#039;, $i, $row-&amp;gt;id); ?&amp;gt;&lt;br /&gt;
						&amp;lt;/td&amp;gt;&lt;br /&gt;
						&amp;lt;td&amp;gt;&lt;br /&gt;
							&amp;lt;a href=&amp;quot;&amp;lt;?php echo $link; ?&amp;gt;&amp;quot; title=&amp;quot;&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_EDIT_HELLOWORLD&#039;); ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;?php echo $row-&amp;gt;greeting; ?&amp;gt;&lt;br /&gt;
							&amp;lt;/a&amp;gt;&lt;br /&gt;
						&amp;lt;/td&amp;gt;&lt;br /&gt;
						&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;?php echo JHtml::_(&#039;jgrid.published&#039;, $row-&amp;gt;published, $i, &#039;helloworlds.&#039;, true, &#039;cb&#039;); ?&amp;gt;&lt;br /&gt;
						&amp;lt;/td&amp;gt;&lt;br /&gt;
						&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;?php echo $row-&amp;gt;id; ?&amp;gt;&lt;br /&gt;
						&amp;lt;/td&amp;gt;&lt;br /&gt;
					&amp;lt;/tr&amp;gt;&lt;br /&gt;
				&amp;lt;?php endforeach; ?&amp;gt;&lt;br /&gt;
			&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;
		&amp;lt;/tbody&amp;gt;&lt;br /&gt;
	&amp;lt;/table&amp;gt;&lt;br /&gt;
	&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;boxchecked&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;?php echo JHtml::_(&#039;form.token&#039;); ?&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
The underscore function of JRoute is used so that the site displays SEF URLs; see [[Supporting_SEF_URLs_in_your_component|Supporting SEF URLs in your component]].&amp;lt;br /&amp;gt;&lt;br /&gt;
The &amp;quot;task&amp;quot; field is used to define the controller.task parameter which will be sent to the server in the POST request when the form is submitted.&amp;lt;br /&amp;gt;&lt;br /&gt;
The &amp;quot;boxchecked&amp;quot; field is used to keep track of the number of checkboxes ticked.&amp;lt;br /&amp;gt;&lt;br /&gt;
Using the form token helps prevent [[How_to_add_CSRF_anti-spoofing_to_forms|CSRF attacks]].&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Adding specific controllers == &amp;lt;!--T:9--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
Three actions have been added:&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;helloworlds.delete&#039;&#039; &lt;br /&gt;
* &#039;&#039;helloworld.edit&#039;&#039;&lt;br /&gt;
* &#039;&#039;helloworld.add&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
These are compound tasks (&#039;&#039;controller&#039;&#039;.&#039;&#039;task&#039;&#039;). So two new controllers &amp;lt;tt&amp;gt;HelloWorldControllerHelloWorlds&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;HelloWorldControllerHelloWorld&amp;lt;/tt&amp;gt; have to be coded. (To understand the difference between the two types of subcontrollers read more in this article: [[S:MyLanguage/JController_and_its_subclass_usage_overview|subcontrollers...]]).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/controllers/helloworlds.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/controllers/helloworlds.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 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;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorlds Controller&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldControllerHelloWorlds extends JControllerAdmin&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Proxy for getModel.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   string  $name    The model name. Optional.&lt;br /&gt;
	 * @param   string  $prefix  The class prefix. Optional.&lt;br /&gt;
	 * @param   array   $config  Configuration array for model. Optional.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  object  The model.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @since   1.6&lt;br /&gt;
	 */&lt;br /&gt;
	public function getModel($name = &#039;HelloWorld&#039;, $prefix = &#039;HelloWorldModel&#039;, $config = array(&#039;ignore_request&#039; =&amp;gt; true))&lt;br /&gt;
	{&lt;br /&gt;
		$model = parent::getModel($name, $prefix, $config);&lt;br /&gt;
&lt;br /&gt;
		return $model;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/controllers/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/controllers/helloworld.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 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;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Controller&lt;br /&gt;
 *&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 * @since       0.0.9&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldControllerHelloWorld extends JControllerForm&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Adding an editing view == &amp;lt;!--T:12--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
With your favourite file manager and editor, put a file &amp;lt;tt&amp;gt;admin/views/helloworld/view.html.php&amp;lt;/tt&amp;gt; containing:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworld/view.html.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/views/helloworld/view.html.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 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;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld View&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorld extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * View form&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var         form&lt;br /&gt;
	 */&lt;br /&gt;
	protected $form = null;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Display the Hello World view&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  void&lt;br /&gt;
	 */&lt;br /&gt;
	public function display($tpl = null)&lt;br /&gt;
	{&lt;br /&gt;
		// Get the Data&lt;br /&gt;
		$this-&amp;gt;form = $this-&amp;gt;get(&#039;Form&#039;);&lt;br /&gt;
		$this-&amp;gt;item = $this-&amp;gt;get(&#039;Item&#039;);&lt;br /&gt;
&lt;br /&gt;
		// Check for errors.&lt;br /&gt;
		if (count($errors = $this-&amp;gt;get(&#039;Errors&#039;)))&lt;br /&gt;
		{&lt;br /&gt;
			JError::raiseError(500, implode(&#039;&amp;lt;br /&amp;gt;&#039;, $errors));&lt;br /&gt;
&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		// Set the toolbar&lt;br /&gt;
		$this-&amp;gt;addToolBar();&lt;br /&gt;
&lt;br /&gt;
		// Display the template&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Add the page title and toolbar.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  void&lt;br /&gt;
	 *&lt;br /&gt;
	 * @since   1.6&lt;br /&gt;
	 */&lt;br /&gt;
	protected function addToolBar()&lt;br /&gt;
	{&lt;br /&gt;
		$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
&lt;br /&gt;
		// Hide Joomla Administrator Main menu&lt;br /&gt;
		$input-&amp;gt;set(&#039;hidemainmenu&#039;, true);&lt;br /&gt;
&lt;br /&gt;
		$isNew = ($this-&amp;gt;item-&amp;gt;id == 0);&lt;br /&gt;
&lt;br /&gt;
		if ($isNew)&lt;br /&gt;
		{&lt;br /&gt;
			$title = JText::_(&#039;COM_HELLOWORLD_MANAGER_HELLOWORLD_NEW&#039;);&lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			$title = JText::_(&#039;COM_HELLOWORLD_MANAGER_HELLOWORLD_EDIT&#039;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		JToolbarHelper::title($title, &#039;helloworld&#039;);&lt;br /&gt;
		JToolbarHelper::save(&#039;helloworld.save&#039;);&lt;br /&gt;
		JToolbarHelper::cancel(&lt;br /&gt;
			&#039;helloworld.cancel&#039;,&lt;br /&gt;
			$isNew ? &#039;JTOOLBAR_CANCEL&#039; : &#039;JTOOLBAR_CLOSE&#039;&lt;br /&gt;
		);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
This view will display data using a layout.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
Put a file &amp;lt;tt&amp;gt;admin/views/helloworld/tmpl/edit.php&amp;lt;/tt&amp;gt; containing:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/views/helloworld/tmpl/edit.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/views/helloworld/tmpl/edit.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 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;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;form action=&amp;quot;&amp;lt;?php echo JRoute::_(&#039;index.php?option=com_helloworld&amp;amp;layout=edit&amp;amp;id=&#039; . (int) $this-&amp;gt;item-&amp;gt;id); ?&amp;gt;&amp;quot;&lt;br /&gt;
    method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot; id=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;form-horizontal&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;fieldset class=&amp;quot;adminform&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;legend&amp;gt;&amp;lt;?php echo JText::_(&#039;COM_HELLOWORLD_HELLOWORLD_DETAILS&#039;); ?&amp;gt;&amp;lt;/legend&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&amp;quot;row-fluid&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&amp;quot;span6&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;?php &lt;br /&gt;
                        foreach($this-&amp;gt;form-&amp;gt;getFieldset() as $field) {&lt;br /&gt;
                            echo $field-&amp;gt;renderField();        &lt;br /&gt;
                        }&lt;br /&gt;
                    ?&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;helloworld.edit&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;?php echo JHtml::_(&#039;form.token&#039;); ?&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Adding a model and modifying the existing one == &amp;lt;!--T:16--&amp;gt;&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;
The &amp;lt;tt&amp;gt;HelloWorldViewHelloWorld&amp;lt;/tt&amp;gt; view asks form and data from a model. This model has to provide a &#039;&#039;getTable&#039;&#039;, a &#039;&#039;getForm&#039;&#039; method and a &#039;&#039;loadData&#039;&#039; method (called from the &#039;&#039;JModelAdmin&#039;&#039; controller).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/models/helloworld.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 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;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelAdmin&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a table object, load it if necessary.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   string  $type    The table name. Optional.&lt;br /&gt;
	 * @param   string  $prefix  The class prefix. Optional.&lt;br /&gt;
	 * @param   array   $config  Configuration array for model. Optional.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  JTable  A JTable object&lt;br /&gt;
	 *&lt;br /&gt;
	 * @since   1.6&lt;br /&gt;
	 */&lt;br /&gt;
	public function getTable($type = &#039;HelloWorld&#039;, $prefix = &#039;HelloWorldTable&#039;, $config = array())&lt;br /&gt;
	{&lt;br /&gt;
		return JTable::getInstance($type, $prefix, $config);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get the record form.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   array    $data      Data for the form.&lt;br /&gt;
	 * @param   boolean  $loadData  True if the form is to load its own data (default case), false if not.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  mixed    A JForm object on success, false on failure&lt;br /&gt;
	 *&lt;br /&gt;
	 * @since   1.6&lt;br /&gt;
	 */&lt;br /&gt;
	public function getForm($data = array(), $loadData = true)&lt;br /&gt;
	{&lt;br /&gt;
		// Get the form.&lt;br /&gt;
		$form = $this-&amp;gt;loadForm(&lt;br /&gt;
			&#039;com_helloworld.helloworld&#039;,&lt;br /&gt;
			&#039;helloworld&#039;,&lt;br /&gt;
			array(&lt;br /&gt;
				&#039;control&#039; =&amp;gt; &#039;jform&#039;,&lt;br /&gt;
				&#039;load_data&#039; =&amp;gt; $loadData&lt;br /&gt;
			)&lt;br /&gt;
		);&lt;br /&gt;
&lt;br /&gt;
		if (empty($form))&lt;br /&gt;
		{&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $form;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get the data that should be injected in the form.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  mixed  The data for the form.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @since   1.6&lt;br /&gt;
	 */&lt;br /&gt;
	protected function loadFormData()&lt;br /&gt;
	{&lt;br /&gt;
		// Check the session for previously entered form data.&lt;br /&gt;
		$data = JFactory::getApplication()-&amp;gt;getUserState(&lt;br /&gt;
			&#039;com_helloworld.edit.helloworld.data&#039;,&lt;br /&gt;
			array()&lt;br /&gt;
		);&lt;br /&gt;
&lt;br /&gt;
		if (empty($data))&lt;br /&gt;
		{&lt;br /&gt;
			$data = $this-&amp;gt;getItem();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $data;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
This model inherits from the &#039;&#039;JModelAdmin&#039;&#039; class and uses its &#039;&#039;loadForm&#039;&#039; method. This method searches for forms in the &#039;&#039;forms&#039;&#039; folder. With your favourite file manager and editor, put a file &amp;lt;tt&amp;gt;admin/models/forms/helloworld.xml&amp;lt;/tt&amp;gt; containing:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/forms/helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;admin/models/forms/helloworld.xml&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;form&amp;gt;&lt;br /&gt;
	&amp;lt;fieldset&amp;gt;&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
				name=&amp;quot;id&amp;quot;&lt;br /&gt;
				type=&amp;quot;hidden&amp;quot;&lt;br /&gt;
				/&amp;gt;&lt;br /&gt;
		&amp;lt;field&lt;br /&gt;
				name=&amp;quot;greeting&amp;quot;&lt;br /&gt;
				type=&amp;quot;text&amp;quot;&lt;br /&gt;
				label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_GREETING_LABEL&amp;quot;&lt;br /&gt;
				description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_GREETING_DESC&amp;quot;&lt;br /&gt;
				size=&amp;quot;40&amp;quot;&lt;br /&gt;
				class=&amp;quot;inputbox&amp;quot;&lt;br /&gt;
				default=&amp;quot;&amp;quot;&lt;br /&gt;
				/&amp;gt;&lt;br /&gt;
	&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
Note: &#039;&#039;COM_HELLOWORLD_HELLOWORLD_GREETING_LABEL&#039;&#039; and &#039;&#039;COM_HELLOWORLD_HELLOWORLD_GREETING_DESC&#039;&#039; are an alias for &#039;&#039;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&#039;&#039; and &#039;&#039;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&#039;&#039; respectively.&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;
Here we are using different label and description to convey two different meanings in two different sections, but they can be easily kept equal.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Packaging the component == &amp;lt;!--T:21--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
Content of your code directory&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_a_view_to_the_site_part#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_a_view_to_the_site_part#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Using_the_database#site/views/helloworld/tmpl/default.xml|site/views/helloworld/tmpl/default.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_a_view_to_the_site_part#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Using_the_database#site/models/helloworld.php|site/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* [[S:MyLanguage/J3.x:Developing an MVC Component/Adding language management#site.2Flanguage.2Fen-GB.2Fen-GB.com_helloworld.ini|site/language/en-GB/en-GB.com_helloworld.ini]]&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Basic_backend#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Basic_backend#admin/controller.php|admin/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Using_the_database#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Using_the_database#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Using_the_database#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Basic_backend#admin/models/helloworlds.php|admin/models/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_backend_actions#admin/models/helloworlds.php|admin/models/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/models/forms/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_backend_actions#admin/models/forms/helloworld.xml|admin/models/forms/helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_backend_actions#admin/controllers/helloworld.php|admin/controllers/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_backend_actions#admin/controllers/helloworlds.php|admin/controllers/helloworlds.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/controllers/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_backend_actions#admin/views/helloworld/view.html.php|admin/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Adding_backend_actions#admin/views/helloworld/tmpl/edit.php|admin/views/helloworld/tmpl/edit.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworld/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Basic_backend#admin/views/helloworlds/view.html.php|admin/views/helloworlds/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/views/helloworlds/tmpl/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Basic_backend#admin/views/helloworlds/tmpl/default.php|admin/views/helloworlds/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Using_the_database#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/language/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|admin/language/en-GB/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.x:Developing an MVC Component/Adding language management#admin.2Flanguage.2Fen-GB.2Fen-GB.com_helloworld.ini|admin/language/en-GB/en-GB.com_helloworld.ini]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.x:Developing an MVC Component/Adding language management#admin.2Flanguage.2Fen-GB.2Fen-GB.com_helloworld.sys.ini|admin/language/en-GB/en-GB.com_helloworld.sys.ini]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
Create a compressed file of this directory or directly download the [https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-9-adding-backend-actions.zip archive] and install it using the extension manager of Joomla. You can add a menu item of this component using the menu manager in the backend.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,69,70&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.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;COM_HELLOWORLD&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2018&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.9&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;COM_HELLOWORLD_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;languages folder=&amp;quot;site/language&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
        &amp;lt;/languages&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;COM_HELLOWORLD_MENU&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- views files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- controllers files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;controllers&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
		&amp;lt;languages folder=&amp;quot;admin/language&amp;quot;&amp;gt;&lt;br /&gt;
        		&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
                        &amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB/en-GB.com_helloworld.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;/languages&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{notice|&amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
Please create a pull request or issue at https://github.com/joomla/Joomla-3.2-Hello-World-Component for any code descprepancies or if editing any of the source code on this page.&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;== Contributors == &amp;lt;!--T:25--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User:betweenbrain|Matt Thomas]]&lt;br /&gt;
*[[User:Gunjanpatel|Gunjan Patel]]&lt;br /&gt;
*[[User:Scionescire|Scionescire]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;row&amp;quot;&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&amp;lt;translate&amp;gt;&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding language management|Prev: Adding language management&amp;lt;/translate&amp;gt;|class=expand success}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;large-6 columns&amp;quot;&amp;gt;{{Basic button|&amp;lt;translate&amp;gt;&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding decorations to the backend|Next: Adding decorations to the backend&amp;lt;/translate&amp;gt;|class=expand}}&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
[[Category:Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Tutorials in a Series]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:GregJPreece&amp;diff=627050</id>
		<title>User:GregJPreece</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:GregJPreece&amp;diff=627050"/>
		<updated>2019-08-29T15:40:12Z</updated>

		<summary type="html">&lt;p&gt;GregJPreece: Created page with &amp;quot;Senior Software Engineer from Vancouver, Canada. Creating open source Joomla extensions, and the kind of weirdo that enjoys updating documentation.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Senior Software Engineer from Vancouver, Canada. Creating open source Joomla extensions, and the kind of weirdo that enjoys updating documentation.&lt;/div&gt;</summary>
		<author><name>GregJPreece</name></author>
	</entry>
</feed>