<?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=Perete</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=Perete"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Perete"/>
	<updated>2026-05-14T13:50:31Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=207075</id>
		<title>J3.x:Developing an MVC Component/Using the database/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=207075"/>
		<updated>2015-07-22T09:11:52Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Pour le moment, nous avons utilisé un  type de champ codé dans le dur pour les messages...&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;
{{:J3.1:Developing an MVC Component/fr}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
&lt;br /&gt;
== Utiliser la base de données ==&lt;br /&gt;
Les composants gèrent généralement leur contenu à l&#039;aide de la base de données. Lors de la procédure  d&#039;installation/désinstallation/mise à jour d&#039;un composant, vous pouvez exécuter des requêtes SQL par l&#039;utilisation de  fichiers texte SQL.&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers et éditeur préférés, créer deux fichiers appelés &amp;lt;tt&amp;gt;admin/sql/install.mysql.utf8.sql&amp;lt;/tt&amp;gt; et &amp;lt;tt&amp;gt;admin/sql/updates/mysql/0.0.6.sql&amp;lt;/tt&amp;gt;. Ils devraient tous les deux avoir le même contenu :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/install.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039;&#039; and &#039;&#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld` (&lt;br /&gt;
	`id`       INT(11)     NOT NULL AUTO_INCREMENT,&lt;br /&gt;
	`greeting` VARCHAR(25) NOT NULL,&lt;br /&gt;
	`published` tinyint(4) NOT NULL,&lt;br /&gt;
	PRIMARY KEY (`id`)&lt;br /&gt;
)&lt;br /&gt;
	ENGINE =MyISAM&lt;br /&gt;
	AUTO_INCREMENT =0&lt;br /&gt;
	DEFAULT CHARSET =utf8;&lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld` (`greeting`) VALUES&lt;br /&gt;
(&#039;Hello World!&#039;),&lt;br /&gt;
(&#039;Good bye World!&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Le fichier &amp;lt;tt&amp;gt;install.mysql.utf8.sql&amp;lt;/tt&amp;gt; sera exécuté lorsque vous installez le composant. Le fichier &#039;&#039;0.0.6.sql&#039;&#039; est exécuté lorsque vous effectuez une mise à jour.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Remarque importante :&#039;&#039;&#039; Lorsque le composant est installé, les fichiers du dossier des mises à jour SQL (par exemple,  &#039;&#039;admin/sql/updates/mysql&#039;&#039;) sont lus et le nom du dernier fichier, dans l&#039;ordre alphabétique, est utilisé pour ajouter le numéro de version du composant à la table &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt;. Cette valeur doit être présente dans ce tableau afin que la mise à jour automatique puisse exécuter la mise à jour des fichiers SQL pour les futures versions. C&#039;est pourquoi il est judicieux de créer un fichier de mise à jour SQL pour chaque version (même s&#039;il est vide ou ne comporte qu&#039;un commentaire). Ainsi, la version &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; correspondra toujours à la version du composant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Remarque importante :&#039;&#039;&#039; Lors de l&#039;enregistrement des fichiers SQL en utf8, assurez-vous de bien les enregistrer en utf8 SANS BOM, sinon la requête échouera avec l&#039;erreur MySQL #1064.&lt;br /&gt;
&lt;br /&gt;
Voici le fichier d&#039;installation. Il sera exécuté si vous respectez un ordre approprié dans votre fichier &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&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;&#039;&#039;&#039;helloworld.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,17-26,58-61&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.6&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Faites de même avec le fichier de désinstallation :&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers  et éditeur préférés ajouter un fichier &amp;lt;tt&amp;gt;admin/sql/uninstall.mysql.utf8.sql&amp;lt;/tt&amp;gt; contenant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/uninstall.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ajouter un nouveau type de champ ==&lt;br /&gt;
Pour le moment, nous avons utilisé un [[S:MyLanguage/J3.3:Developing an MVC Component/Adding a menu type to the site part| type de champ codé dans le dur pour les messages]]. Nous devons utiliser notre base de données pour choisir le message.&lt;br /&gt;
&lt;br /&gt;
Modifier le fichier &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt; et ajouter ces lignes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;8,11-16&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields&lt;br /&gt;
			name=&amp;quot;request&amp;quot;&lt;br /&gt;
			addfieldpath=&amp;quot;/administrator/components/com_helloworld/models/fields&amp;quot;&lt;br /&gt;
			&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;id&amp;quot;&lt;br /&gt;
					type=&amp;quot;helloworld&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
					/&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Il introduit un nouveau type de champ et demande à Joomla de rechercher la définition de ce champ dans le dossier &amp;lt;tt&amp;gt;/administrator/components/com_helloworld/models/fields de&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A l&#039;aide de votre gestionnaire de fichiers et éditeur préférés, ajoutez un fichier &#039;&#039;site/models/helloworld.php&#039;&#039; contenant :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/fields/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/models/fields/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JFormHelper::loadFieldClass(&#039;list&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Form Field class for the HelloWorld component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class JFormFieldHelloWorld extends JFormFieldList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The field type.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var         string&lt;br /&gt;
	 */&lt;br /&gt;
	protected $type = &#039;HelloWorld&#039;;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a list of options for a list input.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  array  An array of JHtml options.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getOptions()&lt;br /&gt;
	{&lt;br /&gt;
		$db    = JFactory::getDBO();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		$query-&amp;gt;select(&#039;id,greeting&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		$db-&amp;gt;setQuery((string) $query);&lt;br /&gt;
		$messages = $db-&amp;gt;loadObjectList();&lt;br /&gt;
		$options  = array();&lt;br /&gt;
&lt;br /&gt;
		if ($messages)&lt;br /&gt;
		{&lt;br /&gt;
			foreach ($messages as $message)&lt;br /&gt;
			{&lt;br /&gt;
				$options[] = JHtml::_(&#039;select.option&#039;, $message-&amp;gt;id, $message-&amp;gt;greeting);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$options = array_merge(parent::getOptions(), $options);&lt;br /&gt;
&lt;br /&gt;
		return $options;&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;
Le nouveau type de champ affiche une liste déroulante des messages à choisir. Vous pouvez voir le résultat de ce changement dans le gestionnaire de menu de la section helloworld.&lt;br /&gt;
&lt;br /&gt;
== Afficher le message sélectionné ==&lt;br /&gt;
When a menu item of this component is created/updated, Joomla stores the identifier of the message. The &amp;lt;tt&amp;gt;HelloWorldModelHelloWorld&amp;lt;/tt&amp;gt; model has now to compute the message according to this identifier and the data stored in the database.&lt;br /&gt;
&lt;br /&gt;
Modifiez le fichier &amp;lt;tt&amp;gt;site/models/helloworld.php&amp;lt;/tt&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/models/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var array messages&lt;br /&gt;
	 */&lt;br /&gt;
	protected $messages;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * 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;
	 * Get the message&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   integer  $id  Greeting Id&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  string        Fetched String from Table for relevant Id&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg($id = 1)&lt;br /&gt;
	{&lt;br /&gt;
		if (!is_array($this-&amp;gt;messages))&lt;br /&gt;
		{&lt;br /&gt;
			$this-&amp;gt;messages = array();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;messages[$id]))&lt;br /&gt;
		{&lt;br /&gt;
			// Request the selected id&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&lt;br /&gt;
			// Get a TableHelloWorld instance&lt;br /&gt;
			$table = $this-&amp;gt;getTable();&lt;br /&gt;
&lt;br /&gt;
			// Load the message&lt;br /&gt;
			$table-&amp;gt;load($id);&lt;br /&gt;
&lt;br /&gt;
			// Assign the message&lt;br /&gt;
			$this-&amp;gt;messages[$id] = $table-&amp;gt;greeting;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $this-&amp;gt;messages[$id];&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The model now asks the &#039;&#039;TableHelloWorld&#039;&#039; to get the message. This table class has to be defined in &amp;lt;tt&amp;gt;admin/tables/helloworld.php&amp;lt;/tt&amp;gt; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/tables/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldTableHelloWorld extends JTable&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   JDatabaseDriver  &amp;amp;$db  A database connector object&lt;br /&gt;
	 */&lt;br /&gt;
	function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct(&#039;#__helloworld&#039;, &#039;id&#039;, $db);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You shouldn&#039;t see any differences, but if you access the database you should see a table named &#039;&#039;jos_helloworld&#039;&#039; with two columns: id and greeting. And two entries: &#039;&#039;Hello World!&#039;&#039; and &#039;&#039;Good bye World&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
&lt;br /&gt;
Contenu de votre répertoire de code&lt;br /&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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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;[[#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[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;[[#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;[[#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/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-6-using-the-database.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez ajouter un élément de menu pour ce composant à l&#039;aide du gestionnaire de menus dans le backend.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding a variable request in the menu type|Préc. : Ajouter une requête de variable dans le type de menu|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Basic backend|Suiv. : Backend de base|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! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/14/fr&amp;diff=207074</id>
		<title>Translations:J3.x:Developing an MVC Component/Using the database/14/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/14/fr&amp;diff=207074"/>
		<updated>2015-07-22T09:11:52Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Pour le moment, nous avons utilisé un  type de champ codé dans le dur pour les messages...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Pour le moment, nous avons utilisé un [[S:MyLanguage/J3.3:Developing an MVC Component/Adding a menu type to the site part| type de champ codé dans le dur pour les messages]]. Nous devons utiliser notre base de données pour choisir le message.&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=207073</id>
		<title>J3.x:Developing an MVC Component/Using the database/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=207073"/>
		<updated>2015-07-22T09:08:50Z</updated>

		<summary type="html">&lt;p&gt;Perete: &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/fr}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
&lt;br /&gt;
== Utiliser la base de données ==&lt;br /&gt;
Les composants gèrent généralement leur contenu à l&#039;aide de la base de données. Lors de la procédure  d&#039;installation/désinstallation/mise à jour d&#039;un composant, vous pouvez exécuter des requêtes SQL par l&#039;utilisation de  fichiers texte SQL.&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers et éditeur préférés, créer deux fichiers appelés &amp;lt;tt&amp;gt;admin/sql/install.mysql.utf8.sql&amp;lt;/tt&amp;gt; et &amp;lt;tt&amp;gt;admin/sql/updates/mysql/0.0.6.sql&amp;lt;/tt&amp;gt;. Ils devraient tous les deux avoir le même contenu :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/install.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039;&#039; and &#039;&#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld` (&lt;br /&gt;
	`id`       INT(11)     NOT NULL AUTO_INCREMENT,&lt;br /&gt;
	`greeting` VARCHAR(25) NOT NULL,&lt;br /&gt;
	`published` tinyint(4) NOT NULL,&lt;br /&gt;
	PRIMARY KEY (`id`)&lt;br /&gt;
)&lt;br /&gt;
	ENGINE =MyISAM&lt;br /&gt;
	AUTO_INCREMENT =0&lt;br /&gt;
	DEFAULT CHARSET =utf8;&lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld` (`greeting`) VALUES&lt;br /&gt;
(&#039;Hello World!&#039;),&lt;br /&gt;
(&#039;Good bye World!&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Le fichier &amp;lt;tt&amp;gt;install.mysql.utf8.sql&amp;lt;/tt&amp;gt; sera exécuté lorsque vous installez le composant. Le fichier &#039;&#039;0.0.6.sql&#039;&#039; est exécuté lorsque vous effectuez une mise à jour.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Remarque importante :&#039;&#039;&#039; Lorsque le composant est installé, les fichiers du dossier des mises à jour SQL (par exemple,  &#039;&#039;admin/sql/updates/mysql&#039;&#039;) sont lus et le nom du dernier fichier, dans l&#039;ordre alphabétique, est utilisé pour ajouter le numéro de version du composant à la table &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt;. Cette valeur doit être présente dans ce tableau afin que la mise à jour automatique puisse exécuter la mise à jour des fichiers SQL pour les futures versions. C&#039;est pourquoi il est judicieux de créer un fichier de mise à jour SQL pour chaque version (même s&#039;il est vide ou ne comporte qu&#039;un commentaire). Ainsi, la version &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; correspondra toujours à la version du composant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Remarque importante :&#039;&#039;&#039; Lors de l&#039;enregistrement des fichiers SQL en utf8, assurez-vous de bien les enregistrer en utf8 SANS BOM, sinon la requête échouera avec l&#039;erreur MySQL #1064.&lt;br /&gt;
&lt;br /&gt;
Voici le fichier d&#039;installation. Il sera exécuté si vous respectez un ordre approprié dans votre fichier &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&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;&#039;&#039;&#039;helloworld.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,17-26,58-61&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.6&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Faites de même avec le fichier de désinstallation :&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers  et éditeur préférés ajouter un fichier &amp;lt;tt&amp;gt;admin/sql/uninstall.mysql.utf8.sql&amp;lt;/tt&amp;gt; contenant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/uninstall.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ajouter un nouveau type de champ ==&lt;br /&gt;
For the moment, we have used a [[S:MyLanguage/J3.3:Developing an MVC Component/Adding a menu type to the site part|hard coded field type for messages]]. We need to use our database for choosing the message.&lt;br /&gt;
&lt;br /&gt;
Modifier le fichier &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt; et ajouter ces lignes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;8,11-16&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields&lt;br /&gt;
			name=&amp;quot;request&amp;quot;&lt;br /&gt;
			addfieldpath=&amp;quot;/administrator/components/com_helloworld/models/fields&amp;quot;&lt;br /&gt;
			&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;id&amp;quot;&lt;br /&gt;
					type=&amp;quot;helloworld&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
					/&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Il introduit un nouveau type de champ et demande à Joomla de rechercher la définition de ce champ dans le dossier &amp;lt;tt&amp;gt;/administrator/components/com_helloworld/models/fields de&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A l&#039;aide de votre gestionnaire de fichiers et éditeur préférés, ajoutez un fichier &#039;&#039;site/models/helloworld.php&#039;&#039; contenant :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/fields/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/models/fields/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JFormHelper::loadFieldClass(&#039;list&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Form Field class for the HelloWorld component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class JFormFieldHelloWorld extends JFormFieldList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The field type.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var         string&lt;br /&gt;
	 */&lt;br /&gt;
	protected $type = &#039;HelloWorld&#039;;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a list of options for a list input.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  array  An array of JHtml options.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getOptions()&lt;br /&gt;
	{&lt;br /&gt;
		$db    = JFactory::getDBO();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		$query-&amp;gt;select(&#039;id,greeting&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		$db-&amp;gt;setQuery((string) $query);&lt;br /&gt;
		$messages = $db-&amp;gt;loadObjectList();&lt;br /&gt;
		$options  = array();&lt;br /&gt;
&lt;br /&gt;
		if ($messages)&lt;br /&gt;
		{&lt;br /&gt;
			foreach ($messages as $message)&lt;br /&gt;
			{&lt;br /&gt;
				$options[] = JHtml::_(&#039;select.option&#039;, $message-&amp;gt;id, $message-&amp;gt;greeting);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$options = array_merge(parent::getOptions(), $options);&lt;br /&gt;
&lt;br /&gt;
		return $options;&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;
Le nouveau type de champ affiche une liste déroulante des messages à choisir. Vous pouvez voir le résultat de ce changement dans le gestionnaire de menu de la section helloworld.&lt;br /&gt;
&lt;br /&gt;
== Afficher le message sélectionné ==&lt;br /&gt;
When a menu item of this component is created/updated, Joomla stores the identifier of the message. The &amp;lt;tt&amp;gt;HelloWorldModelHelloWorld&amp;lt;/tt&amp;gt; model has now to compute the message according to this identifier and the data stored in the database.&lt;br /&gt;
&lt;br /&gt;
Modifiez le fichier &amp;lt;tt&amp;gt;site/models/helloworld.php&amp;lt;/tt&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/models/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var array messages&lt;br /&gt;
	 */&lt;br /&gt;
	protected $messages;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * 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;
	 * Get the message&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   integer  $id  Greeting Id&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  string        Fetched String from Table for relevant Id&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg($id = 1)&lt;br /&gt;
	{&lt;br /&gt;
		if (!is_array($this-&amp;gt;messages))&lt;br /&gt;
		{&lt;br /&gt;
			$this-&amp;gt;messages = array();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;messages[$id]))&lt;br /&gt;
		{&lt;br /&gt;
			// Request the selected id&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&lt;br /&gt;
			// Get a TableHelloWorld instance&lt;br /&gt;
			$table = $this-&amp;gt;getTable();&lt;br /&gt;
&lt;br /&gt;
			// Load the message&lt;br /&gt;
			$table-&amp;gt;load($id);&lt;br /&gt;
&lt;br /&gt;
			// Assign the message&lt;br /&gt;
			$this-&amp;gt;messages[$id] = $table-&amp;gt;greeting;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $this-&amp;gt;messages[$id];&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The model now asks the &#039;&#039;TableHelloWorld&#039;&#039; to get the message. This table class has to be defined in &amp;lt;tt&amp;gt;admin/tables/helloworld.php&amp;lt;/tt&amp;gt; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/tables/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldTableHelloWorld extends JTable&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   JDatabaseDriver  &amp;amp;$db  A database connector object&lt;br /&gt;
	 */&lt;br /&gt;
	function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct(&#039;#__helloworld&#039;, &#039;id&#039;, $db);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You shouldn&#039;t see any differences, but if you access the database you should see a table named &#039;&#039;jos_helloworld&#039;&#039; with two columns: id and greeting. And two entries: &#039;&#039;Hello World!&#039;&#039; and &#039;&#039;Good bye World&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
&lt;br /&gt;
Contenu de votre répertoire de code&lt;br /&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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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;[[#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[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;[[#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;[[#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/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-6-using-the-database.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez ajouter un élément de menu pour ce composant à l&#039;aide du gestionnaire de menus dans le backend.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding a variable request in the menu type|Préc. : Ajouter une requête de variable dans le type de menu|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Basic backend|Suiv. : Backend de base|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! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/18/fr&amp;diff=207072</id>
		<title>Translations:J3.x:Developing an MVC Component/Using the database/18/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/18/fr&amp;diff=207072"/>
		<updated>2015-07-22T09:08:49Z</updated>

		<summary type="html">&lt;p&gt;Perete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Le nouveau type de champ affiche une liste déroulante des messages à choisir. Vous pouvez voir le résultat de ce changement dans le gestionnaire de menu de la section helloworld.&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=207071</id>
		<title>J3.x:Developing an MVC Component/Using the database/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=207071"/>
		<updated>2015-07-22T09:03:34Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;A l&amp;#039;aide de votre gestionnaire de fichiers et éditeur préférés, ajoutez un fichier &amp;#039;&amp;#039;site/models/helloworld.php&amp;#039;&amp;#039; contenant :&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;
{{:J3.1:Developing an MVC Component/fr}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
&lt;br /&gt;
== Utiliser la base de données ==&lt;br /&gt;
Les composants gèrent généralement leur contenu à l&#039;aide de la base de données. Lors de la procédure  d&#039;installation/désinstallation/mise à jour d&#039;un composant, vous pouvez exécuter des requêtes SQL par l&#039;utilisation de  fichiers texte SQL.&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers et éditeur préférés, créer deux fichiers appelés &amp;lt;tt&amp;gt;admin/sql/install.mysql.utf8.sql&amp;lt;/tt&amp;gt; et &amp;lt;tt&amp;gt;admin/sql/updates/mysql/0.0.6.sql&amp;lt;/tt&amp;gt;. Ils devraient tous les deux avoir le même contenu :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/install.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039;&#039; and &#039;&#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld` (&lt;br /&gt;
	`id`       INT(11)     NOT NULL AUTO_INCREMENT,&lt;br /&gt;
	`greeting` VARCHAR(25) NOT NULL,&lt;br /&gt;
	`published` tinyint(4) NOT NULL,&lt;br /&gt;
	PRIMARY KEY (`id`)&lt;br /&gt;
)&lt;br /&gt;
	ENGINE =MyISAM&lt;br /&gt;
	AUTO_INCREMENT =0&lt;br /&gt;
	DEFAULT CHARSET =utf8;&lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld` (`greeting`) VALUES&lt;br /&gt;
(&#039;Hello World!&#039;),&lt;br /&gt;
(&#039;Good bye World!&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Le fichier &amp;lt;tt&amp;gt;install.mysql.utf8.sql&amp;lt;/tt&amp;gt; sera exécuté lorsque vous installez le composant. Le fichier &#039;&#039;0.0.6.sql&#039;&#039; est exécuté lorsque vous effectuez une mise à jour.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Remarque importante :&#039;&#039;&#039; Lorsque le composant est installé, les fichiers du dossier des mises à jour SQL (par exemple,  &#039;&#039;admin/sql/updates/mysql&#039;&#039;) sont lus et le nom du dernier fichier, dans l&#039;ordre alphabétique, est utilisé pour ajouter le numéro de version du composant à la table &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt;. Cette valeur doit être présente dans ce tableau afin que la mise à jour automatique puisse exécuter la mise à jour des fichiers SQL pour les futures versions. C&#039;est pourquoi il est judicieux de créer un fichier de mise à jour SQL pour chaque version (même s&#039;il est vide ou ne comporte qu&#039;un commentaire). Ainsi, la version &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; correspondra toujours à la version du composant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Remarque importante :&#039;&#039;&#039; Lors de l&#039;enregistrement des fichiers SQL en utf8, assurez-vous de bien les enregistrer en utf8 SANS BOM, sinon la requête échouera avec l&#039;erreur MySQL #1064.&lt;br /&gt;
&lt;br /&gt;
Voici le fichier d&#039;installation. Il sera exécuté si vous respectez un ordre approprié dans votre fichier &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&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;&#039;&#039;&#039;helloworld.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,17-26,58-61&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.6&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Faites de même avec le fichier de désinstallation :&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers  et éditeur préférés ajouter un fichier &amp;lt;tt&amp;gt;admin/sql/uninstall.mysql.utf8.sql&amp;lt;/tt&amp;gt; contenant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/uninstall.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ajouter un nouveau type de champ ==&lt;br /&gt;
For the moment, we have used a [[S:MyLanguage/J3.3:Developing an MVC Component/Adding a menu type to the site part|hard coded field type for messages]]. We need to use our database for choosing the message.&lt;br /&gt;
&lt;br /&gt;
Modifier le fichier &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt; et ajouter ces lignes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;8,11-16&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields&lt;br /&gt;
			name=&amp;quot;request&amp;quot;&lt;br /&gt;
			addfieldpath=&amp;quot;/administrator/components/com_helloworld/models/fields&amp;quot;&lt;br /&gt;
			&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;id&amp;quot;&lt;br /&gt;
					type=&amp;quot;helloworld&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
					/&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Il introduit un nouveau type de champ et demande à Joomla de rechercher la définition de ce champ dans le dossier &amp;lt;tt&amp;gt;/administrator/components/com_helloworld/models/fields de&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A l&#039;aide de votre gestionnaire de fichiers et éditeur préférés, ajoutez un fichier &#039;&#039;site/models/helloworld.php&#039;&#039; contenant :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/fields/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/models/fields/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JFormHelper::loadFieldClass(&#039;list&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Form Field class for the HelloWorld component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class JFormFieldHelloWorld extends JFormFieldList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The field type.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var         string&lt;br /&gt;
	 */&lt;br /&gt;
	protected $type = &#039;HelloWorld&#039;;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a list of options for a list input.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  array  An array of JHtml options.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getOptions()&lt;br /&gt;
	{&lt;br /&gt;
		$db    = JFactory::getDBO();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		$query-&amp;gt;select(&#039;id,greeting&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		$db-&amp;gt;setQuery((string) $query);&lt;br /&gt;
		$messages = $db-&amp;gt;loadObjectList();&lt;br /&gt;
		$options  = array();&lt;br /&gt;
&lt;br /&gt;
		if ($messages)&lt;br /&gt;
		{&lt;br /&gt;
			foreach ($messages as $message)&lt;br /&gt;
			{&lt;br /&gt;
				$options[] = JHtml::_(&#039;select.option&#039;, $message-&amp;gt;id, $message-&amp;gt;greeting);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$options = array_merge(parent::getOptions(), $options);&lt;br /&gt;
&lt;br /&gt;
		return $options;&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;
Le nouveau type de champ affiche une liste déroulante des messages à choisir. Vous pouvez voir le résultat de ce changement dans le menu gestionnaire de la section Helloworld.&lt;br /&gt;
&lt;br /&gt;
== Afficher le message sélectionné ==&lt;br /&gt;
When a menu item of this component is created/updated, Joomla stores the identifier of the message. The &amp;lt;tt&amp;gt;HelloWorldModelHelloWorld&amp;lt;/tt&amp;gt; model has now to compute the message according to this identifier and the data stored in the database.&lt;br /&gt;
&lt;br /&gt;
Modifiez le fichier &amp;lt;tt&amp;gt;site/models/helloworld.php&amp;lt;/tt&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/models/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var array messages&lt;br /&gt;
	 */&lt;br /&gt;
	protected $messages;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * 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;
	 * Get the message&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   integer  $id  Greeting Id&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  string        Fetched String from Table for relevant Id&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg($id = 1)&lt;br /&gt;
	{&lt;br /&gt;
		if (!is_array($this-&amp;gt;messages))&lt;br /&gt;
		{&lt;br /&gt;
			$this-&amp;gt;messages = array();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;messages[$id]))&lt;br /&gt;
		{&lt;br /&gt;
			// Request the selected id&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&lt;br /&gt;
			// Get a TableHelloWorld instance&lt;br /&gt;
			$table = $this-&amp;gt;getTable();&lt;br /&gt;
&lt;br /&gt;
			// Load the message&lt;br /&gt;
			$table-&amp;gt;load($id);&lt;br /&gt;
&lt;br /&gt;
			// Assign the message&lt;br /&gt;
			$this-&amp;gt;messages[$id] = $table-&amp;gt;greeting;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $this-&amp;gt;messages[$id];&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The model now asks the &#039;&#039;TableHelloWorld&#039;&#039; to get the message. This table class has to be defined in &amp;lt;tt&amp;gt;admin/tables/helloworld.php&amp;lt;/tt&amp;gt; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/tables/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldTableHelloWorld extends JTable&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   JDatabaseDriver  &amp;amp;$db  A database connector object&lt;br /&gt;
	 */&lt;br /&gt;
	function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct(&#039;#__helloworld&#039;, &#039;id&#039;, $db);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You shouldn&#039;t see any differences, but if you access the database you should see a table named &#039;&#039;jos_helloworld&#039;&#039; with two columns: id and greeting. And two entries: &#039;&#039;Hello World!&#039;&#039; and &#039;&#039;Good bye World&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
&lt;br /&gt;
Contenu de votre répertoire de code&lt;br /&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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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;[[#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[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;[[#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;[[#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/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-6-using-the-database.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez ajouter un élément de menu pour ce composant à l&#039;aide du gestionnaire de menus dans le backend.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding a variable request in the menu type|Préc. : Ajouter une requête de variable dans le type de menu|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Basic backend|Suiv. : Backend de base|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! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/17/fr&amp;diff=207070</id>
		<title>Translations:J3.x:Developing an MVC Component/Using the database/17/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/17/fr&amp;diff=207070"/>
		<updated>2015-07-22T09:03:34Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;A l&amp;#039;aide de votre gestionnaire de fichiers et éditeur préférés, ajoutez un fichier &amp;#039;&amp;#039;site/models/helloworld.php&amp;#039;&amp;#039; contenant :&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A l&#039;aide de votre gestionnaire de fichiers et éditeur préférés, ajoutez un fichier &#039;&#039;site/models/helloworld.php&#039;&#039; contenant :&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=207069</id>
		<title>J3.x:Developing an MVC Component/Using the database/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=207069"/>
		<updated>2015-07-22T09:03:08Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Le nouveau type de champ affiche une liste déroulante des messages à choisir. Vous pouvez voir le résultat de ce changement dans le menu gestionnaire de la section Helloworld.&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;
{{:J3.1:Developing an MVC Component/fr}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
&lt;br /&gt;
== Utiliser la base de données ==&lt;br /&gt;
Les composants gèrent généralement leur contenu à l&#039;aide de la base de données. Lors de la procédure  d&#039;installation/désinstallation/mise à jour d&#039;un composant, vous pouvez exécuter des requêtes SQL par l&#039;utilisation de  fichiers texte SQL.&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers et éditeur préférés, créer deux fichiers appelés &amp;lt;tt&amp;gt;admin/sql/install.mysql.utf8.sql&amp;lt;/tt&amp;gt; et &amp;lt;tt&amp;gt;admin/sql/updates/mysql/0.0.6.sql&amp;lt;/tt&amp;gt;. Ils devraient tous les deux avoir le même contenu :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/install.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039;&#039; and &#039;&#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld` (&lt;br /&gt;
	`id`       INT(11)     NOT NULL AUTO_INCREMENT,&lt;br /&gt;
	`greeting` VARCHAR(25) NOT NULL,&lt;br /&gt;
	`published` tinyint(4) NOT NULL,&lt;br /&gt;
	PRIMARY KEY (`id`)&lt;br /&gt;
)&lt;br /&gt;
	ENGINE =MyISAM&lt;br /&gt;
	AUTO_INCREMENT =0&lt;br /&gt;
	DEFAULT CHARSET =utf8;&lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld` (`greeting`) VALUES&lt;br /&gt;
(&#039;Hello World!&#039;),&lt;br /&gt;
(&#039;Good bye World!&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Le fichier &amp;lt;tt&amp;gt;install.mysql.utf8.sql&amp;lt;/tt&amp;gt; sera exécuté lorsque vous installez le composant. Le fichier &#039;&#039;0.0.6.sql&#039;&#039; est exécuté lorsque vous effectuez une mise à jour.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Remarque importante :&#039;&#039;&#039; Lorsque le composant est installé, les fichiers du dossier des mises à jour SQL (par exemple,  &#039;&#039;admin/sql/updates/mysql&#039;&#039;) sont lus et le nom du dernier fichier, dans l&#039;ordre alphabétique, est utilisé pour ajouter le numéro de version du composant à la table &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt;. Cette valeur doit être présente dans ce tableau afin que la mise à jour automatique puisse exécuter la mise à jour des fichiers SQL pour les futures versions. C&#039;est pourquoi il est judicieux de créer un fichier de mise à jour SQL pour chaque version (même s&#039;il est vide ou ne comporte qu&#039;un commentaire). Ainsi, la version &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; correspondra toujours à la version du composant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Remarque importante :&#039;&#039;&#039; Lors de l&#039;enregistrement des fichiers SQL en utf8, assurez-vous de bien les enregistrer en utf8 SANS BOM, sinon la requête échouera avec l&#039;erreur MySQL #1064.&lt;br /&gt;
&lt;br /&gt;
Voici le fichier d&#039;installation. Il sera exécuté si vous respectez un ordre approprié dans votre fichier &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&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;&#039;&#039;&#039;helloworld.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,17-26,58-61&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.6&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Faites de même avec le fichier de désinstallation :&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers  et éditeur préférés ajouter un fichier &amp;lt;tt&amp;gt;admin/sql/uninstall.mysql.utf8.sql&amp;lt;/tt&amp;gt; contenant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/uninstall.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ajouter un nouveau type de champ ==&lt;br /&gt;
For the moment, we have used a [[S:MyLanguage/J3.3:Developing an MVC Component/Adding a menu type to the site part|hard coded field type for messages]]. We need to use our database for choosing the message.&lt;br /&gt;
&lt;br /&gt;
Modifier le fichier &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt; et ajouter ces lignes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;8,11-16&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields&lt;br /&gt;
			name=&amp;quot;request&amp;quot;&lt;br /&gt;
			addfieldpath=&amp;quot;/administrator/components/com_helloworld/models/fields&amp;quot;&lt;br /&gt;
			&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;id&amp;quot;&lt;br /&gt;
					type=&amp;quot;helloworld&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
					/&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Il introduit un nouveau type de champ et demande à Joomla de rechercher la définition de ce champ dans le dossier &amp;lt;tt&amp;gt;/administrator/components/com_helloworld/models/fields de&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &#039;&#039;admin/models/fields/helloworld.php&#039;&#039; file containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/fields/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/models/fields/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JFormHelper::loadFieldClass(&#039;list&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Form Field class for the HelloWorld component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class JFormFieldHelloWorld extends JFormFieldList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The field type.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var         string&lt;br /&gt;
	 */&lt;br /&gt;
	protected $type = &#039;HelloWorld&#039;;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a list of options for a list input.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  array  An array of JHtml options.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getOptions()&lt;br /&gt;
	{&lt;br /&gt;
		$db    = JFactory::getDBO();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		$query-&amp;gt;select(&#039;id,greeting&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		$db-&amp;gt;setQuery((string) $query);&lt;br /&gt;
		$messages = $db-&amp;gt;loadObjectList();&lt;br /&gt;
		$options  = array();&lt;br /&gt;
&lt;br /&gt;
		if ($messages)&lt;br /&gt;
		{&lt;br /&gt;
			foreach ($messages as $message)&lt;br /&gt;
			{&lt;br /&gt;
				$options[] = JHtml::_(&#039;select.option&#039;, $message-&amp;gt;id, $message-&amp;gt;greeting);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$options = array_merge(parent::getOptions(), $options);&lt;br /&gt;
&lt;br /&gt;
		return $options;&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;
Le nouveau type de champ affiche une liste déroulante des messages à choisir. Vous pouvez voir le résultat de ce changement dans le menu gestionnaire de la section Helloworld.&lt;br /&gt;
&lt;br /&gt;
== Afficher le message sélectionné ==&lt;br /&gt;
When a menu item of this component is created/updated, Joomla stores the identifier of the message. The &amp;lt;tt&amp;gt;HelloWorldModelHelloWorld&amp;lt;/tt&amp;gt; model has now to compute the message according to this identifier and the data stored in the database.&lt;br /&gt;
&lt;br /&gt;
Modifiez le fichier &amp;lt;tt&amp;gt;site/models/helloworld.php&amp;lt;/tt&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/models/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var array messages&lt;br /&gt;
	 */&lt;br /&gt;
	protected $messages;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * 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;
	 * Get the message&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   integer  $id  Greeting Id&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  string        Fetched String from Table for relevant Id&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg($id = 1)&lt;br /&gt;
	{&lt;br /&gt;
		if (!is_array($this-&amp;gt;messages))&lt;br /&gt;
		{&lt;br /&gt;
			$this-&amp;gt;messages = array();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;messages[$id]))&lt;br /&gt;
		{&lt;br /&gt;
			// Request the selected id&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&lt;br /&gt;
			// Get a TableHelloWorld instance&lt;br /&gt;
			$table = $this-&amp;gt;getTable();&lt;br /&gt;
&lt;br /&gt;
			// Load the message&lt;br /&gt;
			$table-&amp;gt;load($id);&lt;br /&gt;
&lt;br /&gt;
			// Assign the message&lt;br /&gt;
			$this-&amp;gt;messages[$id] = $table-&amp;gt;greeting;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $this-&amp;gt;messages[$id];&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The model now asks the &#039;&#039;TableHelloWorld&#039;&#039; to get the message. This table class has to be defined in &amp;lt;tt&amp;gt;admin/tables/helloworld.php&amp;lt;/tt&amp;gt; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/tables/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldTableHelloWorld extends JTable&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   JDatabaseDriver  &amp;amp;$db  A database connector object&lt;br /&gt;
	 */&lt;br /&gt;
	function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct(&#039;#__helloworld&#039;, &#039;id&#039;, $db);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You shouldn&#039;t see any differences, but if you access the database you should see a table named &#039;&#039;jos_helloworld&#039;&#039; with two columns: id and greeting. And two entries: &#039;&#039;Hello World!&#039;&#039; and &#039;&#039;Good bye World&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
&lt;br /&gt;
Contenu de votre répertoire de code&lt;br /&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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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;[[#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[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;[[#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;[[#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/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-6-using-the-database.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez ajouter un élément de menu pour ce composant à l&#039;aide du gestionnaire de menus dans le backend.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding a variable request in the menu type|Préc. : Ajouter une requête de variable dans le type de menu|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Basic backend|Suiv. : Backend de base|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! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/18/fr&amp;diff=207068</id>
		<title>Translations:J3.x:Developing an MVC Component/Using the database/18/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/18/fr&amp;diff=207068"/>
		<updated>2015-07-22T09:03:07Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Le nouveau type de champ affiche une liste déroulante des messages à choisir. Vous pouvez voir le résultat de ce changement dans le menu gestionnaire de la section Helloworld.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Le nouveau type de champ affiche une liste déroulante des messages à choisir. Vous pouvez voir le résultat de ce changement dans le menu gestionnaire de la section Helloworld.&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=207067</id>
		<title>J3.x:Developing an MVC Component/Using the database/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=207067"/>
		<updated>2015-07-22T09:01:22Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Il introduit un nouveau type de champ et demande à Joomla de rechercher la définition de ce champ dans le dossier &amp;lt;tt&amp;gt;/administrator/components/com_helloworld/models/fields...&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;
{{:J3.1:Developing an MVC Component/fr}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
&lt;br /&gt;
== Utiliser la base de données ==&lt;br /&gt;
Les composants gèrent généralement leur contenu à l&#039;aide de la base de données. Lors de la procédure  d&#039;installation/désinstallation/mise à jour d&#039;un composant, vous pouvez exécuter des requêtes SQL par l&#039;utilisation de  fichiers texte SQL.&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers et éditeur préférés, créer deux fichiers appelés &amp;lt;tt&amp;gt;admin/sql/install.mysql.utf8.sql&amp;lt;/tt&amp;gt; et &amp;lt;tt&amp;gt;admin/sql/updates/mysql/0.0.6.sql&amp;lt;/tt&amp;gt;. Ils devraient tous les deux avoir le même contenu :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/install.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039;&#039; and &#039;&#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld` (&lt;br /&gt;
	`id`       INT(11)     NOT NULL AUTO_INCREMENT,&lt;br /&gt;
	`greeting` VARCHAR(25) NOT NULL,&lt;br /&gt;
	`published` tinyint(4) NOT NULL,&lt;br /&gt;
	PRIMARY KEY (`id`)&lt;br /&gt;
)&lt;br /&gt;
	ENGINE =MyISAM&lt;br /&gt;
	AUTO_INCREMENT =0&lt;br /&gt;
	DEFAULT CHARSET =utf8;&lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld` (`greeting`) VALUES&lt;br /&gt;
(&#039;Hello World!&#039;),&lt;br /&gt;
(&#039;Good bye World!&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Le fichier &amp;lt;tt&amp;gt;install.mysql.utf8.sql&amp;lt;/tt&amp;gt; sera exécuté lorsque vous installez le composant. Le fichier &#039;&#039;0.0.6.sql&#039;&#039; est exécuté lorsque vous effectuez une mise à jour.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Remarque importante :&#039;&#039;&#039; Lorsque le composant est installé, les fichiers du dossier des mises à jour SQL (par exemple,  &#039;&#039;admin/sql/updates/mysql&#039;&#039;) sont lus et le nom du dernier fichier, dans l&#039;ordre alphabétique, est utilisé pour ajouter le numéro de version du composant à la table &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt;. Cette valeur doit être présente dans ce tableau afin que la mise à jour automatique puisse exécuter la mise à jour des fichiers SQL pour les futures versions. C&#039;est pourquoi il est judicieux de créer un fichier de mise à jour SQL pour chaque version (même s&#039;il est vide ou ne comporte qu&#039;un commentaire). Ainsi, la version &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; correspondra toujours à la version du composant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Remarque importante :&#039;&#039;&#039; Lors de l&#039;enregistrement des fichiers SQL en utf8, assurez-vous de bien les enregistrer en utf8 SANS BOM, sinon la requête échouera avec l&#039;erreur MySQL #1064.&lt;br /&gt;
&lt;br /&gt;
Voici le fichier d&#039;installation. Il sera exécuté si vous respectez un ordre approprié dans votre fichier &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&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;&#039;&#039;&#039;helloworld.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,17-26,58-61&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.6&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Faites de même avec le fichier de désinstallation :&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers  et éditeur préférés ajouter un fichier &amp;lt;tt&amp;gt;admin/sql/uninstall.mysql.utf8.sql&amp;lt;/tt&amp;gt; contenant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/uninstall.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ajouter un nouveau type de champ ==&lt;br /&gt;
For the moment, we have used a [[S:MyLanguage/J3.3:Developing an MVC Component/Adding a menu type to the site part|hard coded field type for messages]]. We need to use our database for choosing the message.&lt;br /&gt;
&lt;br /&gt;
Modifier le fichier &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt; et ajouter ces lignes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;8,11-16&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields&lt;br /&gt;
			name=&amp;quot;request&amp;quot;&lt;br /&gt;
			addfieldpath=&amp;quot;/administrator/components/com_helloworld/models/fields&amp;quot;&lt;br /&gt;
			&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;id&amp;quot;&lt;br /&gt;
					type=&amp;quot;helloworld&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
					/&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Il introduit un nouveau type de champ et demande à Joomla de rechercher la définition de ce champ dans le dossier &amp;lt;tt&amp;gt;/administrator/components/com_helloworld/models/fields de&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &#039;&#039;admin/models/fields/helloworld.php&#039;&#039; file containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/fields/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/models/fields/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JFormHelper::loadFieldClass(&#039;list&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Form Field class for the HelloWorld component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class JFormFieldHelloWorld extends JFormFieldList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The field type.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var         string&lt;br /&gt;
	 */&lt;br /&gt;
	protected $type = &#039;HelloWorld&#039;;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a list of options for a list input.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  array  An array of JHtml options.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getOptions()&lt;br /&gt;
	{&lt;br /&gt;
		$db    = JFactory::getDBO();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		$query-&amp;gt;select(&#039;id,greeting&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		$db-&amp;gt;setQuery((string) $query);&lt;br /&gt;
		$messages = $db-&amp;gt;loadObjectList();&lt;br /&gt;
		$options  = array();&lt;br /&gt;
&lt;br /&gt;
		if ($messages)&lt;br /&gt;
		{&lt;br /&gt;
			foreach ($messages as $message)&lt;br /&gt;
			{&lt;br /&gt;
				$options[] = JHtml::_(&#039;select.option&#039;, $message-&amp;gt;id, $message-&amp;gt;greeting);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$options = array_merge(parent::getOptions(), $options);&lt;br /&gt;
&lt;br /&gt;
		return $options;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new field type displays a drop-down list of messages to choose from. You can see the result of this change in the menu manager section for the helloworld item.&lt;br /&gt;
&lt;br /&gt;
== Afficher le message sélectionné ==&lt;br /&gt;
When a menu item of this component is created/updated, Joomla stores the identifier of the message. The &amp;lt;tt&amp;gt;HelloWorldModelHelloWorld&amp;lt;/tt&amp;gt; model has now to compute the message according to this identifier and the data stored in the database.&lt;br /&gt;
&lt;br /&gt;
Modifiez le fichier &amp;lt;tt&amp;gt;site/models/helloworld.php&amp;lt;/tt&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/models/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var array messages&lt;br /&gt;
	 */&lt;br /&gt;
	protected $messages;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * 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;
	 * Get the message&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   integer  $id  Greeting Id&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  string        Fetched String from Table for relevant Id&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg($id = 1)&lt;br /&gt;
	{&lt;br /&gt;
		if (!is_array($this-&amp;gt;messages))&lt;br /&gt;
		{&lt;br /&gt;
			$this-&amp;gt;messages = array();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;messages[$id]))&lt;br /&gt;
		{&lt;br /&gt;
			// Request the selected id&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&lt;br /&gt;
			// Get a TableHelloWorld instance&lt;br /&gt;
			$table = $this-&amp;gt;getTable();&lt;br /&gt;
&lt;br /&gt;
			// Load the message&lt;br /&gt;
			$table-&amp;gt;load($id);&lt;br /&gt;
&lt;br /&gt;
			// Assign the message&lt;br /&gt;
			$this-&amp;gt;messages[$id] = $table-&amp;gt;greeting;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $this-&amp;gt;messages[$id];&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The model now asks the &#039;&#039;TableHelloWorld&#039;&#039; to get the message. This table class has to be defined in &amp;lt;tt&amp;gt;admin/tables/helloworld.php&amp;lt;/tt&amp;gt; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/tables/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldTableHelloWorld extends JTable&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   JDatabaseDriver  &amp;amp;$db  A database connector object&lt;br /&gt;
	 */&lt;br /&gt;
	function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct(&#039;#__helloworld&#039;, &#039;id&#039;, $db);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You shouldn&#039;t see any differences, but if you access the database you should see a table named &#039;&#039;jos_helloworld&#039;&#039; with two columns: id and greeting. And two entries: &#039;&#039;Hello World!&#039;&#039; and &#039;&#039;Good bye World&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
&lt;br /&gt;
Contenu de votre répertoire de code&lt;br /&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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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;[[#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[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;[[#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;[[#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/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-6-using-the-database.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez ajouter un élément de menu pour ce composant à l&#039;aide du gestionnaire de menus dans le backend.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding a variable request in the menu type|Préc. : Ajouter une requête de variable dans le type de menu|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Basic backend|Suiv. : Backend de base|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! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/16/fr&amp;diff=207066</id>
		<title>Translations:J3.x:Developing an MVC Component/Using the database/16/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/16/fr&amp;diff=207066"/>
		<updated>2015-07-22T09:01:22Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Il introduit un nouveau type de champ et demande à Joomla de rechercher la définition de ce champ dans le dossier &amp;lt;tt&amp;gt;/administrator/components/com_helloworld/models/fields...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Il introduit un nouveau type de champ et demande à Joomla de rechercher la définition de ce champ dans le dossier &amp;lt;tt&amp;gt;/administrator/components/com_helloworld/models/fields de&amp;lt;/tt&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=207065</id>
		<title>J3.x:Developing an MVC Component/Using the database/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=207065"/>
		<updated>2015-07-22T08:55:03Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Modifier le fichier &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt; et ajouter ces lignes&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;
{{:J3.1:Developing an MVC Component/fr}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
&lt;br /&gt;
== Utiliser la base de données ==&lt;br /&gt;
Les composants gèrent généralement leur contenu à l&#039;aide de la base de données. Lors de la procédure  d&#039;installation/désinstallation/mise à jour d&#039;un composant, vous pouvez exécuter des requêtes SQL par l&#039;utilisation de  fichiers texte SQL.&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers et éditeur préférés, créer deux fichiers appelés &amp;lt;tt&amp;gt;admin/sql/install.mysql.utf8.sql&amp;lt;/tt&amp;gt; et &amp;lt;tt&amp;gt;admin/sql/updates/mysql/0.0.6.sql&amp;lt;/tt&amp;gt;. Ils devraient tous les deux avoir le même contenu :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/install.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039;&#039; and &#039;&#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld` (&lt;br /&gt;
	`id`       INT(11)     NOT NULL AUTO_INCREMENT,&lt;br /&gt;
	`greeting` VARCHAR(25) NOT NULL,&lt;br /&gt;
	`published` tinyint(4) NOT NULL,&lt;br /&gt;
	PRIMARY KEY (`id`)&lt;br /&gt;
)&lt;br /&gt;
	ENGINE =MyISAM&lt;br /&gt;
	AUTO_INCREMENT =0&lt;br /&gt;
	DEFAULT CHARSET =utf8;&lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld` (`greeting`) VALUES&lt;br /&gt;
(&#039;Hello World!&#039;),&lt;br /&gt;
(&#039;Good bye World!&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Le fichier &amp;lt;tt&amp;gt;install.mysql.utf8.sql&amp;lt;/tt&amp;gt; sera exécuté lorsque vous installez le composant. Le fichier &#039;&#039;0.0.6.sql&#039;&#039; est exécuté lorsque vous effectuez une mise à jour.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Remarque importante :&#039;&#039;&#039; Lorsque le composant est installé, les fichiers du dossier des mises à jour SQL (par exemple,  &#039;&#039;admin/sql/updates/mysql&#039;&#039;) sont lus et le nom du dernier fichier, dans l&#039;ordre alphabétique, est utilisé pour ajouter le numéro de version du composant à la table &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt;. Cette valeur doit être présente dans ce tableau afin que la mise à jour automatique puisse exécuter la mise à jour des fichiers SQL pour les futures versions. C&#039;est pourquoi il est judicieux de créer un fichier de mise à jour SQL pour chaque version (même s&#039;il est vide ou ne comporte qu&#039;un commentaire). Ainsi, la version &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; correspondra toujours à la version du composant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Remarque importante :&#039;&#039;&#039; Lors de l&#039;enregistrement des fichiers SQL en utf8, assurez-vous de bien les enregistrer en utf8 SANS BOM, sinon la requête échouera avec l&#039;erreur MySQL #1064.&lt;br /&gt;
&lt;br /&gt;
Voici le fichier d&#039;installation. Il sera exécuté si vous respectez un ordre approprié dans votre fichier &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&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;&#039;&#039;&#039;helloworld.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,17-26,58-61&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.6&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Faites de même avec le fichier de désinstallation :&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers  et éditeur préférés ajouter un fichier &amp;lt;tt&amp;gt;admin/sql/uninstall.mysql.utf8.sql&amp;lt;/tt&amp;gt; contenant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/uninstall.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ajouter un nouveau type de champ ==&lt;br /&gt;
For the moment, we have used a [[S:MyLanguage/J3.3:Developing an MVC Component/Adding a menu type to the site part|hard coded field type for messages]]. We need to use our database for choosing the message.&lt;br /&gt;
&lt;br /&gt;
Modifier le fichier &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt; et ajouter ces lignes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;8,11-16&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields&lt;br /&gt;
			name=&amp;quot;request&amp;quot;&lt;br /&gt;
			addfieldpath=&amp;quot;/administrator/components/com_helloworld/models/fields&amp;quot;&lt;br /&gt;
			&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;id&amp;quot;&lt;br /&gt;
					type=&amp;quot;helloworld&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
					/&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It introduces a new field type and tells Joomla to look for the field definition in the &amp;lt;tt&amp;gt;/administrator/components/com_helloworld/models/fields&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &#039;&#039;admin/models/fields/helloworld.php&#039;&#039; file containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/fields/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/models/fields/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JFormHelper::loadFieldClass(&#039;list&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Form Field class for the HelloWorld component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class JFormFieldHelloWorld extends JFormFieldList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The field type.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var         string&lt;br /&gt;
	 */&lt;br /&gt;
	protected $type = &#039;HelloWorld&#039;;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a list of options for a list input.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  array  An array of JHtml options.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getOptions()&lt;br /&gt;
	{&lt;br /&gt;
		$db    = JFactory::getDBO();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		$query-&amp;gt;select(&#039;id,greeting&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		$db-&amp;gt;setQuery((string) $query);&lt;br /&gt;
		$messages = $db-&amp;gt;loadObjectList();&lt;br /&gt;
		$options  = array();&lt;br /&gt;
&lt;br /&gt;
		if ($messages)&lt;br /&gt;
		{&lt;br /&gt;
			foreach ($messages as $message)&lt;br /&gt;
			{&lt;br /&gt;
				$options[] = JHtml::_(&#039;select.option&#039;, $message-&amp;gt;id, $message-&amp;gt;greeting);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$options = array_merge(parent::getOptions(), $options);&lt;br /&gt;
&lt;br /&gt;
		return $options;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new field type displays a drop-down list of messages to choose from. You can see the result of this change in the menu manager section for the helloworld item.&lt;br /&gt;
&lt;br /&gt;
== Afficher le message sélectionné ==&lt;br /&gt;
When a menu item of this component is created/updated, Joomla stores the identifier of the message. The &amp;lt;tt&amp;gt;HelloWorldModelHelloWorld&amp;lt;/tt&amp;gt; model has now to compute the message according to this identifier and the data stored in the database.&lt;br /&gt;
&lt;br /&gt;
Modifiez le fichier &amp;lt;tt&amp;gt;site/models/helloworld.php&amp;lt;/tt&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/models/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var array messages&lt;br /&gt;
	 */&lt;br /&gt;
	protected $messages;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * 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;
	 * Get the message&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   integer  $id  Greeting Id&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  string        Fetched String from Table for relevant Id&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg($id = 1)&lt;br /&gt;
	{&lt;br /&gt;
		if (!is_array($this-&amp;gt;messages))&lt;br /&gt;
		{&lt;br /&gt;
			$this-&amp;gt;messages = array();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;messages[$id]))&lt;br /&gt;
		{&lt;br /&gt;
			// Request the selected id&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&lt;br /&gt;
			// Get a TableHelloWorld instance&lt;br /&gt;
			$table = $this-&amp;gt;getTable();&lt;br /&gt;
&lt;br /&gt;
			// Load the message&lt;br /&gt;
			$table-&amp;gt;load($id);&lt;br /&gt;
&lt;br /&gt;
			// Assign the message&lt;br /&gt;
			$this-&amp;gt;messages[$id] = $table-&amp;gt;greeting;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $this-&amp;gt;messages[$id];&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The model now asks the &#039;&#039;TableHelloWorld&#039;&#039; to get the message. This table class has to be defined in &amp;lt;tt&amp;gt;admin/tables/helloworld.php&amp;lt;/tt&amp;gt; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/tables/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldTableHelloWorld extends JTable&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   JDatabaseDriver  &amp;amp;$db  A database connector object&lt;br /&gt;
	 */&lt;br /&gt;
	function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct(&#039;#__helloworld&#039;, &#039;id&#039;, $db);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You shouldn&#039;t see any differences, but if you access the database you should see a table named &#039;&#039;jos_helloworld&#039;&#039; with two columns: id and greeting. And two entries: &#039;&#039;Hello World!&#039;&#039; and &#039;&#039;Good bye World&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
&lt;br /&gt;
Contenu de votre répertoire de code&lt;br /&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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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;[[#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[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;[[#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;[[#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/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-6-using-the-database.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez ajouter un élément de menu pour ce composant à l&#039;aide du gestionnaire de menus dans le backend.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding a variable request in the menu type|Préc. : Ajouter une requête de variable dans le type de menu|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Basic backend|Suiv. : Backend de base|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! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/15/fr&amp;diff=207064</id>
		<title>Translations:J3.x:Developing an MVC Component/Using the database/15/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/15/fr&amp;diff=207064"/>
		<updated>2015-07-22T08:55:02Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Modifier le fichier &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt; et ajouter ces lignes&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Modifier le fichier &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt; et ajouter ces lignes&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=207063</id>
		<title>J3.x:Developing an MVC Component/Using the database/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=207063"/>
		<updated>2015-07-22T07:48:23Z</updated>

		<summary type="html">&lt;p&gt;Perete: &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/fr}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
&lt;br /&gt;
== Utiliser la base de données ==&lt;br /&gt;
Les composants gèrent généralement leur contenu à l&#039;aide de la base de données. Lors de la procédure  d&#039;installation/désinstallation/mise à jour d&#039;un composant, vous pouvez exécuter des requêtes SQL par l&#039;utilisation de  fichiers texte SQL.&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers et éditeur préférés, créer deux fichiers appelés &amp;lt;tt&amp;gt;admin/sql/install.mysql.utf8.sql&amp;lt;/tt&amp;gt; et &amp;lt;tt&amp;gt;admin/sql/updates/mysql/0.0.6.sql&amp;lt;/tt&amp;gt;. Ils devraient tous les deux avoir le même contenu :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/install.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039;&#039; and &#039;&#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld` (&lt;br /&gt;
	`id`       INT(11)     NOT NULL AUTO_INCREMENT,&lt;br /&gt;
	`greeting` VARCHAR(25) NOT NULL,&lt;br /&gt;
	`published` tinyint(4) NOT NULL,&lt;br /&gt;
	PRIMARY KEY (`id`)&lt;br /&gt;
)&lt;br /&gt;
	ENGINE =MyISAM&lt;br /&gt;
	AUTO_INCREMENT =0&lt;br /&gt;
	DEFAULT CHARSET =utf8;&lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld` (`greeting`) VALUES&lt;br /&gt;
(&#039;Hello World!&#039;),&lt;br /&gt;
(&#039;Good bye World!&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Le fichier &amp;lt;tt&amp;gt;install.mysql.utf8.sql&amp;lt;/tt&amp;gt; sera exécuté lorsque vous installez le composant. Le fichier &#039;&#039;0.0.6.sql&#039;&#039; est exécuté lorsque vous effectuez une mise à jour.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Remarque importante :&#039;&#039;&#039; Lorsque le composant est installé, les fichiers du dossier des mises à jour SQL (par exemple,  &#039;&#039;admin/sql/updates/mysql&#039;&#039;) sont lus et le nom du dernier fichier, dans l&#039;ordre alphabétique, est utilisé pour ajouter le numéro de version du composant à la table &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt;. Cette valeur doit être présente dans ce tableau afin que la mise à jour automatique puisse exécuter la mise à jour des fichiers SQL pour les futures versions. C&#039;est pourquoi il est judicieux de créer un fichier de mise à jour SQL pour chaque version (même s&#039;il est vide ou ne comporte qu&#039;un commentaire). Ainsi, la version &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; correspondra toujours à la version du composant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Remarque importante :&#039;&#039;&#039; Lors de l&#039;enregistrement des fichiers SQL en utf8, assurez-vous de bien les enregistrer en utf8 SANS BOM, sinon la requête échouera avec l&#039;erreur MySQL #1064.&lt;br /&gt;
&lt;br /&gt;
Voici le fichier d&#039;installation. Il sera exécuté si vous respectez un ordre approprié dans votre fichier &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&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;&#039;&#039;&#039;helloworld.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,17-26,58-61&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.6&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Faites de même avec le fichier de désinstallation :&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers  et éditeur préférés ajouter un fichier &amp;lt;tt&amp;gt;admin/sql/uninstall.mysql.utf8.sql&amp;lt;/tt&amp;gt; contenant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/uninstall.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ajouter un nouveau type de champ ==&lt;br /&gt;
For the moment, we have used a [[S:MyLanguage/J3.3:Developing an MVC Component/Adding a menu type to the site part|hard coded field type for messages]]. We need to use our database for choosing the message.&lt;br /&gt;
&lt;br /&gt;
Modify the &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt; file and put these lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;8,11-16&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields&lt;br /&gt;
			name=&amp;quot;request&amp;quot;&lt;br /&gt;
			addfieldpath=&amp;quot;/administrator/components/com_helloworld/models/fields&amp;quot;&lt;br /&gt;
			&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;id&amp;quot;&lt;br /&gt;
					type=&amp;quot;helloworld&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
					/&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It introduces a new field type and tells Joomla to look for the field definition in the &amp;lt;tt&amp;gt;/administrator/components/com_helloworld/models/fields&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &#039;&#039;admin/models/fields/helloworld.php&#039;&#039; file containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/fields/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/models/fields/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JFormHelper::loadFieldClass(&#039;list&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Form Field class for the HelloWorld component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class JFormFieldHelloWorld extends JFormFieldList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The field type.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var         string&lt;br /&gt;
	 */&lt;br /&gt;
	protected $type = &#039;HelloWorld&#039;;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a list of options for a list input.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  array  An array of JHtml options.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getOptions()&lt;br /&gt;
	{&lt;br /&gt;
		$db    = JFactory::getDBO();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		$query-&amp;gt;select(&#039;id,greeting&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		$db-&amp;gt;setQuery((string) $query);&lt;br /&gt;
		$messages = $db-&amp;gt;loadObjectList();&lt;br /&gt;
		$options  = array();&lt;br /&gt;
&lt;br /&gt;
		if ($messages)&lt;br /&gt;
		{&lt;br /&gt;
			foreach ($messages as $message)&lt;br /&gt;
			{&lt;br /&gt;
				$options[] = JHtml::_(&#039;select.option&#039;, $message-&amp;gt;id, $message-&amp;gt;greeting);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$options = array_merge(parent::getOptions(), $options);&lt;br /&gt;
&lt;br /&gt;
		return $options;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new field type displays a drop-down list of messages to choose from. You can see the result of this change in the menu manager section for the helloworld item.&lt;br /&gt;
&lt;br /&gt;
== Afficher le message sélectionné ==&lt;br /&gt;
When a menu item of this component is created/updated, Joomla stores the identifier of the message. The &amp;lt;tt&amp;gt;HelloWorldModelHelloWorld&amp;lt;/tt&amp;gt; model has now to compute the message according to this identifier and the data stored in the database.&lt;br /&gt;
&lt;br /&gt;
Modifiez le fichier &amp;lt;tt&amp;gt;site/models/helloworld.php&amp;lt;/tt&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/models/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var array messages&lt;br /&gt;
	 */&lt;br /&gt;
	protected $messages;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * 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;
	 * Get the message&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   integer  $id  Greeting Id&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  string        Fetched String from Table for relevant Id&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg($id = 1)&lt;br /&gt;
	{&lt;br /&gt;
		if (!is_array($this-&amp;gt;messages))&lt;br /&gt;
		{&lt;br /&gt;
			$this-&amp;gt;messages = array();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;messages[$id]))&lt;br /&gt;
		{&lt;br /&gt;
			// Request the selected id&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&lt;br /&gt;
			// Get a TableHelloWorld instance&lt;br /&gt;
			$table = $this-&amp;gt;getTable();&lt;br /&gt;
&lt;br /&gt;
			// Load the message&lt;br /&gt;
			$table-&amp;gt;load($id);&lt;br /&gt;
&lt;br /&gt;
			// Assign the message&lt;br /&gt;
			$this-&amp;gt;messages[$id] = $table-&amp;gt;greeting;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $this-&amp;gt;messages[$id];&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The model now asks the &#039;&#039;TableHelloWorld&#039;&#039; to get the message. This table class has to be defined in &amp;lt;tt&amp;gt;admin/tables/helloworld.php&amp;lt;/tt&amp;gt; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/tables/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldTableHelloWorld extends JTable&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   JDatabaseDriver  &amp;amp;$db  A database connector object&lt;br /&gt;
	 */&lt;br /&gt;
	function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct(&#039;#__helloworld&#039;, &#039;id&#039;, $db);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You shouldn&#039;t see any differences, but if you access the database you should see a table named &#039;&#039;jos_helloworld&#039;&#039; with two columns: id and greeting. And two entries: &#039;&#039;Hello World!&#039;&#039; and &#039;&#039;Good bye World&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
&lt;br /&gt;
Contenu de votre répertoire de code&lt;br /&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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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;[[#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[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;[[#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;[[#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/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-6-using-the-database.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez ajouter un élément de menu pour ce composant à l&#039;aide du gestionnaire de menus dans le backend.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding a variable request in the menu type|Préc. : Ajouter une requête de variable dans le type de menu|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Basic backend|Suiv. : Backend de base|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! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/12/fr&amp;diff=207062</id>
		<title>Translations:J3.x:Developing an MVC Component/Using the database/12/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/12/fr&amp;diff=207062"/>
		<updated>2015-07-22T07:48:23Z</updated>

		<summary type="html">&lt;p&gt;Perete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Avec votre gestionnaire de fichiers  et éditeur préférés ajouter un fichier &amp;lt;tt&amp;gt;admin/sql/uninstall.mysql.utf8.sql&amp;lt;/tt&amp;gt; contenant:&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=207061</id>
		<title>J3.x:Developing an MVC Component/Using the database/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=207061"/>
		<updated>2015-07-22T07:47:55Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Avec votre gestionnaire de fichiers  et éditeur préférés ajouter un fichier &amp;lt;tt&amp;gt;admin/sql/désinstaller.mysql.utf8.sql&amp;lt;/tt&amp;gt; contenant:&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;
{{:J3.1:Developing an MVC Component/fr}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
&lt;br /&gt;
== Utiliser la base de données ==&lt;br /&gt;
Les composants gèrent généralement leur contenu à l&#039;aide de la base de données. Lors de la procédure  d&#039;installation/désinstallation/mise à jour d&#039;un composant, vous pouvez exécuter des requêtes SQL par l&#039;utilisation de  fichiers texte SQL.&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers et éditeur préférés, créer deux fichiers appelés &amp;lt;tt&amp;gt;admin/sql/install.mysql.utf8.sql&amp;lt;/tt&amp;gt; et &amp;lt;tt&amp;gt;admin/sql/updates/mysql/0.0.6.sql&amp;lt;/tt&amp;gt;. Ils devraient tous les deux avoir le même contenu :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/install.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039;&#039; and &#039;&#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld` (&lt;br /&gt;
	`id`       INT(11)     NOT NULL AUTO_INCREMENT,&lt;br /&gt;
	`greeting` VARCHAR(25) NOT NULL,&lt;br /&gt;
	`published` tinyint(4) NOT NULL,&lt;br /&gt;
	PRIMARY KEY (`id`)&lt;br /&gt;
)&lt;br /&gt;
	ENGINE =MyISAM&lt;br /&gt;
	AUTO_INCREMENT =0&lt;br /&gt;
	DEFAULT CHARSET =utf8;&lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld` (`greeting`) VALUES&lt;br /&gt;
(&#039;Hello World!&#039;),&lt;br /&gt;
(&#039;Good bye World!&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Le fichier &amp;lt;tt&amp;gt;install.mysql.utf8.sql&amp;lt;/tt&amp;gt; sera exécuté lorsque vous installez le composant. Le fichier &#039;&#039;0.0.6.sql&#039;&#039; est exécuté lorsque vous effectuez une mise à jour.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Remarque importante :&#039;&#039;&#039; Lorsque le composant est installé, les fichiers du dossier des mises à jour SQL (par exemple,  &#039;&#039;admin/sql/updates/mysql&#039;&#039;) sont lus et le nom du dernier fichier, dans l&#039;ordre alphabétique, est utilisé pour ajouter le numéro de version du composant à la table &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt;. Cette valeur doit être présente dans ce tableau afin que la mise à jour automatique puisse exécuter la mise à jour des fichiers SQL pour les futures versions. C&#039;est pourquoi il est judicieux de créer un fichier de mise à jour SQL pour chaque version (même s&#039;il est vide ou ne comporte qu&#039;un commentaire). Ainsi, la version &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; correspondra toujours à la version du composant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Remarque importante :&#039;&#039;&#039; Lors de l&#039;enregistrement des fichiers SQL en utf8, assurez-vous de bien les enregistrer en utf8 SANS BOM, sinon la requête échouera avec l&#039;erreur MySQL #1064.&lt;br /&gt;
&lt;br /&gt;
Voici le fichier d&#039;installation. Il sera exécuté si vous respectez un ordre approprié dans votre fichier &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&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;&#039;&#039;&#039;helloworld.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,17-26,58-61&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.6&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Faites de même avec le fichier de désinstallation :&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers  et éditeur préférés ajouter un fichier &amp;lt;tt&amp;gt;admin/sql/désinstaller.mysql.utf8.sql&amp;lt;/tt&amp;gt; contenant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/uninstall.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ajouter un nouveau type de champ ==&lt;br /&gt;
For the moment, we have used a [[S:MyLanguage/J3.3:Developing an MVC Component/Adding a menu type to the site part|hard coded field type for messages]]. We need to use our database for choosing the message.&lt;br /&gt;
&lt;br /&gt;
Modify the &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt; file and put these lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;8,11-16&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields&lt;br /&gt;
			name=&amp;quot;request&amp;quot;&lt;br /&gt;
			addfieldpath=&amp;quot;/administrator/components/com_helloworld/models/fields&amp;quot;&lt;br /&gt;
			&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;id&amp;quot;&lt;br /&gt;
					type=&amp;quot;helloworld&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
					/&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It introduces a new field type and tells Joomla to look for the field definition in the &amp;lt;tt&amp;gt;/administrator/components/com_helloworld/models/fields&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &#039;&#039;admin/models/fields/helloworld.php&#039;&#039; file containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/fields/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/models/fields/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JFormHelper::loadFieldClass(&#039;list&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Form Field class for the HelloWorld component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class JFormFieldHelloWorld extends JFormFieldList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The field type.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var         string&lt;br /&gt;
	 */&lt;br /&gt;
	protected $type = &#039;HelloWorld&#039;;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a list of options for a list input.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  array  An array of JHtml options.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getOptions()&lt;br /&gt;
	{&lt;br /&gt;
		$db    = JFactory::getDBO();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		$query-&amp;gt;select(&#039;id,greeting&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		$db-&amp;gt;setQuery((string) $query);&lt;br /&gt;
		$messages = $db-&amp;gt;loadObjectList();&lt;br /&gt;
		$options  = array();&lt;br /&gt;
&lt;br /&gt;
		if ($messages)&lt;br /&gt;
		{&lt;br /&gt;
			foreach ($messages as $message)&lt;br /&gt;
			{&lt;br /&gt;
				$options[] = JHtml::_(&#039;select.option&#039;, $message-&amp;gt;id, $message-&amp;gt;greeting);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$options = array_merge(parent::getOptions(), $options);&lt;br /&gt;
&lt;br /&gt;
		return $options;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new field type displays a drop-down list of messages to choose from. You can see the result of this change in the menu manager section for the helloworld item.&lt;br /&gt;
&lt;br /&gt;
== Afficher le message sélectionné ==&lt;br /&gt;
When a menu item of this component is created/updated, Joomla stores the identifier of the message. The &amp;lt;tt&amp;gt;HelloWorldModelHelloWorld&amp;lt;/tt&amp;gt; model has now to compute the message according to this identifier and the data stored in the database.&lt;br /&gt;
&lt;br /&gt;
Modifiez le fichier &amp;lt;tt&amp;gt;site/models/helloworld.php&amp;lt;/tt&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/models/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var array messages&lt;br /&gt;
	 */&lt;br /&gt;
	protected $messages;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * 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;
	 * Get the message&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   integer  $id  Greeting Id&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  string        Fetched String from Table for relevant Id&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg($id = 1)&lt;br /&gt;
	{&lt;br /&gt;
		if (!is_array($this-&amp;gt;messages))&lt;br /&gt;
		{&lt;br /&gt;
			$this-&amp;gt;messages = array();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;messages[$id]))&lt;br /&gt;
		{&lt;br /&gt;
			// Request the selected id&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&lt;br /&gt;
			// Get a TableHelloWorld instance&lt;br /&gt;
			$table = $this-&amp;gt;getTable();&lt;br /&gt;
&lt;br /&gt;
			// Load the message&lt;br /&gt;
			$table-&amp;gt;load($id);&lt;br /&gt;
&lt;br /&gt;
			// Assign the message&lt;br /&gt;
			$this-&amp;gt;messages[$id] = $table-&amp;gt;greeting;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $this-&amp;gt;messages[$id];&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The model now asks the &#039;&#039;TableHelloWorld&#039;&#039; to get the message. This table class has to be defined in &amp;lt;tt&amp;gt;admin/tables/helloworld.php&amp;lt;/tt&amp;gt; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/tables/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldTableHelloWorld extends JTable&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   JDatabaseDriver  &amp;amp;$db  A database connector object&lt;br /&gt;
	 */&lt;br /&gt;
	function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct(&#039;#__helloworld&#039;, &#039;id&#039;, $db);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You shouldn&#039;t see any differences, but if you access the database you should see a table named &#039;&#039;jos_helloworld&#039;&#039; with two columns: id and greeting. And two entries: &#039;&#039;Hello World!&#039;&#039; and &#039;&#039;Good bye World&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
&lt;br /&gt;
Contenu de votre répertoire de code&lt;br /&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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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;[[#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[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;[[#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;[[#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/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-6-using-the-database.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez ajouter un élément de menu pour ce composant à l&#039;aide du gestionnaire de menus dans le backend.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding a variable request in the menu type|Préc. : Ajouter une requête de variable dans le type de menu|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Basic backend|Suiv. : Backend de base|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! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/12/fr&amp;diff=207060</id>
		<title>Translations:J3.x:Developing an MVC Component/Using the database/12/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/12/fr&amp;diff=207060"/>
		<updated>2015-07-22T07:47:54Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Avec votre gestionnaire de fichiers  et éditeur préférés ajouter un fichier &amp;lt;tt&amp;gt;admin/sql/désinstaller.mysql.utf8.sql&amp;lt;/tt&amp;gt; contenant:&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Avec votre gestionnaire de fichiers  et éditeur préférés ajouter un fichier &amp;lt;tt&amp;gt;admin/sql/désinstaller.mysql.utf8.sql&amp;lt;/tt&amp;gt; contenant:&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=206860</id>
		<title>J3.x:Developing an MVC Component/Using the database/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=206860"/>
		<updated>2015-07-21T09:59:00Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Le fichier &amp;lt;tt&amp;gt;install.mysql.utf8.sql&amp;lt;/tt&amp;gt; sera exécuté lorsque vous installez le composant. Le fichier &amp;#039;&amp;#039;0.0.6.sql&amp;#039;&amp;#039; est exécuté lorsque vous effectuez une mise à jour.&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;
{{:J3.1:Developing an MVC Component/fr}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
&lt;br /&gt;
== Utiliser la base de données ==&lt;br /&gt;
Les composants gèrent généralement leur contenu à l&#039;aide de la base de données. Lors de la procédure  d&#039;installation/désinstallation/mise à jour d&#039;un composant, vous pouvez exécuter des requêtes SQL par l&#039;utilisation de  fichiers texte SQL.&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers et éditeur préférés, créer deux fichiers appelés &amp;lt;tt&amp;gt;admin/sql/install.mysql.utf8.sql&amp;lt;/tt&amp;gt; et &amp;lt;tt&amp;gt;admin/sql/updates/mysql/0.0.6.sql&amp;lt;/tt&amp;gt;. Ils devraient tous les deux avoir le même contenu :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/install.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039;&#039; and &#039;&#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld` (&lt;br /&gt;
	`id`       INT(11)     NOT NULL AUTO_INCREMENT,&lt;br /&gt;
	`greeting` VARCHAR(25) NOT NULL,&lt;br /&gt;
	`published` tinyint(4) NOT NULL,&lt;br /&gt;
	PRIMARY KEY (`id`)&lt;br /&gt;
)&lt;br /&gt;
	ENGINE =MyISAM&lt;br /&gt;
	AUTO_INCREMENT =0&lt;br /&gt;
	DEFAULT CHARSET =utf8;&lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld` (`greeting`) VALUES&lt;br /&gt;
(&#039;Hello World!&#039;),&lt;br /&gt;
(&#039;Good bye World!&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Le fichier &amp;lt;tt&amp;gt;install.mysql.utf8.sql&amp;lt;/tt&amp;gt; sera exécuté lorsque vous installez le composant. Le fichier &#039;&#039;0.0.6.sql&#039;&#039; est exécuté lorsque vous effectuez une mise à jour.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When the component is installed, the files in the SQL updates folder (for example, &#039;&#039;admin/sql/updates/mysql&#039;&#039;) are read and the name of the last file alphabetically is used to populate the component&#039;s version number in the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; table. This value must be in this table in order for the automatic update to execute the update SQL files for future versions. For this reason, it is good practice to create a SQL update file for each version (even if it is empty or just has a comment). This way the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; version will always match the component version.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When saving the SQL files in utf8, be sure to save them as utf8 NOT BOM or the query will fail with MySQL error #1064.&lt;br /&gt;
&lt;br /&gt;
This is the install file. It will be executed if you put an appropriate order in the &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&amp;gt; file.&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;&#039;&#039;&#039;helloworld.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,17-26,58-61&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.6&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Faites de même avec le fichier de désinstallation :&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &amp;lt;tt&amp;gt;admin/sql/uninstall.mysql.utf8.sql&amp;lt;/tt&amp;gt; containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/uninstall.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ajouter un nouveau type de champ ==&lt;br /&gt;
For the moment, we have used a [[S:MyLanguage/J3.3:Developing an MVC Component/Adding a menu type to the site part|hard coded field type for messages]]. We need to use our database for choosing the message.&lt;br /&gt;
&lt;br /&gt;
Modify the &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt; file and put these lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;8,11-16&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields&lt;br /&gt;
			name=&amp;quot;request&amp;quot;&lt;br /&gt;
			addfieldpath=&amp;quot;/administrator/components/com_helloworld/models/fields&amp;quot;&lt;br /&gt;
			&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;id&amp;quot;&lt;br /&gt;
					type=&amp;quot;helloworld&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
					/&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It introduces a new field type and tells Joomla to look for the field definition in the &amp;lt;tt&amp;gt;/administrator/components/com_helloworld/models/fields&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &#039;&#039;admin/models/fields/helloworld.php&#039;&#039; file containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/fields/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/models/fields/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JFormHelper::loadFieldClass(&#039;list&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Form Field class for the HelloWorld component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class JFormFieldHelloWorld extends JFormFieldList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The field type.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var         string&lt;br /&gt;
	 */&lt;br /&gt;
	protected $type = &#039;HelloWorld&#039;;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a list of options for a list input.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  array  An array of JHtml options.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getOptions()&lt;br /&gt;
	{&lt;br /&gt;
		$db    = JFactory::getDBO();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		$query-&amp;gt;select(&#039;id,greeting&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		$db-&amp;gt;setQuery((string) $query);&lt;br /&gt;
		$messages = $db-&amp;gt;loadObjectList();&lt;br /&gt;
		$options  = array();&lt;br /&gt;
&lt;br /&gt;
		if ($messages)&lt;br /&gt;
		{&lt;br /&gt;
			foreach ($messages as $message)&lt;br /&gt;
			{&lt;br /&gt;
				$options[] = JHtml::_(&#039;select.option&#039;, $message-&amp;gt;id, $message-&amp;gt;greeting);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$options = array_merge(parent::getOptions(), $options);&lt;br /&gt;
&lt;br /&gt;
		return $options;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new field type displays a drop-down list of messages to choose from. You can see the result of this change in the menu manager section for the helloworld item.&lt;br /&gt;
&lt;br /&gt;
== Afficher le message sélectionné ==&lt;br /&gt;
When a menu item of this component is created/updated, Joomla stores the identifier of the message. The &amp;lt;tt&amp;gt;HelloWorldModelHelloWorld&amp;lt;/tt&amp;gt; model has now to compute the message according to this identifier and the data stored in the database.&lt;br /&gt;
&lt;br /&gt;
Modifiez le fichier &amp;lt;tt&amp;gt;site/models/helloworld.php&amp;lt;/tt&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/models/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var array messages&lt;br /&gt;
	 */&lt;br /&gt;
	protected $messages;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * 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;
	 * Get the message&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   integer  $id  Greeting Id&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  string        Fetched String from Table for relevant Id&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg($id = 1)&lt;br /&gt;
	{&lt;br /&gt;
		if (!is_array($this-&amp;gt;messages))&lt;br /&gt;
		{&lt;br /&gt;
			$this-&amp;gt;messages = array();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;messages[$id]))&lt;br /&gt;
		{&lt;br /&gt;
			// Request the selected id&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&lt;br /&gt;
			// Get a TableHelloWorld instance&lt;br /&gt;
			$table = $this-&amp;gt;getTable();&lt;br /&gt;
&lt;br /&gt;
			// Load the message&lt;br /&gt;
			$table-&amp;gt;load($id);&lt;br /&gt;
&lt;br /&gt;
			// Assign the message&lt;br /&gt;
			$this-&amp;gt;messages[$id] = $table-&amp;gt;greeting;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $this-&amp;gt;messages[$id];&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The model now asks the &#039;&#039;TableHelloWorld&#039;&#039; to get the message. This table class has to be defined in &amp;lt;tt&amp;gt;admin/tables/helloworld.php&amp;lt;/tt&amp;gt; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/tables/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldTableHelloWorld extends JTable&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   JDatabaseDriver  &amp;amp;$db  A database connector object&lt;br /&gt;
	 */&lt;br /&gt;
	function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct(&#039;#__helloworld&#039;, &#039;id&#039;, $db);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You shouldn&#039;t see any differences, but if you access the database you should see a table named &#039;&#039;jos_helloworld&#039;&#039; with two columns: id and greeting. And two entries: &#039;&#039;Hello World!&#039;&#039; and &#039;&#039;Good bye World&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
&lt;br /&gt;
Contenu de votre répertoire de code&lt;br /&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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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;[[#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[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;[[#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;[[#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/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-6-using-the-database.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez ajouter un élément de menu pour ce composant à l&#039;aide du gestionnaire de menus dans le backend.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding a variable request in the menu type|Préc. : Ajouter une requête de variable dans le type de menu|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Basic backend|Suiv. : Backend de base|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! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/7/fr&amp;diff=206859</id>
		<title>Translations:J3.x:Developing an MVC Component/Using the database/7/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/7/fr&amp;diff=206859"/>
		<updated>2015-07-21T09:58:59Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Le fichier &amp;lt;tt&amp;gt;install.mysql.utf8.sql&amp;lt;/tt&amp;gt; sera exécuté lorsque vous installez le composant. Le fichier &amp;#039;&amp;#039;0.0.6.sql&amp;#039;&amp;#039; est exécuté lorsque vous effectuez une mise à jour.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Le fichier &amp;lt;tt&amp;gt;install.mysql.utf8.sql&amp;lt;/tt&amp;gt; sera exécuté lorsque vous installez le composant. Le fichier &#039;&#039;0.0.6.sql&#039;&#039; est exécuté lorsque vous effectuez une mise à jour.&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=206858</id>
		<title>J3.x:Developing an MVC Component/Using the database/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=206858"/>
		<updated>2015-07-21T09:56:48Z</updated>

		<summary type="html">&lt;p&gt;Perete: &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/fr}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
&lt;br /&gt;
== Utiliser la base de données ==&lt;br /&gt;
Les composants gèrent généralement leur contenu à l&#039;aide de la base de données. Lors de la procédure  d&#039;installation/désinstallation/mise à jour d&#039;un composant, vous pouvez exécuter des requêtes SQL par l&#039;utilisation de  fichiers texte SQL.&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers et éditeur préférés, créer deux fichiers appelés &amp;lt;tt&amp;gt;admin/sql/install.mysql.utf8.sql&amp;lt;/tt&amp;gt; et &amp;lt;tt&amp;gt;admin/sql/updates/mysql/0.0.6.sql&amp;lt;/tt&amp;gt;. Ils devraient tous les deux avoir le même contenu :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/install.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039;&#039; and &#039;&#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld` (&lt;br /&gt;
	`id`       INT(11)     NOT NULL AUTO_INCREMENT,&lt;br /&gt;
	`greeting` VARCHAR(25) NOT NULL,&lt;br /&gt;
	`published` tinyint(4) NOT NULL,&lt;br /&gt;
	PRIMARY KEY (`id`)&lt;br /&gt;
)&lt;br /&gt;
	ENGINE =MyISAM&lt;br /&gt;
	AUTO_INCREMENT =0&lt;br /&gt;
	DEFAULT CHARSET =utf8;&lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld` (`greeting`) VALUES&lt;br /&gt;
(&#039;Hello World!&#039;),&lt;br /&gt;
(&#039;Good bye World!&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The file &amp;lt;tt&amp;gt;install.mysql.utf8.sql&amp;lt;/tt&amp;gt; will be executed when you install this component. The file &#039;&#039;0.0.6.sql&#039;&#039; is executed when you do an update.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When the component is installed, the files in the SQL updates folder (for example, &#039;&#039;admin/sql/updates/mysql&#039;&#039;) are read and the name of the last file alphabetically is used to populate the component&#039;s version number in the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; table. This value must be in this table in order for the automatic update to execute the update SQL files for future versions. For this reason, it is good practice to create a SQL update file for each version (even if it is empty or just has a comment). This way the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; version will always match the component version.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When saving the SQL files in utf8, be sure to save them as utf8 NOT BOM or the query will fail with MySQL error #1064.&lt;br /&gt;
&lt;br /&gt;
This is the install file. It will be executed if you put an appropriate order in the &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&amp;gt; file.&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;&#039;&#039;&#039;helloworld.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,17-26,58-61&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.6&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Faites de même avec le fichier de désinstallation :&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &amp;lt;tt&amp;gt;admin/sql/uninstall.mysql.utf8.sql&amp;lt;/tt&amp;gt; containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/uninstall.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ajouter un nouveau type de champ ==&lt;br /&gt;
For the moment, we have used a [[S:MyLanguage/J3.3:Developing an MVC Component/Adding a menu type to the site part|hard coded field type for messages]]. We need to use our database for choosing the message.&lt;br /&gt;
&lt;br /&gt;
Modify the &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt; file and put these lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;8,11-16&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields&lt;br /&gt;
			name=&amp;quot;request&amp;quot;&lt;br /&gt;
			addfieldpath=&amp;quot;/administrator/components/com_helloworld/models/fields&amp;quot;&lt;br /&gt;
			&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;id&amp;quot;&lt;br /&gt;
					type=&amp;quot;helloworld&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
					/&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It introduces a new field type and tells Joomla to look for the field definition in the &amp;lt;tt&amp;gt;/administrator/components/com_helloworld/models/fields&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &#039;&#039;admin/models/fields/helloworld.php&#039;&#039; file containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/fields/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/models/fields/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JFormHelper::loadFieldClass(&#039;list&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Form Field class for the HelloWorld component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class JFormFieldHelloWorld extends JFormFieldList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The field type.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var         string&lt;br /&gt;
	 */&lt;br /&gt;
	protected $type = &#039;HelloWorld&#039;;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a list of options for a list input.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  array  An array of JHtml options.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getOptions()&lt;br /&gt;
	{&lt;br /&gt;
		$db    = JFactory::getDBO();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		$query-&amp;gt;select(&#039;id,greeting&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		$db-&amp;gt;setQuery((string) $query);&lt;br /&gt;
		$messages = $db-&amp;gt;loadObjectList();&lt;br /&gt;
		$options  = array();&lt;br /&gt;
&lt;br /&gt;
		if ($messages)&lt;br /&gt;
		{&lt;br /&gt;
			foreach ($messages as $message)&lt;br /&gt;
			{&lt;br /&gt;
				$options[] = JHtml::_(&#039;select.option&#039;, $message-&amp;gt;id, $message-&amp;gt;greeting);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$options = array_merge(parent::getOptions(), $options);&lt;br /&gt;
&lt;br /&gt;
		return $options;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new field type displays a drop-down list of messages to choose from. You can see the result of this change in the menu manager section for the helloworld item.&lt;br /&gt;
&lt;br /&gt;
== Afficher le message sélectionné ==&lt;br /&gt;
When a menu item of this component is created/updated, Joomla stores the identifier of the message. The &amp;lt;tt&amp;gt;HelloWorldModelHelloWorld&amp;lt;/tt&amp;gt; model has now to compute the message according to this identifier and the data stored in the database.&lt;br /&gt;
&lt;br /&gt;
Modifiez le fichier &amp;lt;tt&amp;gt;site/models/helloworld.php&amp;lt;/tt&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/models/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var array messages&lt;br /&gt;
	 */&lt;br /&gt;
	protected $messages;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * 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;
	 * Get the message&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   integer  $id  Greeting Id&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  string        Fetched String from Table for relevant Id&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg($id = 1)&lt;br /&gt;
	{&lt;br /&gt;
		if (!is_array($this-&amp;gt;messages))&lt;br /&gt;
		{&lt;br /&gt;
			$this-&amp;gt;messages = array();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;messages[$id]))&lt;br /&gt;
		{&lt;br /&gt;
			// Request the selected id&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&lt;br /&gt;
			// Get a TableHelloWorld instance&lt;br /&gt;
			$table = $this-&amp;gt;getTable();&lt;br /&gt;
&lt;br /&gt;
			// Load the message&lt;br /&gt;
			$table-&amp;gt;load($id);&lt;br /&gt;
&lt;br /&gt;
			// Assign the message&lt;br /&gt;
			$this-&amp;gt;messages[$id] = $table-&amp;gt;greeting;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $this-&amp;gt;messages[$id];&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The model now asks the &#039;&#039;TableHelloWorld&#039;&#039; to get the message. This table class has to be defined in &amp;lt;tt&amp;gt;admin/tables/helloworld.php&amp;lt;/tt&amp;gt; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/tables/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldTableHelloWorld extends JTable&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   JDatabaseDriver  &amp;amp;$db  A database connector object&lt;br /&gt;
	 */&lt;br /&gt;
	function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct(&#039;#__helloworld&#039;, &#039;id&#039;, $db);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You shouldn&#039;t see any differences, but if you access the database you should see a table named &#039;&#039;jos_helloworld&#039;&#039; with two columns: id and greeting. And two entries: &#039;&#039;Hello World!&#039;&#039; and &#039;&#039;Good bye World&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
&lt;br /&gt;
Contenu de votre répertoire de code&lt;br /&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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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;[[#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[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;[[#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;[[#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/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-6-using-the-database.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez ajouter un élément de menu pour ce composant à l&#039;aide du gestionnaire de menus dans le backend.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding a variable request in the menu type|Préc. : Ajouter une requête de variable dans le type de menu|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Basic backend|Suiv. : Backend de base|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! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/6/fr&amp;diff=206857</id>
		<title>Translations:J3.x:Developing an MVC Component/Using the database/6/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/6/fr&amp;diff=206857"/>
		<updated>2015-07-21T09:56:47Z</updated>

		<summary type="html">&lt;p&gt;Perete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Avec votre gestionnaire de fichiers et éditeur préférés, créer deux fichiers appelés &amp;lt;tt&amp;gt;admin/sql/install.mysql.utf8.sql&amp;lt;/tt&amp;gt; et &amp;lt;tt&amp;gt;admin/sql/updates/mysql/0.0.6.sql&amp;lt;/tt&amp;gt;. Ils devraient tous les deux avoir le même contenu :&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=206856</id>
		<title>J3.x:Developing an MVC Component/Using the database/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=206856"/>
		<updated>2015-07-21T09:54:36Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Avec votre gestionnaire de fichiers et éditeur préférés, créer deux fichiers appelés &amp;lt;tt&amp;gt;admin/sql/installer.mysql.utf8.sql&amp;lt;/tt&amp;gt; et &amp;lt;tt&amp;gt;admin/sql/mises à jour/mysql/0.0...&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;
{{:J3.1:Developing an MVC Component/fr}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
&lt;br /&gt;
== Utiliser la base de données ==&lt;br /&gt;
Les composants gèrent généralement leur contenu à l&#039;aide de la base de données. Lors de la procédure  d&#039;installation/désinstallation/mise à jour d&#039;un composant, vous pouvez exécuter des requêtes SQL par l&#039;utilisation de  fichiers texte SQL.&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers et éditeur préférés, créer deux fichiers appelés &amp;lt;tt&amp;gt;admin/sql/installer.mysql.utf8.sql&amp;lt;/tt&amp;gt; et &amp;lt;tt&amp;gt;admin/sql/mises à jour/mysql/0.0.6.sql&amp;lt;/tt&amp;gt;. Ils devraient tous les deux avoir le même contenu :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/install.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039;&#039; and &#039;&#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld` (&lt;br /&gt;
	`id`       INT(11)     NOT NULL AUTO_INCREMENT,&lt;br /&gt;
	`greeting` VARCHAR(25) NOT NULL,&lt;br /&gt;
	`published` tinyint(4) NOT NULL,&lt;br /&gt;
	PRIMARY KEY (`id`)&lt;br /&gt;
)&lt;br /&gt;
	ENGINE =MyISAM&lt;br /&gt;
	AUTO_INCREMENT =0&lt;br /&gt;
	DEFAULT CHARSET =utf8;&lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld` (`greeting`) VALUES&lt;br /&gt;
(&#039;Hello World!&#039;),&lt;br /&gt;
(&#039;Good bye World!&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The file &amp;lt;tt&amp;gt;install.mysql.utf8.sql&amp;lt;/tt&amp;gt; will be executed when you install this component. The file &#039;&#039;0.0.6.sql&#039;&#039; is executed when you do an update.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When the component is installed, the files in the SQL updates folder (for example, &#039;&#039;admin/sql/updates/mysql&#039;&#039;) are read and the name of the last file alphabetically is used to populate the component&#039;s version number in the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; table. This value must be in this table in order for the automatic update to execute the update SQL files for future versions. For this reason, it is good practice to create a SQL update file for each version (even if it is empty or just has a comment). This way the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; version will always match the component version.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When saving the SQL files in utf8, be sure to save them as utf8 NOT BOM or the query will fail with MySQL error #1064.&lt;br /&gt;
&lt;br /&gt;
This is the install file. It will be executed if you put an appropriate order in the &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&amp;gt; file.&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;&#039;&#039;&#039;helloworld.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,17-26,58-61&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.6&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Faites de même avec le fichier de désinstallation :&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &amp;lt;tt&amp;gt;admin/sql/uninstall.mysql.utf8.sql&amp;lt;/tt&amp;gt; containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/uninstall.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ajouter un nouveau type de champ ==&lt;br /&gt;
For the moment, we have used a [[S:MyLanguage/J3.3:Developing an MVC Component/Adding a menu type to the site part|hard coded field type for messages]]. We need to use our database for choosing the message.&lt;br /&gt;
&lt;br /&gt;
Modify the &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt; file and put these lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;8,11-16&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields&lt;br /&gt;
			name=&amp;quot;request&amp;quot;&lt;br /&gt;
			addfieldpath=&amp;quot;/administrator/components/com_helloworld/models/fields&amp;quot;&lt;br /&gt;
			&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;id&amp;quot;&lt;br /&gt;
					type=&amp;quot;helloworld&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
					/&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It introduces a new field type and tells Joomla to look for the field definition in the &amp;lt;tt&amp;gt;/administrator/components/com_helloworld/models/fields&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &#039;&#039;admin/models/fields/helloworld.php&#039;&#039; file containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/fields/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/models/fields/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JFormHelper::loadFieldClass(&#039;list&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Form Field class for the HelloWorld component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class JFormFieldHelloWorld extends JFormFieldList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The field type.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var         string&lt;br /&gt;
	 */&lt;br /&gt;
	protected $type = &#039;HelloWorld&#039;;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a list of options for a list input.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  array  An array of JHtml options.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getOptions()&lt;br /&gt;
	{&lt;br /&gt;
		$db    = JFactory::getDBO();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		$query-&amp;gt;select(&#039;id,greeting&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		$db-&amp;gt;setQuery((string) $query);&lt;br /&gt;
		$messages = $db-&amp;gt;loadObjectList();&lt;br /&gt;
		$options  = array();&lt;br /&gt;
&lt;br /&gt;
		if ($messages)&lt;br /&gt;
		{&lt;br /&gt;
			foreach ($messages as $message)&lt;br /&gt;
			{&lt;br /&gt;
				$options[] = JHtml::_(&#039;select.option&#039;, $message-&amp;gt;id, $message-&amp;gt;greeting);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$options = array_merge(parent::getOptions(), $options);&lt;br /&gt;
&lt;br /&gt;
		return $options;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new field type displays a drop-down list of messages to choose from. You can see the result of this change in the menu manager section for the helloworld item.&lt;br /&gt;
&lt;br /&gt;
== Afficher le message sélectionné ==&lt;br /&gt;
When a menu item of this component is created/updated, Joomla stores the identifier of the message. The &amp;lt;tt&amp;gt;HelloWorldModelHelloWorld&amp;lt;/tt&amp;gt; model has now to compute the message according to this identifier and the data stored in the database.&lt;br /&gt;
&lt;br /&gt;
Modifiez le fichier &amp;lt;tt&amp;gt;site/models/helloworld.php&amp;lt;/tt&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/models/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var array messages&lt;br /&gt;
	 */&lt;br /&gt;
	protected $messages;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * 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;
	 * Get the message&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   integer  $id  Greeting Id&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  string        Fetched String from Table for relevant Id&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg($id = 1)&lt;br /&gt;
	{&lt;br /&gt;
		if (!is_array($this-&amp;gt;messages))&lt;br /&gt;
		{&lt;br /&gt;
			$this-&amp;gt;messages = array();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;messages[$id]))&lt;br /&gt;
		{&lt;br /&gt;
			// Request the selected id&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&lt;br /&gt;
			// Get a TableHelloWorld instance&lt;br /&gt;
			$table = $this-&amp;gt;getTable();&lt;br /&gt;
&lt;br /&gt;
			// Load the message&lt;br /&gt;
			$table-&amp;gt;load($id);&lt;br /&gt;
&lt;br /&gt;
			// Assign the message&lt;br /&gt;
			$this-&amp;gt;messages[$id] = $table-&amp;gt;greeting;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $this-&amp;gt;messages[$id];&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The model now asks the &#039;&#039;TableHelloWorld&#039;&#039; to get the message. This table class has to be defined in &amp;lt;tt&amp;gt;admin/tables/helloworld.php&amp;lt;/tt&amp;gt; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/tables/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldTableHelloWorld extends JTable&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   JDatabaseDriver  &amp;amp;$db  A database connector object&lt;br /&gt;
	 */&lt;br /&gt;
	function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct(&#039;#__helloworld&#039;, &#039;id&#039;, $db);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You shouldn&#039;t see any differences, but if you access the database you should see a table named &#039;&#039;jos_helloworld&#039;&#039; with two columns: id and greeting. And two entries: &#039;&#039;Hello World!&#039;&#039; and &#039;&#039;Good bye World&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
&lt;br /&gt;
Contenu de votre répertoire de code&lt;br /&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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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;[[#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[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;[[#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;[[#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/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-6-using-the-database.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez ajouter un élément de menu pour ce composant à l&#039;aide du gestionnaire de menus dans le backend.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding a variable request in the menu type|Préc. : Ajouter une requête de variable dans le type de menu|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Basic backend|Suiv. : Backend de base|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! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/6/fr&amp;diff=206855</id>
		<title>Translations:J3.x:Developing an MVC Component/Using the database/6/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/6/fr&amp;diff=206855"/>
		<updated>2015-07-21T09:54:35Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Avec votre gestionnaire de fichiers et éditeur préférés, créer deux fichiers appelés &amp;lt;tt&amp;gt;admin/sql/installer.mysql.utf8.sql&amp;lt;/tt&amp;gt; et &amp;lt;tt&amp;gt;admin/sql/mises à jour/mysql/0.0...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Avec votre gestionnaire de fichiers et éditeur préférés, créer deux fichiers appelés &amp;lt;tt&amp;gt;admin/sql/installer.mysql.utf8.sql&amp;lt;/tt&amp;gt; et &amp;lt;tt&amp;gt;admin/sql/mises à jour/mysql/0.0.6.sql&amp;lt;/tt&amp;gt;. Ils devraient tous les deux avoir le même contenu :&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=206854</id>
		<title>J3.x:Developing an MVC Component/Using the database/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Using_the_database/fr&amp;diff=206854"/>
		<updated>2015-07-21T09:41:44Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Les composants gèrent généralement leur contenu à l&amp;#039;aide de la base de données. Lors de la procédure  d&amp;#039;installation/désinstallation/mise à jour d&amp;#039;un composant, vous p...&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;
{{:J3.1:Developing an MVC Component/fr}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
&lt;br /&gt;
== Utiliser la base de données ==&lt;br /&gt;
Les composants gèrent généralement leur contenu à l&#039;aide de la base de données. Lors de la procédure  d&#039;installation/désinstallation/mise à jour d&#039;un composant, vous pouvez exécuter des requêtes SQL par l&#039;utilisation de  fichiers texte SQL.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor create two files called &amp;lt;tt&amp;gt;admin/sql/install.mysql.utf8.sql&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;admin/sql/updates/mysql/0.0.6.sql&amp;lt;/tt&amp;gt;. They should both have the same content, as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/install.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039;&#039; and &#039;&#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `#__helloworld` (&lt;br /&gt;
	`id`       INT(11)     NOT NULL AUTO_INCREMENT,&lt;br /&gt;
	`greeting` VARCHAR(25) NOT NULL,&lt;br /&gt;
	`published` tinyint(4) NOT NULL,&lt;br /&gt;
	PRIMARY KEY (`id`)&lt;br /&gt;
)&lt;br /&gt;
	ENGINE =MyISAM&lt;br /&gt;
	AUTO_INCREMENT =0&lt;br /&gt;
	DEFAULT CHARSET =utf8;&lt;br /&gt;
&lt;br /&gt;
INSERT INTO `#__helloworld` (`greeting`) VALUES&lt;br /&gt;
(&#039;Hello World!&#039;),&lt;br /&gt;
(&#039;Good bye World!&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The file &amp;lt;tt&amp;gt;install.mysql.utf8.sql&amp;lt;/tt&amp;gt; will be executed when you install this component. The file &#039;&#039;0.0.6.sql&#039;&#039; is executed when you do an update.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When the component is installed, the files in the SQL updates folder (for example, &#039;&#039;admin/sql/updates/mysql&#039;&#039;) are read and the name of the last file alphabetically is used to populate the component&#039;s version number in the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; table. This value must be in this table in order for the automatic update to execute the update SQL files for future versions. For this reason, it is good practice to create a SQL update file for each version (even if it is empty or just has a comment). This way the &amp;lt;code&amp;gt;#__schemas&amp;lt;/code&amp;gt; version will always match the component version.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important Note:&#039;&#039;&#039; When saving the SQL files in utf8, be sure to save them as utf8 NOT BOM or the query will fail with MySQL error #1064.&lt;br /&gt;
&lt;br /&gt;
This is the install file. It will be executed if you put an appropriate order in the &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&amp;gt; file.&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;&#039;&#039;&#039;helloworld.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;13,17-26,58-61&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.6&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;install&amp;gt; &amp;lt;!-- Runs on install --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/install.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/install&amp;gt;&lt;br /&gt;
	&amp;lt;uninstall&amp;gt; &amp;lt;!-- Runs on uninstall --&amp;gt;&lt;br /&gt;
		&amp;lt;sql&amp;gt;&lt;br /&gt;
			&amp;lt;file driver=&amp;quot;mysql&amp;quot; charset=&amp;quot;utf8&amp;quot;&amp;gt;sql/uninstall.mysql.utf8.sql&amp;lt;/file&amp;gt;&lt;br /&gt;
		&amp;lt;/sql&amp;gt;&lt;br /&gt;
	&amp;lt;/uninstall&amp;gt;&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- tables files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;tables&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- models files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Faites de même avec le fichier de désinstallation :&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &amp;lt;tt&amp;gt;admin/sql/uninstall.mysql.utf8.sql&amp;lt;/tt&amp;gt; containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/sql/uninstall.mysql.utf8.sql&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE IF EXISTS `#__helloworld`;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ajouter un nouveau type de champ ==&lt;br /&gt;
For the moment, we have used a [[S:MyLanguage/J3.3:Developing an MVC Component/Adding a menu type to the site part|hard coded field type for messages]]. We need to use our database for choosing the message.&lt;br /&gt;
&lt;br /&gt;
Modify the &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt; file and put these lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;8,11-16&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields&lt;br /&gt;
			name=&amp;quot;request&amp;quot;&lt;br /&gt;
			addfieldpath=&amp;quot;/administrator/components/com_helloworld/models/fields&amp;quot;&lt;br /&gt;
			&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;id&amp;quot;&lt;br /&gt;
					type=&amp;quot;helloworld&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
					/&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It introduces a new field type and tells Joomla to look for the field definition in the &amp;lt;tt&amp;gt;/administrator/components/com_helloworld/models/fields&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &#039;&#039;admin/models/fields/helloworld.php&#039;&#039; file containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/models/fields/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/models/fields/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
JFormHelper::loadFieldClass(&#039;list&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Form Field class for the HelloWorld component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class JFormFieldHelloWorld extends JFormFieldList&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * The field type.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @var         string&lt;br /&gt;
	 */&lt;br /&gt;
	protected $type = &#039;HelloWorld&#039;;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Method to get a list of options for a list input.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  array  An array of JHtml options.&lt;br /&gt;
	 */&lt;br /&gt;
	protected function getOptions()&lt;br /&gt;
	{&lt;br /&gt;
		$db    = JFactory::getDBO();&lt;br /&gt;
		$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
		$query-&amp;gt;select(&#039;id,greeting&#039;);&lt;br /&gt;
		$query-&amp;gt;from(&#039;#__helloworld&#039;);&lt;br /&gt;
		$db-&amp;gt;setQuery((string) $query);&lt;br /&gt;
		$messages = $db-&amp;gt;loadObjectList();&lt;br /&gt;
		$options  = array();&lt;br /&gt;
&lt;br /&gt;
		if ($messages)&lt;br /&gt;
		{&lt;br /&gt;
			foreach ($messages as $message)&lt;br /&gt;
			{&lt;br /&gt;
				$options[] = JHtml::_(&#039;select.option&#039;, $message-&amp;gt;id, $message-&amp;gt;greeting);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$options = array_merge(parent::getOptions(), $options);&lt;br /&gt;
&lt;br /&gt;
		return $options;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new field type displays a drop-down list of messages to choose from. You can see the result of this change in the menu manager section for the helloworld item.&lt;br /&gt;
&lt;br /&gt;
== Afficher le message sélectionné ==&lt;br /&gt;
When a menu item of this component is created/updated, Joomla stores the identifier of the message. The &amp;lt;tt&amp;gt;HelloWorldModelHelloWorld&amp;lt;/tt&amp;gt; model has now to compute the message according to this identifier and the data stored in the database.&lt;br /&gt;
&lt;br /&gt;
Modifiez le fichier &amp;lt;tt&amp;gt;site/models/helloworld.php&amp;lt;/tt&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;site/models/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var array messages&lt;br /&gt;
	 */&lt;br /&gt;
	protected $messages;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * 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;
	 * Get the message&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   integer  $id  Greeting Id&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  string        Fetched String from Table for relevant Id&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg($id = 1)&lt;br /&gt;
	{&lt;br /&gt;
		if (!is_array($this-&amp;gt;messages))&lt;br /&gt;
		{&lt;br /&gt;
			$this-&amp;gt;messages = array();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (!isset($this-&amp;gt;messages[$id]))&lt;br /&gt;
		{&lt;br /&gt;
			// Request the selected id&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&lt;br /&gt;
			// Get a TableHelloWorld instance&lt;br /&gt;
			$table = $this-&amp;gt;getTable();&lt;br /&gt;
&lt;br /&gt;
			// Load the message&lt;br /&gt;
			$table-&amp;gt;load($id);&lt;br /&gt;
&lt;br /&gt;
			// Assign the message&lt;br /&gt;
			$this-&amp;gt;messages[$id] = $table-&amp;gt;greeting;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		return $this-&amp;gt;messages[$id];&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The model now asks the &#039;&#039;TableHelloWorld&#039;&#039; to get the message. This table class has to be defined in &amp;lt;tt&amp;gt;admin/tables/helloworld.php&amp;lt;/tt&amp;gt; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&#039;&#039;&#039;admin/tables/helloworld.php&#039;&#039;&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldTableHelloWorld extends JTable&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Constructor&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   JDatabaseDriver  &amp;amp;$db  A database connector object&lt;br /&gt;
	 */&lt;br /&gt;
	function __construct(&amp;amp;$db)&lt;br /&gt;
	{&lt;br /&gt;
		parent::__construct(&#039;#__helloworld&#039;, &#039;id&#039;, $db);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You shouldn&#039;t see any differences, but if you access the database you should see a table named &#039;&#039;jos_helloworld&#039;&#039; with two columns: id and greeting. And two entries: &#039;&#039;Hello World!&#039;&#039; and &#039;&#039;Good bye World&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
&lt;br /&gt;
Contenu de votre répertoire de code&lt;br /&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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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;[[#admin/sql/install.mysql.utf8.sql|admin/sql/install.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/uninstall.mysql.utf8.sql|admin/sql/uninstall.mysql.utf8.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[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;[[#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;[[#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/Developing_a_Basic_Component#index.html|admin/tables/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/tables/helloworld.php|admin/tables/helloworld.php]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-6-using-the-database.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez ajouter un élément de menu pour ce composant à l&#039;aide du gestionnaire de menus dans le backend.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding a variable request in the menu type|Préc. : Ajouter une requête de variable dans le type de menu|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Basic backend|Suiv. : Backend de base|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! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/5/fr&amp;diff=206853</id>
		<title>Translations:J3.x:Developing an MVC Component/Using the database/5/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Using_the_database/5/fr&amp;diff=206853"/>
		<updated>2015-07-21T09:41:43Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Les composants gèrent généralement leur contenu à l&amp;#039;aide de la base de données. Lors de la procédure  d&amp;#039;installation/désinstallation/mise à jour d&amp;#039;un composant, vous p...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Les composants gèrent généralement leur contenu à l&#039;aide de la base de données. Lors de la procédure  d&#039;installation/désinstallation/mise à jour d&#039;un composant, vous pouvez exécuter des requêtes SQL par l&#039;utilisation de  fichiers texte SQL.&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/fr&amp;diff=206352</id>
		<title>J3.x:Developing an MVC Component/Adding a view to the site part/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/fr&amp;diff=206352"/>
		<updated>2015-07-20T09:06:16Z</updated>

		<summary type="html">&lt;p&gt;Perete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{review}}&lt;br /&gt;
{{:J3.1:Developing an MVC Component/fr}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
Dans le framework Joomla! 3.x, les auteurs des composants tiers ont divisé leur code en trois parties principales:&lt;br /&gt;
* &#039;&#039;modèles&#039;&#039; : ils gèrent les données &lt;br /&gt;
* &#039;&#039;contrôleurs&#039;&#039; : ils exécutent les tâches, définissent et récupèrent  les états des modèles et demandent aux vues de s&#039;afficher&lt;br /&gt;
* &#039;&#039;vues&#039;&#039; : elles affichent le contenu en fonction du type (&#039;&#039;error&#039;&#039;, &#039;&#039;feed&#039;&#039;, &#039;&#039;html&#039;&#039;, &#039;&#039;json&#039;&#039;, &#039;&#039;raw&#039;&#039;, &#039;&#039;xml&#039;&#039;) et la mise en page choisie par les contrôleurs.&lt;br /&gt;
== Configurer le contrôleur ==&lt;br /&gt;
Dans le code du noyau Joomla, il existe une classe capable de gérer les contrôleurs : &#039;&#039;[https://api.joomla.org/cms-3/classes/JControllerLegacy.html JControllerLegacy]&#039;&#039;. Cette classe doit être étendue afin d&#039;être utilisée dans notre composant. Dans le fichier &amp;lt;tt&amp;gt;votresite/components/com_helloworld/helloworld.php&amp;lt;/tt&amp;gt; (point d&#039;entrée de notre composant &#039;&#039;Hello World&#039;&#039;), ajoutez ces lignes :&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/helloworld.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// Get an instance of the controller prefixed by HelloWorld&lt;br /&gt;
$controller = JControllerLegacy::getInstance(&#039;HelloWorld&#039;);&lt;br /&gt;
&lt;br /&gt;
// Perform the Request task&lt;br /&gt;
$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
$controller-&amp;gt;execute($input-&amp;gt;getCmd(&#039;task&#039;));&lt;br /&gt;
&lt;br /&gt;
// Redirect if set by the controller&lt;br /&gt;
$controller-&amp;gt;redirect();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
La méthode statique &#039;&#039;[https://api.joomla.org/cms-3/classes/JControllerLegacy.html#method_getInstance getInstance]&#039;&#039; de la classe &#039;&#039;JControllerLegacy&#039;&#039; va créer un contrôleur. Dans le code ci-dessus, cela va instancier un objet contrôleur de la classe nommée &#039;&#039;HelloWorldController&#039;&#039;. Joomla va chercher la déclaration de cette classe dans un fichier nommé &amp;lt;tt&amp;gt;votresitee/components/com_helloworld/controller.php&amp;lt;/tt&amp;gt; (c&#039;est un comportement par défaut).&lt;br /&gt;
&lt;br /&gt;
Maintenant, &amp;lt;tt&amp;gt;controller.php&amp;lt;/tt&amp;gt; doit être créé et &amp;quot;HelloWorldController&amp;quot; doit être déclaré et défini. A l&#039;aide de votre gestionnaire de fichiers et éditeur préférés, créez un fichier &amp;lt;tt&amp;gt;votresite/components/com_helloworld/controller.php&amp;lt;/tt&amp;gt; contenant :&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/controller.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
/**&lt;br /&gt;
 * Hello World Component Controller&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldController extends JControllerLegacy&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Si aucune tâche (&#039;&#039;task&#039;&#039;) n&#039;est indiquée dans les variables de requête, la tâche par défaut sera exécutée. Par défaut, la tâche &#039;&#039;display&#039;&#039;. La classe &#039;&#039;JControllerLegacy&#039;&#039; possède une telle tâche. Dans notre exemple, elle affichera une vue nommée &#039;&#039;HelloWorld&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Ainsi, avec tout simplement &#039;&#039;task&#039;&#039;, une fonction publique display() de &#039;&#039;JControllerLegacy&#039;&#039; est référencée.&lt;br /&gt;
&lt;br /&gt;
{{tip|Aparté : vous pourriez appeler une autre fonction adjointe à &#039;&#039;display()&#039;&#039; en utilisant une URL comme celle-ci :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;http://localhost/index.php?option=com_helloworld&amp;amp;task=insert&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ceci va appeler une fonction &#039;&#039;insert()&#039;&#039; de notre contrôleur (que nous devrons implémenter dans &#039;&#039;HelloWorldController&#039;&#039; ).}}&lt;br /&gt;
&lt;br /&gt;
== Configurer la vue ==&lt;br /&gt;
Lorsque JControllerLegacy veut afficher une vue, il va chercher les fichiers dans le dossier : &amp;lt;tt&amp;gt;votresite/components/com_[nom du composant]/views/[nom de la vue]/&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Le nom du dossier de la vue par défaut est le nom du composant lui-même. Dans notre cas, le chemin est &amp;lt;tt&amp;gt;votresite/components/com_helloworld/views/helloworld/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Le fichier qui va contenir le code de la vue est appelée &amp;lt;tt&amp;gt;view.[view_mode].php&amp;lt;/tt&amp;gt;. Le mode d&#039;affichage par défaut, et probablement la seule vue d&#039;un composant est le mode &amp;quot;html&amp;quot;. Donc cela nous donne notre nom de fichier qui sera : &amp;lt;tt&amp;gt;view.html.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers et éditeur  préférés, &amp;quot;créer un fichier&amp;quot; &amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/view.html.php&amp;lt;/tt&amp;gt; permettant d&#039;afficher la vue par défaut avec le code ci-dessous :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HTML View class for the HelloWorld Component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorld extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Display the Hello World view&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  void&lt;br /&gt;
	 */&lt;br /&gt;
	function display($tpl = null)&lt;br /&gt;
	{&lt;br /&gt;
		// Assign data to the view&lt;br /&gt;
		$this-&amp;gt;msg = &#039;Hello World&#039;;&lt;br /&gt;
&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;display&#039;&#039; method of the &#039;&#039;[https://api.joomla.org/cms-3/classes/JViewLegacy.html JViewLegacy]&#039;&#039; class is called with the &#039;&#039;display&#039;&#039; task of the JControllerLegacy class. In our case, this method will display data using the &#039;&#039;tmpl/default.php&#039;&#039; file. With your favorite file manager and editor, create a file &#039;&#039;&#039;&amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/tmpl/default.php&amp;lt;/tt&amp;gt;&#039;&#039;&#039; able to display the default view and containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;&amp;lt;?php echo $this-&amp;gt;msg; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This template file will be included by the JViewLegacy class. Therefore, here, $this refers to the HelloWorldViewHelloWorld class.&lt;br /&gt;
&lt;br /&gt;
So to give an example, one could call the view inside the &#039;&#039;yoursite/components/com_[component_name]/views/[name of view]/&#039;&#039; folder by calling &amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;lt;/code&amp;gt; (this would default to the &amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/&amp;lt;/tt&amp;gt; folder) or we could explicitly call the folder by calling:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;amp;view=helloworld&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if we change &amp;lt;code&amp;gt;&amp;amp;view=helloworld&amp;lt;/code&amp;gt; to something else, e.g. &amp;lt;code&amp;gt;&amp;amp;view=fluffy&amp;lt;/code&amp;gt; we would have to create a folder &amp;lt;code&amp;gt;components/com_helloworld/views/fluffy/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Copy the contents of &amp;lt;code&amp;gt;views/helloworld&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;views/fluffy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The classname of the file &amp;lt;code&amp;gt;view.html.php&amp;lt;/code&amp;gt; of the fluffy folder would be &#039;&#039;HelloWorldViewFluffy&#039;&#039;. Afterwards you can customize the contents of &#039;&#039;default.php&#039;&#039; of the &#039;&#039;fluffy&#039;&#039; subfolder for custom output and see the output by calling &amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;amp;view=fluffy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
Contenu de votre répertoire de code&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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/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;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-2-adding-a-site-view.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez tester ce composant simple en indiquant &#039;&#039;index.php?option=com_helloworld&#039;&#039; dans la barre d&#039;adresse de votre navigateur.&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,30,31&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;December 2013&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.2&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Résultat :&#039;&#039;&#039;&lt;br /&gt;
Vous verrez par défaut le message contenu dans la variable &#039;&#039;$this-&amp;gt;msg&#039;&#039; du fichier &amp;lt;tt&amp;gt;view.html.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
==Contributeurs==&lt;br /&gt;
*[[User:Gunjanpatel|Gunjan Patel]]&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Préc. : Développement d&#039;un composant simple|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding_a_menu_type_to_the_site_part|Suiv : Ajout d&#039;un type de menu à la partie site|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! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/25/fr&amp;diff=206351</id>
		<title>Translations:J3.x:Developing an MVC Component/Adding a view to the site part/25/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/25/fr&amp;diff=206351"/>
		<updated>2015-07-20T09:06:15Z</updated>

		<summary type="html">&lt;p&gt;Perete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Avec votre gestionnaire de fichiers et éditeur  préférés, &amp;quot;créer un fichier&amp;quot; &amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/view.html.php&amp;lt;/tt&amp;gt; permettant d&#039;afficher la vue par défaut avec le code ci-dessous :&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/fr&amp;diff=206350</id>
		<title>J3.x:Developing an MVC Component/Adding a view to the site part/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/fr&amp;diff=206350"/>
		<updated>2015-07-20T08:58:00Z</updated>

		<summary type="html">&lt;p&gt;Perete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{review}}&lt;br /&gt;
{{:J3.1:Developing an MVC Component/fr}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
Dans le framework Joomla! 3.x, les auteurs des composants tiers ont divisé leur code en trois parties principales:&lt;br /&gt;
* &#039;&#039;modèles&#039;&#039; : ils gèrent les données &lt;br /&gt;
* &#039;&#039;contrôleurs&#039;&#039; : ils exécutent les tâches, définissent et récupèrent  les états des modèles et demandent aux vues de s&#039;afficher&lt;br /&gt;
* &#039;&#039;vues&#039;&#039; : elles affichent le contenu en fonction du type (&#039;&#039;error&#039;&#039;, &#039;&#039;feed&#039;&#039;, &#039;&#039;html&#039;&#039;, &#039;&#039;json&#039;&#039;, &#039;&#039;raw&#039;&#039;, &#039;&#039;xml&#039;&#039;) et la mise en page choisie par les contrôleurs.&lt;br /&gt;
== Configurer le contrôleur ==&lt;br /&gt;
Dans le code du noyau Joomla, il existe une classe capable de gérer les contrôleurs : &#039;&#039;[https://api.joomla.org/cms-3/classes/JControllerLegacy.html JControllerLegacy]&#039;&#039;. Cette classe doit être étendue afin d&#039;être utilisée dans notre composant. Dans le fichier &amp;lt;tt&amp;gt;votresite/components/com_helloworld/helloworld.php&amp;lt;/tt&amp;gt; (point d&#039;entrée de notre composant &#039;&#039;Hello World&#039;&#039;), ajoutez ces lignes :&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/helloworld.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// Get an instance of the controller prefixed by HelloWorld&lt;br /&gt;
$controller = JControllerLegacy::getInstance(&#039;HelloWorld&#039;);&lt;br /&gt;
&lt;br /&gt;
// Perform the Request task&lt;br /&gt;
$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
$controller-&amp;gt;execute($input-&amp;gt;getCmd(&#039;task&#039;));&lt;br /&gt;
&lt;br /&gt;
// Redirect if set by the controller&lt;br /&gt;
$controller-&amp;gt;redirect();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
La méthode statique &#039;&#039;[https://api.joomla.org/cms-3/classes/JControllerLegacy.html#method_getInstance getInstance]&#039;&#039; de la classe &#039;&#039;JControllerLegacy&#039;&#039; va créer un contrôleur. Dans le code ci-dessus, cela va instancier un objet contrôleur de la classe nommée &#039;&#039;HelloWorldController&#039;&#039;. Joomla va chercher la déclaration de cette classe dans un fichier nommé &amp;lt;tt&amp;gt;votresitee/components/com_helloworld/controller.php&amp;lt;/tt&amp;gt; (c&#039;est un comportement par défaut).&lt;br /&gt;
&lt;br /&gt;
Maintenant, &amp;lt;tt&amp;gt;controller.php&amp;lt;/tt&amp;gt; doit être créé et &amp;quot;HelloWorldController&amp;quot; doit être déclaré et défini. A l&#039;aide de votre gestionnaire de fichiers et éditeur préférés, créez un fichier &amp;lt;tt&amp;gt;votresite/components/com_helloworld/controller.php&amp;lt;/tt&amp;gt; contenant :&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/controller.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
/**&lt;br /&gt;
 * Hello World Component Controller&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldController extends JControllerLegacy&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Si aucune tâche (&#039;&#039;task&#039;&#039;) n&#039;est indiquée dans les variables de requête, la tâche par défaut sera exécutée. Par défaut, la tâche &#039;&#039;display&#039;&#039;. La classe &#039;&#039;JControllerLegacy&#039;&#039; possède une telle tâche. Dans notre exemple, elle affichera une vue nommée &#039;&#039;HelloWorld&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Ainsi, avec tout simplement &#039;&#039;task&#039;&#039;, une fonction publique display() de &#039;&#039;JControllerLegacy&#039;&#039; est référencée.&lt;br /&gt;
&lt;br /&gt;
{{tip|Aparté : vous pourriez appeler une autre fonction adjointe à &#039;&#039;display()&#039;&#039; en utilisant une URL comme celle-ci :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;http://localhost/index.php?option=com_helloworld&amp;amp;task=insert&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ceci va appeler une fonction &#039;&#039;insert()&#039;&#039; de notre contrôleur (que nous devrons implémenter dans &#039;&#039;HelloWorldController&#039;&#039; ).}}&lt;br /&gt;
&lt;br /&gt;
== Configurer la vue ==&lt;br /&gt;
Lorsque JControllerLegacy veut afficher une vue, il va chercher les fichiers dans le dossier : &amp;lt;tt&amp;gt;votresite/components/com_[nom du composant]/views/[nom de la vue]/&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Le nom du dossier de la vue par défaut est le nom du composant lui-même. Dans notre cas, le chemin est &amp;lt;tt&amp;gt;votresite/components/com_helloworld/views/helloworld/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Le fichier qui va contenir le code de la vue est appelée &amp;lt;tt&amp;gt;view.[view_mode].php&amp;lt;/tt&amp;gt;. Le mode d&#039;affichage par défaut, et probablement la seule vue d&#039;un composant est le mode &amp;quot;html&amp;quot;. Donc cela nous donne notre nom de fichier qui sera : &amp;lt;tt&amp;gt;view.html.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers et éditeur  préférés, &amp;quot;&amp;quot; créer un fichier&amp;quot;&amp;quot; &amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/view.html.php&amp;lt;/tt&amp;gt; permettant d&#039;afficher la vue par défaut avec le code ci-dessous :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HTML View class for the HelloWorld Component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorld extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Display the Hello World view&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  void&lt;br /&gt;
	 */&lt;br /&gt;
	function display($tpl = null)&lt;br /&gt;
	{&lt;br /&gt;
		// Assign data to the view&lt;br /&gt;
		$this-&amp;gt;msg = &#039;Hello World&#039;;&lt;br /&gt;
&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;display&#039;&#039; method of the &#039;&#039;[https://api.joomla.org/cms-3/classes/JViewLegacy.html JViewLegacy]&#039;&#039; class is called with the &#039;&#039;display&#039;&#039; task of the JControllerLegacy class. In our case, this method will display data using the &#039;&#039;tmpl/default.php&#039;&#039; file. With your favorite file manager and editor, create a file &#039;&#039;&#039;&amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/tmpl/default.php&amp;lt;/tt&amp;gt;&#039;&#039;&#039; able to display the default view and containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;&amp;lt;?php echo $this-&amp;gt;msg; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This template file will be included by the JViewLegacy class. Therefore, here, $this refers to the HelloWorldViewHelloWorld class.&lt;br /&gt;
&lt;br /&gt;
So to give an example, one could call the view inside the &#039;&#039;yoursite/components/com_[component_name]/views/[name of view]/&#039;&#039; folder by calling &amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;lt;/code&amp;gt; (this would default to the &amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/&amp;lt;/tt&amp;gt; folder) or we could explicitly call the folder by calling:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;amp;view=helloworld&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if we change &amp;lt;code&amp;gt;&amp;amp;view=helloworld&amp;lt;/code&amp;gt; to something else, e.g. &amp;lt;code&amp;gt;&amp;amp;view=fluffy&amp;lt;/code&amp;gt; we would have to create a folder &amp;lt;code&amp;gt;components/com_helloworld/views/fluffy/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Copy the contents of &amp;lt;code&amp;gt;views/helloworld&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;views/fluffy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The classname of the file &amp;lt;code&amp;gt;view.html.php&amp;lt;/code&amp;gt; of the fluffy folder would be &#039;&#039;HelloWorldViewFluffy&#039;&#039;. Afterwards you can customize the contents of &#039;&#039;default.php&#039;&#039; of the &#039;&#039;fluffy&#039;&#039; subfolder for custom output and see the output by calling &amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;amp;view=fluffy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
Contenu de votre répertoire de code&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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/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;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-2-adding-a-site-view.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez tester ce composant simple en indiquant &#039;&#039;index.php?option=com_helloworld&#039;&#039; dans la barre d&#039;adresse de votre navigateur.&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,30,31&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;December 2013&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.2&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Résultat :&#039;&#039;&#039;&lt;br /&gt;
Vous verrez par défaut le message contenu dans la variable &#039;&#039;$this-&amp;gt;msg&#039;&#039; du fichier &amp;lt;tt&amp;gt;view.html.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
==Contributeurs==&lt;br /&gt;
*[[User:Gunjanpatel|Gunjan Patel]]&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Préc. : Développement d&#039;un composant simple|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding_a_menu_type_to_the_site_part|Suiv : Ajout d&#039;un type de menu à la partie site|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! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/25/fr&amp;diff=206349</id>
		<title>Translations:J3.x:Developing an MVC Component/Adding a view to the site part/25/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/25/fr&amp;diff=206349"/>
		<updated>2015-07-20T08:58:00Z</updated>

		<summary type="html">&lt;p&gt;Perete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Avec votre gestionnaire de fichiers et éditeur  préférés, &amp;quot;&amp;quot; créer un fichier&amp;quot;&amp;quot; &amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/view.html.php&amp;lt;/tt&amp;gt; permettant d&#039;afficher la vue par défaut avec le code ci-dessous :&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/fr&amp;diff=206348</id>
		<title>J3.x:Developing an MVC Component/Adding a view to the site part/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/fr&amp;diff=206348"/>
		<updated>2015-07-20T08:56:52Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Avec votre gestionnaire de fichiers et éditeur  préférés, &amp;quot;&amp;quot; créer un fichier &amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/view.html.php&amp;lt;/tt&amp;gt;&amp;quot;&amp;quot; permettant d&amp;#039;af...&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;
{{review}}&lt;br /&gt;
{{:J3.1:Developing an MVC Component/fr}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
Dans le framework Joomla! 3.x, les auteurs des composants tiers ont divisé leur code en trois parties principales:&lt;br /&gt;
* &#039;&#039;modèles&#039;&#039; : ils gèrent les données &lt;br /&gt;
* &#039;&#039;contrôleurs&#039;&#039; : ils exécutent les tâches, définissent et récupèrent  les états des modèles et demandent aux vues de s&#039;afficher&lt;br /&gt;
* &#039;&#039;vues&#039;&#039; : elles affichent le contenu en fonction du type (&#039;&#039;error&#039;&#039;, &#039;&#039;feed&#039;&#039;, &#039;&#039;html&#039;&#039;, &#039;&#039;json&#039;&#039;, &#039;&#039;raw&#039;&#039;, &#039;&#039;xml&#039;&#039;) et la mise en page choisie par les contrôleurs.&lt;br /&gt;
== Configurer le contrôleur ==&lt;br /&gt;
Dans le code du noyau Joomla, il existe une classe capable de gérer les contrôleurs : &#039;&#039;[https://api.joomla.org/cms-3/classes/JControllerLegacy.html JControllerLegacy]&#039;&#039;. Cette classe doit être étendue afin d&#039;être utilisée dans notre composant. Dans le fichier &amp;lt;tt&amp;gt;votresite/components/com_helloworld/helloworld.php&amp;lt;/tt&amp;gt; (point d&#039;entrée de notre composant &#039;&#039;Hello World&#039;&#039;), ajoutez ces lignes :&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/helloworld.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// Get an instance of the controller prefixed by HelloWorld&lt;br /&gt;
$controller = JControllerLegacy::getInstance(&#039;HelloWorld&#039;);&lt;br /&gt;
&lt;br /&gt;
// Perform the Request task&lt;br /&gt;
$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
$controller-&amp;gt;execute($input-&amp;gt;getCmd(&#039;task&#039;));&lt;br /&gt;
&lt;br /&gt;
// Redirect if set by the controller&lt;br /&gt;
$controller-&amp;gt;redirect();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
La méthode statique &#039;&#039;[https://api.joomla.org/cms-3/classes/JControllerLegacy.html#method_getInstance getInstance]&#039;&#039; de la classe &#039;&#039;JControllerLegacy&#039;&#039; va créer un contrôleur. Dans le code ci-dessus, cela va instancier un objet contrôleur de la classe nommée &#039;&#039;HelloWorldController&#039;&#039;. Joomla va chercher la déclaration de cette classe dans un fichier nommé &amp;lt;tt&amp;gt;votresitee/components/com_helloworld/controller.php&amp;lt;/tt&amp;gt; (c&#039;est un comportement par défaut).&lt;br /&gt;
&lt;br /&gt;
Maintenant, &amp;lt;tt&amp;gt;controller.php&amp;lt;/tt&amp;gt; doit être créé et &amp;quot;HelloWorldController&amp;quot; doit être déclaré et défini. A l&#039;aide de votre gestionnaire de fichiers et éditeur préférés, créez un fichier &amp;lt;tt&amp;gt;votresite/components/com_helloworld/controller.php&amp;lt;/tt&amp;gt; contenant :&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/controller.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
/**&lt;br /&gt;
 * Hello World Component Controller&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldController extends JControllerLegacy&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Si aucune tâche (&#039;&#039;task&#039;&#039;) n&#039;est indiquée dans les variables de requête, la tâche par défaut sera exécutée. Par défaut, la tâche &#039;&#039;display&#039;&#039;. La classe &#039;&#039;JControllerLegacy&#039;&#039; possède une telle tâche. Dans notre exemple, elle affichera une vue nommée &#039;&#039;HelloWorld&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Ainsi, avec tout simplement &#039;&#039;task&#039;&#039;, une fonction publique display() de &#039;&#039;JControllerLegacy&#039;&#039; est référencée.&lt;br /&gt;
&lt;br /&gt;
{{tip|Aparté : vous pourriez appeler une autre fonction adjointe à &#039;&#039;display()&#039;&#039; en utilisant une URL comme celle-ci :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;http://localhost/index.php?option=com_helloworld&amp;amp;task=insert&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ceci va appeler une fonction &#039;&#039;insert()&#039;&#039; de notre contrôleur (que nous devrons implémenter dans &#039;&#039;HelloWorldController&#039;&#039; ).}}&lt;br /&gt;
&lt;br /&gt;
== Configurer la vue ==&lt;br /&gt;
Lorsque JControllerLegacy veut afficher une vue, il va chercher les fichiers dans le dossier : &amp;lt;tt&amp;gt;votresite/components/com_[nom du composant]/views/[nom de la vue]/&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Le nom du dossier de la vue par défaut est le nom du composant lui-même. Dans notre cas, le chemin est &amp;lt;tt&amp;gt;votresite/components/com_helloworld/views/helloworld/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Le fichier qui va contenir le code de la vue est appelée &amp;lt;tt&amp;gt;view.[view_mode].php&amp;lt;/tt&amp;gt;. Le mode d&#039;affichage par défaut, et probablement la seule vue d&#039;un composant est le mode &amp;quot;html&amp;quot;. Donc cela nous donne notre nom de fichier qui sera : &amp;lt;tt&amp;gt;view.html.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Avec votre gestionnaire de fichiers et éditeur  préférés, &amp;quot;&amp;quot; créer un fichier &amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/view.html.php&amp;lt;/tt&amp;gt;&amp;quot;&amp;quot; permettant d&#039;afficher la vue par défaut avec le code ci-dessous :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HTML View class for the HelloWorld Component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorld extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Display the Hello World view&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  void&lt;br /&gt;
	 */&lt;br /&gt;
	function display($tpl = null)&lt;br /&gt;
	{&lt;br /&gt;
		// Assign data to the view&lt;br /&gt;
		$this-&amp;gt;msg = &#039;Hello World&#039;;&lt;br /&gt;
&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;display&#039;&#039; method of the &#039;&#039;[https://api.joomla.org/cms-3/classes/JViewLegacy.html JViewLegacy]&#039;&#039; class is called with the &#039;&#039;display&#039;&#039; task of the JControllerLegacy class. In our case, this method will display data using the &#039;&#039;tmpl/default.php&#039;&#039; file. With your favorite file manager and editor, create a file &#039;&#039;&#039;&amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/tmpl/default.php&amp;lt;/tt&amp;gt;&#039;&#039;&#039; able to display the default view and containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;&amp;lt;?php echo $this-&amp;gt;msg; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This template file will be included by the JViewLegacy class. Therefore, here, $this refers to the HelloWorldViewHelloWorld class.&lt;br /&gt;
&lt;br /&gt;
So to give an example, one could call the view inside the &#039;&#039;yoursite/components/com_[component_name]/views/[name of view]/&#039;&#039; folder by calling &amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;lt;/code&amp;gt; (this would default to the &amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/&amp;lt;/tt&amp;gt; folder) or we could explicitly call the folder by calling:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;amp;view=helloworld&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if we change &amp;lt;code&amp;gt;&amp;amp;view=helloworld&amp;lt;/code&amp;gt; to something else, e.g. &amp;lt;code&amp;gt;&amp;amp;view=fluffy&amp;lt;/code&amp;gt; we would have to create a folder &amp;lt;code&amp;gt;components/com_helloworld/views/fluffy/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Copy the contents of &amp;lt;code&amp;gt;views/helloworld&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;views/fluffy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The classname of the file &amp;lt;code&amp;gt;view.html.php&amp;lt;/code&amp;gt; of the fluffy folder would be &#039;&#039;HelloWorldViewFluffy&#039;&#039;. Afterwards you can customize the contents of &#039;&#039;default.php&#039;&#039; of the &#039;&#039;fluffy&#039;&#039; subfolder for custom output and see the output by calling &amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;amp;view=fluffy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
Contenu de votre répertoire de code&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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/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;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-2-adding-a-site-view.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez tester ce composant simple en indiquant &#039;&#039;index.php?option=com_helloworld&#039;&#039; dans la barre d&#039;adresse de votre navigateur.&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,30,31&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;December 2013&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.2&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Résultat :&#039;&#039;&#039;&lt;br /&gt;
Vous verrez par défaut le message contenu dans la variable &#039;&#039;$this-&amp;gt;msg&#039;&#039; du fichier &amp;lt;tt&amp;gt;view.html.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
==Contributeurs==&lt;br /&gt;
*[[User:Gunjanpatel|Gunjan Patel]]&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Préc. : Développement d&#039;un composant simple|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding_a_menu_type_to_the_site_part|Suiv : Ajout d&#039;un type de menu à la partie site|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! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/25/fr&amp;diff=206347</id>
		<title>Translations:J3.x:Developing an MVC Component/Adding a view to the site part/25/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/25/fr&amp;diff=206347"/>
		<updated>2015-07-20T08:56:51Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Avec votre gestionnaire de fichiers et éditeur  préférés, &amp;quot;&amp;quot; créer un fichier &amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/view.html.php&amp;lt;/tt&amp;gt;&amp;quot;&amp;quot; permettant d&amp;#039;af...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Avec votre gestionnaire de fichiers et éditeur  préférés, &amp;quot;&amp;quot; créer un fichier &amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/view.html.php&amp;lt;/tt&amp;gt;&amp;quot;&amp;quot; permettant d&#039;afficher la vue par défaut avec le code ci-dessous :&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/fr&amp;diff=206346</id>
		<title>J3.x:Developing an MVC Component/Adding a view to the site part/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/fr&amp;diff=206346"/>
		<updated>2015-07-20T08:52:44Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Le fichier qui va contenir le code de la vue est appelée &amp;lt;tt&amp;gt;view.[view_mode].php&amp;lt;/tt&amp;gt;. Le mode d&amp;#039;affichage par défaut, et probablement la seule vue d&amp;#039;un composant est le mo...&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;
{{review}}&lt;br /&gt;
{{:J3.1:Developing an MVC Component/fr}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
Dans le framework Joomla! 3.x, les auteurs des composants tiers ont divisé leur code en trois parties principales:&lt;br /&gt;
* &#039;&#039;modèles&#039;&#039; : ils gèrent les données &lt;br /&gt;
* &#039;&#039;contrôleurs&#039;&#039; : ils exécutent les tâches, définissent et récupèrent  les états des modèles et demandent aux vues de s&#039;afficher&lt;br /&gt;
* &#039;&#039;vues&#039;&#039; : elles affichent le contenu en fonction du type (&#039;&#039;error&#039;&#039;, &#039;&#039;feed&#039;&#039;, &#039;&#039;html&#039;&#039;, &#039;&#039;json&#039;&#039;, &#039;&#039;raw&#039;&#039;, &#039;&#039;xml&#039;&#039;) et la mise en page choisie par les contrôleurs.&lt;br /&gt;
== Configurer le contrôleur ==&lt;br /&gt;
Dans le code du noyau Joomla, il existe une classe capable de gérer les contrôleurs : &#039;&#039;[https://api.joomla.org/cms-3/classes/JControllerLegacy.html JControllerLegacy]&#039;&#039;. Cette classe doit être étendue afin d&#039;être utilisée dans notre composant. Dans le fichier &amp;lt;tt&amp;gt;votresite/components/com_helloworld/helloworld.php&amp;lt;/tt&amp;gt; (point d&#039;entrée de notre composant &#039;&#039;Hello World&#039;&#039;), ajoutez ces lignes :&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/helloworld.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// Get an instance of the controller prefixed by HelloWorld&lt;br /&gt;
$controller = JControllerLegacy::getInstance(&#039;HelloWorld&#039;);&lt;br /&gt;
&lt;br /&gt;
// Perform the Request task&lt;br /&gt;
$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
$controller-&amp;gt;execute($input-&amp;gt;getCmd(&#039;task&#039;));&lt;br /&gt;
&lt;br /&gt;
// Redirect if set by the controller&lt;br /&gt;
$controller-&amp;gt;redirect();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
La méthode statique &#039;&#039;[https://api.joomla.org/cms-3/classes/JControllerLegacy.html#method_getInstance getInstance]&#039;&#039; de la classe &#039;&#039;JControllerLegacy&#039;&#039; va créer un contrôleur. Dans le code ci-dessus, cela va instancier un objet contrôleur de la classe nommée &#039;&#039;HelloWorldController&#039;&#039;. Joomla va chercher la déclaration de cette classe dans un fichier nommé &amp;lt;tt&amp;gt;votresitee/components/com_helloworld/controller.php&amp;lt;/tt&amp;gt; (c&#039;est un comportement par défaut).&lt;br /&gt;
&lt;br /&gt;
Maintenant, &amp;lt;tt&amp;gt;controller.php&amp;lt;/tt&amp;gt; doit être créé et &amp;quot;HelloWorldController&amp;quot; doit être déclaré et défini. A l&#039;aide de votre gestionnaire de fichiers et éditeur préférés, créez un fichier &amp;lt;tt&amp;gt;votresite/components/com_helloworld/controller.php&amp;lt;/tt&amp;gt; contenant :&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/controller.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
/**&lt;br /&gt;
 * Hello World Component Controller&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldController extends JControllerLegacy&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Si aucune tâche (&#039;&#039;task&#039;&#039;) n&#039;est indiquée dans les variables de requête, la tâche par défaut sera exécutée. Par défaut, la tâche &#039;&#039;display&#039;&#039;. La classe &#039;&#039;JControllerLegacy&#039;&#039; possède une telle tâche. Dans notre exemple, elle affichera une vue nommée &#039;&#039;HelloWorld&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Ainsi, avec tout simplement &#039;&#039;task&#039;&#039;, une fonction publique display() de &#039;&#039;JControllerLegacy&#039;&#039; est référencée.&lt;br /&gt;
&lt;br /&gt;
{{tip|Aparté : vous pourriez appeler une autre fonction adjointe à &#039;&#039;display()&#039;&#039; en utilisant une URL comme celle-ci :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;http://localhost/index.php?option=com_helloworld&amp;amp;task=insert&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ceci va appeler une fonction &#039;&#039;insert()&#039;&#039; de notre contrôleur (que nous devrons implémenter dans &#039;&#039;HelloWorldController&#039;&#039; ).}}&lt;br /&gt;
&lt;br /&gt;
== Configurer la vue ==&lt;br /&gt;
Lorsque JControllerLegacy veut afficher une vue, il va chercher les fichiers dans le dossier : &amp;lt;tt&amp;gt;votresite/components/com_[nom du composant]/views/[nom de la vue]/&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Le nom du dossier de la vue par défaut est le nom du composant lui-même. Dans notre cas, le chemin est &amp;lt;tt&amp;gt;votresite/components/com_helloworld/views/helloworld/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Le fichier qui va contenir le code de la vue est appelée &amp;lt;tt&amp;gt;view.[view_mode].php&amp;lt;/tt&amp;gt;. Le mode d&#039;affichage par défaut, et probablement la seule vue d&#039;un composant est le mode &amp;quot;html&amp;quot;. Donc cela nous donne notre nom de fichier qui sera : &amp;lt;tt&amp;gt;view.html.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, &#039;&#039;&#039;create a file &amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/view.html.php&amp;lt;/tt&amp;gt;&#039;&#039;&#039; able to display the default view and containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HTML View class for the HelloWorld Component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorld extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Display the Hello World view&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  void&lt;br /&gt;
	 */&lt;br /&gt;
	function display($tpl = null)&lt;br /&gt;
	{&lt;br /&gt;
		// Assign data to the view&lt;br /&gt;
		$this-&amp;gt;msg = &#039;Hello World&#039;;&lt;br /&gt;
&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;display&#039;&#039; method of the &#039;&#039;[https://api.joomla.org/cms-3/classes/JViewLegacy.html JViewLegacy]&#039;&#039; class is called with the &#039;&#039;display&#039;&#039; task of the JControllerLegacy class. In our case, this method will display data using the &#039;&#039;tmpl/default.php&#039;&#039; file. With your favorite file manager and editor, create a file &#039;&#039;&#039;&amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/tmpl/default.php&amp;lt;/tt&amp;gt;&#039;&#039;&#039; able to display the default view and containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;&amp;lt;?php echo $this-&amp;gt;msg; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This template file will be included by the JViewLegacy class. Therefore, here, $this refers to the HelloWorldViewHelloWorld class.&lt;br /&gt;
&lt;br /&gt;
So to give an example, one could call the view inside the &#039;&#039;yoursite/components/com_[component_name]/views/[name of view]/&#039;&#039; folder by calling &amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;lt;/code&amp;gt; (this would default to the &amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/&amp;lt;/tt&amp;gt; folder) or we could explicitly call the folder by calling:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;amp;view=helloworld&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if we change &amp;lt;code&amp;gt;&amp;amp;view=helloworld&amp;lt;/code&amp;gt; to something else, e.g. &amp;lt;code&amp;gt;&amp;amp;view=fluffy&amp;lt;/code&amp;gt; we would have to create a folder &amp;lt;code&amp;gt;components/com_helloworld/views/fluffy/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Copy the contents of &amp;lt;code&amp;gt;views/helloworld&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;views/fluffy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The classname of the file &amp;lt;code&amp;gt;view.html.php&amp;lt;/code&amp;gt; of the fluffy folder would be &#039;&#039;HelloWorldViewFluffy&#039;&#039;. Afterwards you can customize the contents of &#039;&#039;default.php&#039;&#039; of the &#039;&#039;fluffy&#039;&#039; subfolder for custom output and see the output by calling &amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;amp;view=fluffy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
Contenu de votre répertoire de code&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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/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;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-2-adding-a-site-view.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez tester ce composant simple en indiquant &#039;&#039;index.php?option=com_helloworld&#039;&#039; dans la barre d&#039;adresse de votre navigateur.&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,30,31&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;December 2013&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.2&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Résultat :&#039;&#039;&#039;&lt;br /&gt;
Vous verrez par défaut le message contenu dans la variable &#039;&#039;$this-&amp;gt;msg&#039;&#039; du fichier &amp;lt;tt&amp;gt;view.html.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
==Contributeurs==&lt;br /&gt;
*[[User:Gunjanpatel|Gunjan Patel]]&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Préc. : Développement d&#039;un composant simple|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding_a_menu_type_to_the_site_part|Suiv : Ajout d&#039;un type de menu à la partie site|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! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/24/fr&amp;diff=206345</id>
		<title>Translations:J3.x:Developing an MVC Component/Adding a view to the site part/24/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/24/fr&amp;diff=206345"/>
		<updated>2015-07-20T08:52:43Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Le fichier qui va contenir le code de la vue est appelée &amp;lt;tt&amp;gt;view.[view_mode].php&amp;lt;/tt&amp;gt;. Le mode d&amp;#039;affichage par défaut, et probablement la seule vue d&amp;#039;un composant est le mo...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Le fichier qui va contenir le code de la vue est appelée &amp;lt;tt&amp;gt;view.[view_mode].php&amp;lt;/tt&amp;gt;. Le mode d&#039;affichage par défaut, et probablement la seule vue d&#039;un composant est le mode &amp;quot;html&amp;quot;. Donc cela nous donne notre nom de fichier qui sera : &amp;lt;tt&amp;gt;view.html.php&amp;lt;/tt&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/fr&amp;diff=206344</id>
		<title>J3.x:Developing an MVC Component/Adding a view to the site part/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/fr&amp;diff=206344"/>
		<updated>2015-07-20T08:48:34Z</updated>

		<summary type="html">&lt;p&gt;Perete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{review}}&lt;br /&gt;
{{:J3.1:Developing an MVC Component/fr}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
Dans le framework Joomla! 3.x, les auteurs des composants tiers ont divisé leur code en trois parties principales:&lt;br /&gt;
* &#039;&#039;modèles&#039;&#039; : ils gèrent les données &lt;br /&gt;
* &#039;&#039;contrôleurs&#039;&#039; : ils exécutent les tâches, définissent et récupèrent  les états des modèles et demandent aux vues de s&#039;afficher&lt;br /&gt;
* &#039;&#039;vues&#039;&#039; : elles affichent le contenu en fonction du type (&#039;&#039;error&#039;&#039;, &#039;&#039;feed&#039;&#039;, &#039;&#039;html&#039;&#039;, &#039;&#039;json&#039;&#039;, &#039;&#039;raw&#039;&#039;, &#039;&#039;xml&#039;&#039;) et la mise en page choisie par les contrôleurs.&lt;br /&gt;
== Configurer le contrôleur ==&lt;br /&gt;
Dans le code du noyau Joomla, il existe une classe capable de gérer les contrôleurs : &#039;&#039;[https://api.joomla.org/cms-3/classes/JControllerLegacy.html JControllerLegacy]&#039;&#039;. Cette classe doit être étendue afin d&#039;être utilisée dans notre composant. Dans le fichier &amp;lt;tt&amp;gt;votresite/components/com_helloworld/helloworld.php&amp;lt;/tt&amp;gt; (point d&#039;entrée de notre composant &#039;&#039;Hello World&#039;&#039;), ajoutez ces lignes :&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/helloworld.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// Get an instance of the controller prefixed by HelloWorld&lt;br /&gt;
$controller = JControllerLegacy::getInstance(&#039;HelloWorld&#039;);&lt;br /&gt;
&lt;br /&gt;
// Perform the Request task&lt;br /&gt;
$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
$controller-&amp;gt;execute($input-&amp;gt;getCmd(&#039;task&#039;));&lt;br /&gt;
&lt;br /&gt;
// Redirect if set by the controller&lt;br /&gt;
$controller-&amp;gt;redirect();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
La méthode statique &#039;&#039;[https://api.joomla.org/cms-3/classes/JControllerLegacy.html#method_getInstance getInstance]&#039;&#039; de la classe &#039;&#039;JControllerLegacy&#039;&#039; va créer un contrôleur. Dans le code ci-dessus, cela va instancier un objet contrôleur de la classe nommée &#039;&#039;HelloWorldController&#039;&#039;. Joomla va chercher la déclaration de cette classe dans un fichier nommé &amp;lt;tt&amp;gt;votresitee/components/com_helloworld/controller.php&amp;lt;/tt&amp;gt; (c&#039;est un comportement par défaut).&lt;br /&gt;
&lt;br /&gt;
Maintenant, &amp;lt;tt&amp;gt;controller.php&amp;lt;/tt&amp;gt; doit être créé et &amp;quot;HelloWorldController&amp;quot; doit être déclaré et défini. A l&#039;aide de votre gestionnaire de fichiers et éditeur préférés, créez un fichier &amp;lt;tt&amp;gt;votresite/components/com_helloworld/controller.php&amp;lt;/tt&amp;gt; contenant :&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/controller.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
/**&lt;br /&gt;
 * Hello World Component Controller&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldController extends JControllerLegacy&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Si aucune tâche (&#039;&#039;task&#039;&#039;) n&#039;est indiquée dans les variables de requête, la tâche par défaut sera exécutée. Par défaut, la tâche &#039;&#039;display&#039;&#039;. La classe &#039;&#039;JControllerLegacy&#039;&#039; possède une telle tâche. Dans notre exemple, elle affichera une vue nommée &#039;&#039;HelloWorld&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Ainsi, avec tout simplement &#039;&#039;task&#039;&#039;, une fonction publique display() de &#039;&#039;JControllerLegacy&#039;&#039; est référencée.&lt;br /&gt;
&lt;br /&gt;
{{tip|Aparté : vous pourriez appeler une autre fonction adjointe à &#039;&#039;display()&#039;&#039; en utilisant une URL comme celle-ci :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;http://localhost/index.php?option=com_helloworld&amp;amp;task=insert&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ceci va appeler une fonction &#039;&#039;insert()&#039;&#039; de notre contrôleur (que nous devrons implémenter dans &#039;&#039;HelloWorldController&#039;&#039; ).}}&lt;br /&gt;
&lt;br /&gt;
== Configurer la vue ==&lt;br /&gt;
Lorsque JControllerLegacy veut afficher une vue, il va chercher les fichiers dans le dossier : &amp;lt;tt&amp;gt;votresite/components/com_[nom du composant]/views/[nom de la vue]/&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Le nom du dossier de la vue par défaut est le nom du composant lui-même. Dans notre cas, le chemin est &amp;lt;tt&amp;gt;votresite/components/com_helloworld/views/helloworld/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The file that will contain the code of the view is called &amp;lt;tt&amp;gt;view.[view_mode].php&amp;lt;/tt&amp;gt;. The default view mode, and probably the only view a component might need is the &#039;&#039;html&#039;&#039; mode. So this give us our file name which is &amp;lt;tt&amp;gt;view.html.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, &#039;&#039;&#039;create a file &amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/view.html.php&amp;lt;/tt&amp;gt;&#039;&#039;&#039; able to display the default view and containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HTML View class for the HelloWorld Component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorld extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Display the Hello World view&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  void&lt;br /&gt;
	 */&lt;br /&gt;
	function display($tpl = null)&lt;br /&gt;
	{&lt;br /&gt;
		// Assign data to the view&lt;br /&gt;
		$this-&amp;gt;msg = &#039;Hello World&#039;;&lt;br /&gt;
&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;display&#039;&#039; method of the &#039;&#039;[https://api.joomla.org/cms-3/classes/JViewLegacy.html JViewLegacy]&#039;&#039; class is called with the &#039;&#039;display&#039;&#039; task of the JControllerLegacy class. In our case, this method will display data using the &#039;&#039;tmpl/default.php&#039;&#039; file. With your favorite file manager and editor, create a file &#039;&#039;&#039;&amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/tmpl/default.php&amp;lt;/tt&amp;gt;&#039;&#039;&#039; able to display the default view and containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;&amp;lt;?php echo $this-&amp;gt;msg; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This template file will be included by the JViewLegacy class. Therefore, here, $this refers to the HelloWorldViewHelloWorld class.&lt;br /&gt;
&lt;br /&gt;
So to give an example, one could call the view inside the &#039;&#039;yoursite/components/com_[component_name]/views/[name of view]/&#039;&#039; folder by calling &amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;lt;/code&amp;gt; (this would default to the &amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/&amp;lt;/tt&amp;gt; folder) or we could explicitly call the folder by calling:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;amp;view=helloworld&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if we change &amp;lt;code&amp;gt;&amp;amp;view=helloworld&amp;lt;/code&amp;gt; to something else, e.g. &amp;lt;code&amp;gt;&amp;amp;view=fluffy&amp;lt;/code&amp;gt; we would have to create a folder &amp;lt;code&amp;gt;components/com_helloworld/views/fluffy/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Copy the contents of &amp;lt;code&amp;gt;views/helloworld&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;views/fluffy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The classname of the file &amp;lt;code&amp;gt;view.html.php&amp;lt;/code&amp;gt; of the fluffy folder would be &#039;&#039;HelloWorldViewFluffy&#039;&#039;. Afterwards you can customize the contents of &#039;&#039;default.php&#039;&#039; of the &#039;&#039;fluffy&#039;&#039; subfolder for custom output and see the output by calling &amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;amp;view=fluffy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
Contenu de votre répertoire de code&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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/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;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-2-adding-a-site-view.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez tester ce composant simple en indiquant &#039;&#039;index.php?option=com_helloworld&#039;&#039; dans la barre d&#039;adresse de votre navigateur.&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,30,31&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;December 2013&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.2&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Résultat :&#039;&#039;&#039;&lt;br /&gt;
Vous verrez par défaut le message contenu dans la variable &#039;&#039;$this-&amp;gt;msg&#039;&#039; du fichier &amp;lt;tt&amp;gt;view.html.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
==Contributeurs==&lt;br /&gt;
*[[User:Gunjanpatel|Gunjan Patel]]&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Préc. : Développement d&#039;un composant simple|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding_a_menu_type_to_the_site_part|Suiv : Ajout d&#039;un type de menu à la partie site|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! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/23/fr&amp;diff=206343</id>
		<title>Translations:J3.x:Developing an MVC Component/Adding a view to the site part/23/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/23/fr&amp;diff=206343"/>
		<updated>2015-07-20T08:48:33Z</updated>

		<summary type="html">&lt;p&gt;Perete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Le nom du dossier de la vue par défaut est le nom du composant lui-même. Dans notre cas, le chemin est &amp;lt;tt&amp;gt;votresite/components/com_helloworld/views/helloworld/&amp;lt;/tt&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/fr&amp;diff=206342</id>
		<title>J3.x:Developing an MVC Component/Adding a view to the site part/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/fr&amp;diff=206342"/>
		<updated>2015-07-20T08:47:21Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Le nom du dossier de la vue par défaut est le nom du composant lui-même. Dans notre cas, le chemin est &amp;lt;tt&amp;gt;votresite/composants/com_helloworld/vues/helloworld/&amp;lt;/tt&amp;gt;.&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;
{{review}}&lt;br /&gt;
{{:J3.1:Developing an MVC Component/fr}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
Dans le framework Joomla! 3.x, les auteurs des composants tiers ont divisé leur code en trois parties principales:&lt;br /&gt;
* &#039;&#039;modèles&#039;&#039; : ils gèrent les données &lt;br /&gt;
* &#039;&#039;contrôleurs&#039;&#039; : ils exécutent les tâches, définissent et récupèrent  les états des modèles et demandent aux vues de s&#039;afficher&lt;br /&gt;
* &#039;&#039;vues&#039;&#039; : elles affichent le contenu en fonction du type (&#039;&#039;error&#039;&#039;, &#039;&#039;feed&#039;&#039;, &#039;&#039;html&#039;&#039;, &#039;&#039;json&#039;&#039;, &#039;&#039;raw&#039;&#039;, &#039;&#039;xml&#039;&#039;) et la mise en page choisie par les contrôleurs.&lt;br /&gt;
== Configurer le contrôleur ==&lt;br /&gt;
Dans le code du noyau Joomla, il existe une classe capable de gérer les contrôleurs : &#039;&#039;[https://api.joomla.org/cms-3/classes/JControllerLegacy.html JControllerLegacy]&#039;&#039;. Cette classe doit être étendue afin d&#039;être utilisée dans notre composant. Dans le fichier &amp;lt;tt&amp;gt;votresite/components/com_helloworld/helloworld.php&amp;lt;/tt&amp;gt; (point d&#039;entrée de notre composant &#039;&#039;Hello World&#039;&#039;), ajoutez ces lignes :&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/helloworld.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// Get an instance of the controller prefixed by HelloWorld&lt;br /&gt;
$controller = JControllerLegacy::getInstance(&#039;HelloWorld&#039;);&lt;br /&gt;
&lt;br /&gt;
// Perform the Request task&lt;br /&gt;
$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
$controller-&amp;gt;execute($input-&amp;gt;getCmd(&#039;task&#039;));&lt;br /&gt;
&lt;br /&gt;
// Redirect if set by the controller&lt;br /&gt;
$controller-&amp;gt;redirect();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
La méthode statique &#039;&#039;[https://api.joomla.org/cms-3/classes/JControllerLegacy.html#method_getInstance getInstance]&#039;&#039; de la classe &#039;&#039;JControllerLegacy&#039;&#039; va créer un contrôleur. Dans le code ci-dessus, cela va instancier un objet contrôleur de la classe nommée &#039;&#039;HelloWorldController&#039;&#039;. Joomla va chercher la déclaration de cette classe dans un fichier nommé &amp;lt;tt&amp;gt;votresitee/components/com_helloworld/controller.php&amp;lt;/tt&amp;gt; (c&#039;est un comportement par défaut).&lt;br /&gt;
&lt;br /&gt;
Maintenant, &amp;lt;tt&amp;gt;controller.php&amp;lt;/tt&amp;gt; doit être créé et &amp;quot;HelloWorldController&amp;quot; doit être déclaré et défini. A l&#039;aide de votre gestionnaire de fichiers et éditeur préférés, créez un fichier &amp;lt;tt&amp;gt;votresite/components/com_helloworld/controller.php&amp;lt;/tt&amp;gt; contenant :&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/controller.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
/**&lt;br /&gt;
 * Hello World Component Controller&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldController extends JControllerLegacy&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Si aucune tâche (&#039;&#039;task&#039;&#039;) n&#039;est indiquée dans les variables de requête, la tâche par défaut sera exécutée. Par défaut, la tâche &#039;&#039;display&#039;&#039;. La classe &#039;&#039;JControllerLegacy&#039;&#039; possède une telle tâche. Dans notre exemple, elle affichera une vue nommée &#039;&#039;HelloWorld&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Ainsi, avec tout simplement &#039;&#039;task&#039;&#039;, une fonction publique display() de &#039;&#039;JControllerLegacy&#039;&#039; est référencée.&lt;br /&gt;
&lt;br /&gt;
{{tip|Aparté : vous pourriez appeler une autre fonction adjointe à &#039;&#039;display()&#039;&#039; en utilisant une URL comme celle-ci :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;http://localhost/index.php?option=com_helloworld&amp;amp;task=insert&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ceci va appeler une fonction &#039;&#039;insert()&#039;&#039; de notre contrôleur (que nous devrons implémenter dans &#039;&#039;HelloWorldController&#039;&#039; ).}}&lt;br /&gt;
&lt;br /&gt;
== Configurer la vue ==&lt;br /&gt;
Lorsque JControllerLegacy veut afficher une vue, il va chercher les fichiers dans le dossier : &amp;lt;tt&amp;gt;votresite/components/com_[nom du composant]/views/[nom de la vue]/&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Le nom du dossier de la vue par défaut est le nom du composant lui-même. Dans notre cas, le chemin est &amp;lt;tt&amp;gt;votresite/composants/com_helloworld/vues/helloworld/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The file that will contain the code of the view is called &amp;lt;tt&amp;gt;view.[view_mode].php&amp;lt;/tt&amp;gt;. The default view mode, and probably the only view a component might need is the &#039;&#039;html&#039;&#039; mode. So this give us our file name which is &amp;lt;tt&amp;gt;view.html.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, &#039;&#039;&#039;create a file &amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/view.html.php&amp;lt;/tt&amp;gt;&#039;&#039;&#039; able to display the default view and containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HTML View class for the HelloWorld Component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorld extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Display the Hello World view&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  void&lt;br /&gt;
	 */&lt;br /&gt;
	function display($tpl = null)&lt;br /&gt;
	{&lt;br /&gt;
		// Assign data to the view&lt;br /&gt;
		$this-&amp;gt;msg = &#039;Hello World&#039;;&lt;br /&gt;
&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;display&#039;&#039; method of the &#039;&#039;[https://api.joomla.org/cms-3/classes/JViewLegacy.html JViewLegacy]&#039;&#039; class is called with the &#039;&#039;display&#039;&#039; task of the JControllerLegacy class. In our case, this method will display data using the &#039;&#039;tmpl/default.php&#039;&#039; file. With your favorite file manager and editor, create a file &#039;&#039;&#039;&amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/tmpl/default.php&amp;lt;/tt&amp;gt;&#039;&#039;&#039; able to display the default view and containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;&amp;lt;?php echo $this-&amp;gt;msg; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This template file will be included by the JViewLegacy class. Therefore, here, $this refers to the HelloWorldViewHelloWorld class.&lt;br /&gt;
&lt;br /&gt;
So to give an example, one could call the view inside the &#039;&#039;yoursite/components/com_[component_name]/views/[name of view]/&#039;&#039; folder by calling &amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;lt;/code&amp;gt; (this would default to the &amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/&amp;lt;/tt&amp;gt; folder) or we could explicitly call the folder by calling:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;amp;view=helloworld&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if we change &amp;lt;code&amp;gt;&amp;amp;view=helloworld&amp;lt;/code&amp;gt; to something else, e.g. &amp;lt;code&amp;gt;&amp;amp;view=fluffy&amp;lt;/code&amp;gt; we would have to create a folder &amp;lt;code&amp;gt;components/com_helloworld/views/fluffy/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Copy the contents of &amp;lt;code&amp;gt;views/helloworld&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;views/fluffy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The classname of the file &amp;lt;code&amp;gt;view.html.php&amp;lt;/code&amp;gt; of the fluffy folder would be &#039;&#039;HelloWorldViewFluffy&#039;&#039;. Afterwards you can customize the contents of &#039;&#039;default.php&#039;&#039; of the &#039;&#039;fluffy&#039;&#039; subfolder for custom output and see the output by calling &amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;amp;view=fluffy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
Contenu de votre répertoire de code&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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/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;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-2-adding-a-site-view.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez tester ce composant simple en indiquant &#039;&#039;index.php?option=com_helloworld&#039;&#039; dans la barre d&#039;adresse de votre navigateur.&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,30,31&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;December 2013&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.2&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Résultat :&#039;&#039;&#039;&lt;br /&gt;
Vous verrez par défaut le message contenu dans la variable &#039;&#039;$this-&amp;gt;msg&#039;&#039; du fichier &amp;lt;tt&amp;gt;view.html.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
==Contributeurs==&lt;br /&gt;
*[[User:Gunjanpatel|Gunjan Patel]]&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Préc. : Développement d&#039;un composant simple|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding_a_menu_type_to_the_site_part|Suiv : Ajout d&#039;un type de menu à la partie site|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! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/23/fr&amp;diff=206341</id>
		<title>Translations:J3.x:Developing an MVC Component/Adding a view to the site part/23/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/23/fr&amp;diff=206341"/>
		<updated>2015-07-20T08:47:21Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Le nom du dossier de la vue par défaut est le nom du composant lui-même. Dans notre cas, le chemin est &amp;lt;tt&amp;gt;votresite/composants/com_helloworld/vues/helloworld/&amp;lt;/tt&amp;gt;.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Le nom du dossier de la vue par défaut est le nom du composant lui-même. Dans notre cas, le chemin est &amp;lt;tt&amp;gt;votresite/composants/com_helloworld/vues/helloworld/&amp;lt;/tt&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/fr&amp;diff=206340</id>
		<title>J3.x:Developing an MVC Component/Adding a view to the site part/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/fr&amp;diff=206340"/>
		<updated>2015-07-20T08:44:48Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Lorsque JControllerLegacy veut afficher une vue, il va chercher les fichiers dans le dossier : &amp;lt;tt&amp;gt;votresite/components/com_[nom du composant]/views/[nom de la vue]/&amp;lt;/tt&amp;gt;.&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;
{{review}}&lt;br /&gt;
{{:J3.1:Developing an MVC Component/fr}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
Dans le framework Joomla! 3.x, les auteurs des composants tiers ont divisé leur code en trois parties principales:&lt;br /&gt;
* &#039;&#039;modèles&#039;&#039; : ils gèrent les données &lt;br /&gt;
* &#039;&#039;contrôleurs&#039;&#039; : ils exécutent les tâches, définissent et récupèrent  les états des modèles et demandent aux vues de s&#039;afficher&lt;br /&gt;
* &#039;&#039;vues&#039;&#039; : elles affichent le contenu en fonction du type (&#039;&#039;error&#039;&#039;, &#039;&#039;feed&#039;&#039;, &#039;&#039;html&#039;&#039;, &#039;&#039;json&#039;&#039;, &#039;&#039;raw&#039;&#039;, &#039;&#039;xml&#039;&#039;) et la mise en page choisie par les contrôleurs.&lt;br /&gt;
== Configurer le contrôleur ==&lt;br /&gt;
Dans le code du noyau Joomla, il existe une classe capable de gérer les contrôleurs : &#039;&#039;[https://api.joomla.org/cms-3/classes/JControllerLegacy.html JControllerLegacy]&#039;&#039;. Cette classe doit être étendue afin d&#039;être utilisée dans notre composant. Dans le fichier &amp;lt;tt&amp;gt;votresite/components/com_helloworld/helloworld.php&amp;lt;/tt&amp;gt; (point d&#039;entrée de notre composant &#039;&#039;Hello World&#039;&#039;), ajoutez ces lignes :&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/helloworld.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// Get an instance of the controller prefixed by HelloWorld&lt;br /&gt;
$controller = JControllerLegacy::getInstance(&#039;HelloWorld&#039;);&lt;br /&gt;
&lt;br /&gt;
// Perform the Request task&lt;br /&gt;
$input = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
$controller-&amp;gt;execute($input-&amp;gt;getCmd(&#039;task&#039;));&lt;br /&gt;
&lt;br /&gt;
// Redirect if set by the controller&lt;br /&gt;
$controller-&amp;gt;redirect();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
La méthode statique &#039;&#039;[https://api.joomla.org/cms-3/classes/JControllerLegacy.html#method_getInstance getInstance]&#039;&#039; de la classe &#039;&#039;JControllerLegacy&#039;&#039; va créer un contrôleur. Dans le code ci-dessus, cela va instancier un objet contrôleur de la classe nommée &#039;&#039;HelloWorldController&#039;&#039;. Joomla va chercher la déclaration de cette classe dans un fichier nommé &amp;lt;tt&amp;gt;votresitee/components/com_helloworld/controller.php&amp;lt;/tt&amp;gt; (c&#039;est un comportement par défaut).&lt;br /&gt;
&lt;br /&gt;
Maintenant, &amp;lt;tt&amp;gt;controller.php&amp;lt;/tt&amp;gt; doit être créé et &amp;quot;HelloWorldController&amp;quot; doit être déclaré et défini. A l&#039;aide de votre gestionnaire de fichiers et éditeur préférés, créez un fichier &amp;lt;tt&amp;gt;votresite/components/com_helloworld/controller.php&amp;lt;/tt&amp;gt; contenant :&lt;br /&gt;
&lt;br /&gt;
{{vanchor|site/controller.php}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
/**&lt;br /&gt;
 * Hello World Component Controller&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldController extends JControllerLegacy&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Si aucune tâche (&#039;&#039;task&#039;&#039;) n&#039;est indiquée dans les variables de requête, la tâche par défaut sera exécutée. Par défaut, la tâche &#039;&#039;display&#039;&#039;. La classe &#039;&#039;JControllerLegacy&#039;&#039; possède une telle tâche. Dans notre exemple, elle affichera une vue nommée &#039;&#039;HelloWorld&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Ainsi, avec tout simplement &#039;&#039;task&#039;&#039;, une fonction publique display() de &#039;&#039;JControllerLegacy&#039;&#039; est référencée.&lt;br /&gt;
&lt;br /&gt;
{{tip|Aparté : vous pourriez appeler une autre fonction adjointe à &#039;&#039;display()&#039;&#039; en utilisant une URL comme celle-ci :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;http://localhost/index.php?option=com_helloworld&amp;amp;task=insert&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ceci va appeler une fonction &#039;&#039;insert()&#039;&#039; de notre contrôleur (que nous devrons implémenter dans &#039;&#039;HelloWorldController&#039;&#039; ).}}&lt;br /&gt;
&lt;br /&gt;
== Configurer la vue ==&lt;br /&gt;
Lorsque JControllerLegacy veut afficher une vue, il va chercher les fichiers dans le dossier : &amp;lt;tt&amp;gt;votresite/components/com_[nom du composant]/views/[nom de la vue]/&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The name of the folder of the default view is the name of the component itself. In our case the path is &amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The file that will contain the code of the view is called &amp;lt;tt&amp;gt;view.[view_mode].php&amp;lt;/tt&amp;gt;. The default view mode, and probably the only view a component might need is the &#039;&#039;html&#039;&#039; mode. So this give us our file name which is &amp;lt;tt&amp;gt;view.html.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor, &#039;&#039;&#039;create a file &amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/view.html.php&amp;lt;/tt&amp;gt;&#039;&#039;&#039; able to display the default view and containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HTML View class for the HelloWorld Component&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldViewHelloWorld extends JViewLegacy&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Display the Hello World view&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return  void&lt;br /&gt;
	 */&lt;br /&gt;
	function display($tpl = null)&lt;br /&gt;
	{&lt;br /&gt;
		// Assign data to the view&lt;br /&gt;
		$this-&amp;gt;msg = &#039;Hello World&#039;;&lt;br /&gt;
&lt;br /&gt;
		// Display the view&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;display&#039;&#039; method of the &#039;&#039;[https://api.joomla.org/cms-3/classes/JViewLegacy.html JViewLegacy]&#039;&#039; class is called with the &#039;&#039;display&#039;&#039; task of the JControllerLegacy class. In our case, this method will display data using the &#039;&#039;tmpl/default.php&#039;&#039; file. With your favorite file manager and editor, create a file &#039;&#039;&#039;&amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/tmpl/default.php&amp;lt;/tt&amp;gt;&#039;&#039;&#039; able to display the default view and containing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;&amp;lt;?php echo $this-&amp;gt;msg; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This template file will be included by the JViewLegacy class. Therefore, here, $this refers to the HelloWorldViewHelloWorld class.&lt;br /&gt;
&lt;br /&gt;
So to give an example, one could call the view inside the &#039;&#039;yoursite/components/com_[component_name]/views/[name of view]/&#039;&#039; folder by calling &amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;lt;/code&amp;gt; (this would default to the &amp;lt;tt&amp;gt;yoursite/components/com_helloworld/views/helloworld/&amp;lt;/tt&amp;gt; folder) or we could explicitly call the folder by calling:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;amp;view=helloworld&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if we change &amp;lt;code&amp;gt;&amp;amp;view=helloworld&amp;lt;/code&amp;gt; to something else, e.g. &amp;lt;code&amp;gt;&amp;amp;view=fluffy&amp;lt;/code&amp;gt; we would have to create a folder &amp;lt;code&amp;gt;components/com_helloworld/views/fluffy/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Copy the contents of &amp;lt;code&amp;gt;views/helloworld&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;views/fluffy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The classname of the file &amp;lt;code&amp;gt;view.html.php&amp;lt;/code&amp;gt; of the fluffy folder would be &#039;&#039;HelloWorldViewFluffy&#039;&#039;. Afterwards you can customize the contents of &#039;&#039;default.php&#039;&#039; of the &#039;&#039;fluffy&#039;&#039; subfolder for custom output and see the output by calling &amp;lt;code&amp;gt;index.php?option=com_helloworld&amp;amp;view=fluffy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
Contenu de votre répertoire de code&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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/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;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-2-adding-a-site-view.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez tester ce composant simple en indiquant &#039;&#039;index.php?option=com_helloworld&#039;&#039; dans la barre d&#039;adresse de votre navigateur.&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,30,31&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;3.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;December 2013&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.2&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Résultat :&#039;&#039;&#039;&lt;br /&gt;
Vous verrez par défaut le message contenu dans la variable &#039;&#039;$this-&amp;gt;msg&#039;&#039; du fichier &amp;lt;tt&amp;gt;view.html.php&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
==Contributeurs==&lt;br /&gt;
*[[User:Gunjanpatel|Gunjan Patel]]&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
*[[User: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Developing_a_Basic_Component|Préc. : Développement d&#039;un composant simple|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding_a_menu_type_to_the_site_part|Suiv : Ajout d&#039;un type de menu à la partie site|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! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/22/fr&amp;diff=206339</id>
		<title>Translations:J3.x:Developing an MVC Component/Adding a view to the site part/22/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_view_to_the_site_part/22/fr&amp;diff=206339"/>
		<updated>2015-07-20T08:44:47Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Lorsque JControllerLegacy veut afficher une vue, il va chercher les fichiers dans le dossier : &amp;lt;tt&amp;gt;votresite/components/com_[nom du composant]/views/[nom de la vue]/&amp;lt;/tt&amp;gt;.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Lorsque JControllerLegacy veut afficher une vue, il va chercher les fichiers dans le dossier : &amp;lt;tt&amp;gt;votresite/components/com_[nom du composant]/views/[nom de la vue]/&amp;lt;/tt&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/fr&amp;diff=206337</id>
		<title>J3.x:Developing an MVC Component/Adding a variable request in the menu type/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/fr&amp;diff=206337"/>
		<updated>2015-07-20T08:30:39Z</updated>

		<summary type="html">&lt;p&gt;Perete: &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/fr}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
&lt;br /&gt;
== Ajout d&#039;une variable de demande dans le menu type ==&lt;br /&gt;
Pour le moment, le message affiché est toujours &amp;quot;Hello World!&amp;quot;. Joomla!2.5 donne la possibilité d&#039;ajouter des paramètres de types de menus. Dans notre cas, cela s&#039;effectue dans le fichier &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;6-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;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;id&amp;quot;&lt;br /&gt;
					type=&amp;quot;list&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
					default=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;Hello World!&amp;lt;/option&amp;gt;&lt;br /&gt;
                                &amp;lt;option value=&amp;quot;2&amp;quot;&amp;gt;Good bye World!&amp;lt;/option&amp;gt;&lt;br /&gt;
                        &amp;lt;/field&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deux choses importantes sont à noter :&lt;br /&gt;
* le &amp;quot;formulaire&amp;quot; groupe de champs indique les champs obligatoires.&lt;br /&gt;
* le nom de l&#039;attribut peut être transmis à la composante dans l&#039;URL. Dans ce cas &amp;lt;tt&amp;gt;?option=com_helloworld&amp;amp;id=1&amp;lt;/tt&amp;gt; indiquerait que vous avez choisi l&#039;option 1.&lt;br /&gt;
&lt;br /&gt;
Le modèle doit être modifié afin de permettre le choix entre les deux messages différents (ce choix s&#039;effectue par l&#039;utilisateur avec le champ défini ci-dessus):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;site/models/helloworld.php&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;33-45&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var string message&lt;br /&gt;
	 */&lt;br /&gt;
	protected $message;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 * @return  string  The message to be displayed to the user&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg()&lt;br /&gt;
	{&lt;br /&gt;
		if (!isset($this-&amp;gt;message))&lt;br /&gt;
		{&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&lt;br /&gt;
			switch ($id)&lt;br /&gt;
			{&lt;br /&gt;
				case 2:&lt;br /&gt;
					$this-&amp;gt;message = &#039;Good bye World!&#039;;&lt;br /&gt;
					break;&lt;br /&gt;
				default:&lt;br /&gt;
				case 1:&lt;br /&gt;
					$this-&amp;gt;message = &#039;Hello World!&#039;;&lt;br /&gt;
					break;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		return $this-&amp;gt;message;&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;
Modifiez également votre fichier &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&amp;gt; afin d&#039;indiquer une nouvelle version :&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.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.5&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Vous pouvez tester l&#039;affichage de cette variable en saisissant &amp;lt;tt&amp;gt;index.php?option=com_helloworld&amp;amp;id=1&amp;lt;/tt&amp;gt; ou &amp;lt;tt&amp;gt;index. php?option=com_helloworld&amp;amp;id=2&amp;lt;/tt&amp;gt; dans la barre d&#039;adresse de votre navigateur.&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
Contenu de votre répertoire de code :&lt;br /&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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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/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;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-5-adding-a-menu-variable-request.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez ajouter un élément de menu pour ce composant à l&#039;aide du gestionnaire de menus dans le backend.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer une demande ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
==Contributeurs==&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: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding a model to the site part|Préc. : Ajout d&#039;un modèle à la partie site|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Using the database|Suiv. : Utilisation de la base de données|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;
[[Category:Joomla! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/13/fr&amp;diff=206336</id>
		<title>Translations:J3.x:Developing an MVC Component/Adding a variable request in the menu type/13/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/13/fr&amp;diff=206336"/>
		<updated>2015-07-20T08:30:38Z</updated>

		<summary type="html">&lt;p&gt;Perete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Merci de créer une demande ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/fr&amp;diff=206335</id>
		<title>J3.x:Developing an MVC Component/Adding a variable request in the menu type/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/fr&amp;diff=206335"/>
		<updated>2015-07-20T08:06:30Z</updated>

		<summary type="html">&lt;p&gt;Perete: &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/fr}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
&lt;br /&gt;
== Ajout d&#039;une variable de demande dans le menu type ==&lt;br /&gt;
Pour le moment, le message affiché est toujours &amp;quot;Hello World!&amp;quot;. Joomla!2.5 donne la possibilité d&#039;ajouter des paramètres de types de menus. Dans notre cas, cela s&#039;effectue dans le fichier &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;6-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;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;id&amp;quot;&lt;br /&gt;
					type=&amp;quot;list&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
					default=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;Hello World!&amp;lt;/option&amp;gt;&lt;br /&gt;
                                &amp;lt;option value=&amp;quot;2&amp;quot;&amp;gt;Good bye World!&amp;lt;/option&amp;gt;&lt;br /&gt;
                        &amp;lt;/field&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deux choses importantes sont à noter :&lt;br /&gt;
* le &amp;quot;formulaire&amp;quot; groupe de champs indique les champs obligatoires.&lt;br /&gt;
* le nom de l&#039;attribut peut être transmis à la composante dans l&#039;URL. Dans ce cas &amp;lt;tt&amp;gt;?option=com_helloworld&amp;amp;id=1&amp;lt;/tt&amp;gt; indiquerait que vous avez choisi l&#039;option 1.&lt;br /&gt;
&lt;br /&gt;
Le modèle doit être modifié afin de permettre le choix entre les deux messages différents (ce choix s&#039;effectue par l&#039;utilisateur avec le champ défini ci-dessus):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;site/models/helloworld.php&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;33-45&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var string message&lt;br /&gt;
	 */&lt;br /&gt;
	protected $message;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 * @return  string  The message to be displayed to the user&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg()&lt;br /&gt;
	{&lt;br /&gt;
		if (!isset($this-&amp;gt;message))&lt;br /&gt;
		{&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&lt;br /&gt;
			switch ($id)&lt;br /&gt;
			{&lt;br /&gt;
				case 2:&lt;br /&gt;
					$this-&amp;gt;message = &#039;Good bye World!&#039;;&lt;br /&gt;
					break;&lt;br /&gt;
				default:&lt;br /&gt;
				case 1:&lt;br /&gt;
					$this-&amp;gt;message = &#039;Hello World!&#039;;&lt;br /&gt;
					break;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		return $this-&amp;gt;message;&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;
Modifiez également votre fichier &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&amp;gt; afin d&#039;indiquer une nouvelle version :&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.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.5&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Vous pouvez tester l&#039;affichage de cette variable en saisissant &amp;lt;tt&amp;gt;index.php?option=com_helloworld&amp;amp;id=1&amp;lt;/tt&amp;gt; ou &amp;lt;tt&amp;gt;index. php?option=com_helloworld&amp;amp;id=2&amp;lt;/tt&amp;gt; dans la barre d&#039;adresse de votre navigateur.&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
Contenu de votre répertoire de code :&lt;br /&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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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/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;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-5-adding-a-menu-variable-request.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez ajouter un élément de menu pour ce composant à l&#039;aide du gestionnaire de menus dans le backend.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
==Contributeurs==&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: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding a model to the site part|Préc. : Ajout d&#039;un modèle à la partie site|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Using the database|Suiv. : Utilisation de la base de données|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;
[[Category:Joomla! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/10/fr&amp;diff=206334</id>
		<title>Translations:J3.x:Developing an MVC Component/Adding a variable request in the menu type/10/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/10/fr&amp;diff=206334"/>
		<updated>2015-07-20T08:06:30Z</updated>

		<summary type="html">&lt;p&gt;Perete: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Vous pouvez tester l&#039;affichage de cette variable en saisissant &amp;lt;tt&amp;gt;index.php?option=com_helloworld&amp;amp;id=1&amp;lt;/tt&amp;gt; ou &amp;lt;tt&amp;gt;index. php?option=com_helloworld&amp;amp;id=2&amp;lt;/tt&amp;gt; dans la barre d&#039;adresse de votre navigateur.&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/fr&amp;diff=206333</id>
		<title>J3.x:Developing an MVC Component/Adding a variable request in the menu type/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/fr&amp;diff=206333"/>
		<updated>2015-07-20T08:05:27Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Vous pouvez tester l&amp;#039;affichage de cette variable en saisissant &amp;lt;tt&amp;gt;index.le php?option=com_helloworld&amp;amp;id=1&amp;lt;/tt&amp;gt; ou &amp;lt;tt&amp;gt;index. php?option=com_helloworld&amp;amp;id=2&amp;lt;/tt&amp;gt; dans la barre...&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;
{{:J3.1:Developing an MVC Component/fr}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
&lt;br /&gt;
== Ajout d&#039;une variable de demande dans le menu type ==&lt;br /&gt;
Pour le moment, le message affiché est toujours &amp;quot;Hello World!&amp;quot;. Joomla!2.5 donne la possibilité d&#039;ajouter des paramètres de types de menus. Dans notre cas, cela s&#039;effectue dans le fichier &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;6-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;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;id&amp;quot;&lt;br /&gt;
					type=&amp;quot;list&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
					default=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;Hello World!&amp;lt;/option&amp;gt;&lt;br /&gt;
                                &amp;lt;option value=&amp;quot;2&amp;quot;&amp;gt;Good bye World!&amp;lt;/option&amp;gt;&lt;br /&gt;
                        &amp;lt;/field&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deux choses importantes sont à noter :&lt;br /&gt;
* le &amp;quot;formulaire&amp;quot; groupe de champs indique les champs obligatoires.&lt;br /&gt;
* le nom de l&#039;attribut peut être transmis à la composante dans l&#039;URL. Dans ce cas &amp;lt;tt&amp;gt;?option=com_helloworld&amp;amp;id=1&amp;lt;/tt&amp;gt; indiquerait que vous avez choisi l&#039;option 1.&lt;br /&gt;
&lt;br /&gt;
Le modèle doit être modifié afin de permettre le choix entre les deux messages différents (ce choix s&#039;effectue par l&#039;utilisateur avec le champ défini ci-dessus):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;site/models/helloworld.php&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;33-45&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var string message&lt;br /&gt;
	 */&lt;br /&gt;
	protected $message;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 * @return  string  The message to be displayed to the user&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg()&lt;br /&gt;
	{&lt;br /&gt;
		if (!isset($this-&amp;gt;message))&lt;br /&gt;
		{&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&lt;br /&gt;
			switch ($id)&lt;br /&gt;
			{&lt;br /&gt;
				case 2:&lt;br /&gt;
					$this-&amp;gt;message = &#039;Good bye World!&#039;;&lt;br /&gt;
					break;&lt;br /&gt;
				default:&lt;br /&gt;
				case 1:&lt;br /&gt;
					$this-&amp;gt;message = &#039;Hello World!&#039;;&lt;br /&gt;
					break;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		return $this-&amp;gt;message;&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;
Modifiez également votre fichier &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&amp;gt; afin d&#039;indiquer une nouvelle version :&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.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.5&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Vous pouvez tester l&#039;affichage de cette variable en saisissant &amp;lt;tt&amp;gt;index.le php?option=com_helloworld&amp;amp;id=1&amp;lt;/tt&amp;gt; ou &amp;lt;tt&amp;gt;index. php?option=com_helloworld&amp;amp;id=2&amp;lt;/tt&amp;gt; dans la barre d&#039;adresse de votre navigateur.&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
Contenu de votre répertoire de code :&lt;br /&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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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/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;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-5-adding-a-menu-variable-request.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez ajouter un élément de menu pour ce composant à l&#039;aide du gestionnaire de menus dans le backend.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
==Contributeurs==&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: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding a model to the site part|Préc. : Ajout d&#039;un modèle à la partie site|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Using the database|Suiv. : Utilisation de la base de données|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;
[[Category:Joomla! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/10/fr&amp;diff=206332</id>
		<title>Translations:J3.x:Developing an MVC Component/Adding a variable request in the menu type/10/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/10/fr&amp;diff=206332"/>
		<updated>2015-07-20T08:05:26Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Vous pouvez tester l&amp;#039;affichage de cette variable en saisissant &amp;lt;tt&amp;gt;index.le php?option=com_helloworld&amp;amp;id=1&amp;lt;/tt&amp;gt; ou &amp;lt;tt&amp;gt;index. php?option=com_helloworld&amp;amp;id=2&amp;lt;/tt&amp;gt; dans la barre...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Vous pouvez tester l&#039;affichage de cette variable en saisissant &amp;lt;tt&amp;gt;index.le php?option=com_helloworld&amp;amp;id=1&amp;lt;/tt&amp;gt; ou &amp;lt;tt&amp;gt;index. php?option=com_helloworld&amp;amp;id=2&amp;lt;/tt&amp;gt; dans la barre d&#039;adresse de votre navigateur.&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/fr&amp;diff=206331</id>
		<title>J3.x:Developing an MVC Component/Adding a variable request in the menu type/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/fr&amp;diff=206331"/>
		<updated>2015-07-20T07:59:39Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Modifiez également votre fichier &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&amp;gt; afin d&amp;#039;indiquer une nouvelle version :&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;
{{:J3.1:Developing an MVC Component/fr}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
&lt;br /&gt;
== Ajout d&#039;une variable de demande dans le menu type ==&lt;br /&gt;
Pour le moment, le message affiché est toujours &amp;quot;Hello World!&amp;quot;. Joomla!2.5 donne la possibilité d&#039;ajouter des paramètres de types de menus. Dans notre cas, cela s&#039;effectue dans le fichier &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;6-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;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;id&amp;quot;&lt;br /&gt;
					type=&amp;quot;list&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
					default=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;Hello World!&amp;lt;/option&amp;gt;&lt;br /&gt;
                                &amp;lt;option value=&amp;quot;2&amp;quot;&amp;gt;Good bye World!&amp;lt;/option&amp;gt;&lt;br /&gt;
                        &amp;lt;/field&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deux choses importantes sont à noter :&lt;br /&gt;
* le &amp;quot;formulaire&amp;quot; groupe de champs indique les champs obligatoires.&lt;br /&gt;
* le nom de l&#039;attribut peut être transmis à la composante dans l&#039;URL. Dans ce cas &amp;lt;tt&amp;gt;?option=com_helloworld&amp;amp;id=1&amp;lt;/tt&amp;gt; indiquerait que vous avez choisi l&#039;option 1.&lt;br /&gt;
&lt;br /&gt;
Le modèle doit être modifié afin de permettre le choix entre les deux messages différents (ce choix s&#039;effectue par l&#039;utilisateur avec le champ défini ci-dessus):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;site/models/helloworld.php&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;33-45&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var string message&lt;br /&gt;
	 */&lt;br /&gt;
	protected $message;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 * @return  string  The message to be displayed to the user&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg()&lt;br /&gt;
	{&lt;br /&gt;
		if (!isset($this-&amp;gt;message))&lt;br /&gt;
		{&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&lt;br /&gt;
			switch ($id)&lt;br /&gt;
			{&lt;br /&gt;
				case 2:&lt;br /&gt;
					$this-&amp;gt;message = &#039;Good bye World!&#039;;&lt;br /&gt;
					break;&lt;br /&gt;
				default:&lt;br /&gt;
				case 1:&lt;br /&gt;
					$this-&amp;gt;message = &#039;Hello World!&#039;;&lt;br /&gt;
					break;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		return $this-&amp;gt;message;&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;
Modifiez également votre fichier &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&amp;gt; afin d&#039;indiquer une nouvelle version :&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.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.5&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can test this variable request by putting &amp;lt;tt&amp;gt;index.php?option=com_helloworld&amp;amp;id=1&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;index.php?option=com_helloworld&amp;amp;id=2&amp;lt;/tt&amp;gt; in your browser address.&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
Contenu de votre répertoire de code :&lt;br /&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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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/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;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-5-adding-a-menu-variable-request.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez ajouter un élément de menu pour ce composant à l&#039;aide du gestionnaire de menus dans le backend.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
==Contributeurs==&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: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding a model to the site part|Préc. : Ajout d&#039;un modèle à la partie site|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Using the database|Suiv. : Utilisation de la base de données|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;
[[Category:Joomla! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/9/fr&amp;diff=206330</id>
		<title>Translations:J3.x:Developing an MVC Component/Adding a variable request in the menu type/9/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/9/fr&amp;diff=206330"/>
		<updated>2015-07-20T07:59:39Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Modifiez également votre fichier &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&amp;gt; afin d&amp;#039;indiquer une nouvelle version :&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Modifiez également votre fichier &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&amp;gt; afin d&#039;indiquer une nouvelle version :&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/fr&amp;diff=206329</id>
		<title>J3.x:Developing an MVC Component/Adding a variable request in the menu type/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/fr&amp;diff=206329"/>
		<updated>2015-07-20T07:56:39Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Le modèle doit être modifié afin de permettre le choix entre les deux messages différents (ce choix s&amp;#039;effectue par l&amp;#039;utilisateur avec le champ défini ci-dessus):&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;
{{:J3.1:Developing an MVC Component/fr}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
&lt;br /&gt;
== Ajout d&#039;une variable de demande dans le menu type ==&lt;br /&gt;
Pour le moment, le message affiché est toujours &amp;quot;Hello World!&amp;quot;. Joomla!2.5 donne la possibilité d&#039;ajouter des paramètres de types de menus. Dans notre cas, cela s&#039;effectue dans le fichier &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;6-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;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;id&amp;quot;&lt;br /&gt;
					type=&amp;quot;list&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
					default=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;Hello World!&amp;lt;/option&amp;gt;&lt;br /&gt;
                                &amp;lt;option value=&amp;quot;2&amp;quot;&amp;gt;Good bye World!&amp;lt;/option&amp;gt;&lt;br /&gt;
                        &amp;lt;/field&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deux choses importantes sont à noter :&lt;br /&gt;
* le &amp;quot;formulaire&amp;quot; groupe de champs indique les champs obligatoires.&lt;br /&gt;
* le nom de l&#039;attribut peut être transmis à la composante dans l&#039;URL. Dans ce cas &amp;lt;tt&amp;gt;?option=com_helloworld&amp;amp;id=1&amp;lt;/tt&amp;gt; indiquerait que vous avez choisi l&#039;option 1.&lt;br /&gt;
&lt;br /&gt;
Le modèle doit être modifié afin de permettre le choix entre les deux messages différents (ce choix s&#039;effectue par l&#039;utilisateur avec le champ défini ci-dessus):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;site/models/helloworld.php&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;33-45&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var string message&lt;br /&gt;
	 */&lt;br /&gt;
	protected $message;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 * @return  string  The message to be displayed to the user&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg()&lt;br /&gt;
	{&lt;br /&gt;
		if (!isset($this-&amp;gt;message))&lt;br /&gt;
		{&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&lt;br /&gt;
			switch ($id)&lt;br /&gt;
			{&lt;br /&gt;
				case 2:&lt;br /&gt;
					$this-&amp;gt;message = &#039;Good bye World!&#039;;&lt;br /&gt;
					break;&lt;br /&gt;
				default:&lt;br /&gt;
				case 1:&lt;br /&gt;
					$this-&amp;gt;message = &#039;Hello World!&#039;;&lt;br /&gt;
					break;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		return $this-&amp;gt;message;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also modify your &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&amp;gt; file to indicate the new version:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&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.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.5&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can test this variable request by putting &amp;lt;tt&amp;gt;index.php?option=com_helloworld&amp;amp;id=1&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;index.php?option=com_helloworld&amp;amp;id=2&amp;lt;/tt&amp;gt; in your browser address.&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
Contenu de votre répertoire de code :&lt;br /&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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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/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;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-5-adding-a-menu-variable-request.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez ajouter un élément de menu pour ce composant à l&#039;aide du gestionnaire de menus dans le backend.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
==Contributeurs==&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: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding a model to the site part|Préc. : Ajout d&#039;un modèle à la partie site|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Using the database|Suiv. : Utilisation de la base de données|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;
[[Category:Joomla! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/8/fr&amp;diff=206328</id>
		<title>Translations:J3.x:Developing an MVC Component/Adding a variable request in the menu type/8/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/8/fr&amp;diff=206328"/>
		<updated>2015-07-20T07:56:39Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;Le modèle doit être modifié afin de permettre le choix entre les deux messages différents (ce choix s&amp;#039;effectue par l&amp;#039;utilisateur avec le champ défini ci-dessus):&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Le modèle doit être modifié afin de permettre le choix entre les deux messages différents (ce choix s&#039;effectue par l&#039;utilisateur avec le champ défini ci-dessus):&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/fr&amp;diff=206327</id>
		<title>J3.x:Developing an MVC Component/Adding a variable request in the menu type/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/fr&amp;diff=206327"/>
		<updated>2015-07-20T07:51:52Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;* le nom de l&amp;#039;attribut peut être transmis à la composante dans l&amp;#039;URL. Dans ce cas &amp;lt;tt&amp;gt;?option=com_helloworld&amp;amp;id=1&amp;lt;/tt&amp;gt; indiquerait que vous avez choisi l&amp;#039;option 1.&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;
{{:J3.1:Developing an MVC Component/fr}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Ce didacticiel fait partie de la série de didacticiels sur le  [[S:MyLanguage/J3.2:Developing an MVC Component|Développement d&#039;un Composant MVC pour Joomla! 3.x]]. Vous êtes invité à lire les articles précédents de cette série avant de lire celui-ci.&lt;br /&gt;
&lt;br /&gt;
== Ajout d&#039;une variable de demande dans le menu type ==&lt;br /&gt;
Pour le moment, le message affiché est toujours &amp;quot;Hello World!&amp;quot;. Joomla!2.5 donne la possibilité d&#039;ajouter des paramètres de types de menus. Dans notre cas, cela s&#039;effectue dans le fichier &amp;lt;tt&amp;gt;site/views/helloworld/tmpl/default.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/views/helloworld/tmpl/default.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; highlight=&amp;quot;6-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;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC&amp;lt;/message&amp;gt;&lt;br /&gt;
	&amp;lt;/layout&amp;gt;&lt;br /&gt;
	&amp;lt;fields name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;fieldset name=&amp;quot;request&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;field&lt;br /&gt;
					name=&amp;quot;id&amp;quot;&lt;br /&gt;
					type=&amp;quot;list&amp;quot;&lt;br /&gt;
					label=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;COM_HELLOWORLD_HELLOWORLD_FIELD_GREETING_DESC&amp;quot;&lt;br /&gt;
					default=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;Hello World!&amp;lt;/option&amp;gt;&lt;br /&gt;
                                &amp;lt;option value=&amp;quot;2&amp;quot;&amp;gt;Good bye World!&amp;lt;/option&amp;gt;&lt;br /&gt;
                        &amp;lt;/field&amp;gt;&lt;br /&gt;
		&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
	&amp;lt;/fields&amp;gt;&lt;br /&gt;
&amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deux choses importantes sont à noter :&lt;br /&gt;
* le &amp;quot;formulaire&amp;quot; groupe de champs indique les champs obligatoires.&lt;br /&gt;
* le nom de l&#039;attribut peut être transmis à la composante dans l&#039;URL. Dans ce cas &amp;lt;tt&amp;gt;?option=com_helloworld&amp;amp;id=1&amp;lt;/tt&amp;gt; indiquerait que vous avez choisi l&#039;option 1.&lt;br /&gt;
&lt;br /&gt;
The model has to be modified in order to switch between the two different messages (which is chosen by the user with the field defined above):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;site/models/helloworld.php&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot; highlight=&amp;quot;33-45&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package     Joomla.Administrator&lt;br /&gt;
 * @subpackage  com_helloworld&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license     GNU General Public License version 2 or later; see LICENSE.txt&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 *&lt;br /&gt;
 * @since  0.0.1&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var string message&lt;br /&gt;
	 */&lt;br /&gt;
	protected $message;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Get the message&lt;br /&gt;
	 * @return  string  The message to be displayed to the user&lt;br /&gt;
	 */&lt;br /&gt;
	public function getMsg()&lt;br /&gt;
	{&lt;br /&gt;
		if (!isset($this-&amp;gt;message))&lt;br /&gt;
		{&lt;br /&gt;
			$jinput = JFactory::getApplication()-&amp;gt;input;&lt;br /&gt;
			$id     = $jinput-&amp;gt;get(&#039;id&#039;, 1, &#039;INT&#039;);&lt;br /&gt;
&lt;br /&gt;
			switch ($id)&lt;br /&gt;
			{&lt;br /&gt;
				case 2:&lt;br /&gt;
					$this-&amp;gt;message = &#039;Good bye World!&#039;;&lt;br /&gt;
					break;&lt;br /&gt;
				default:&lt;br /&gt;
				case 1:&lt;br /&gt;
					$this-&amp;gt;message = &#039;Hello World!&#039;;&lt;br /&gt;
					break;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		return $this-&amp;gt;message;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also modify your &amp;lt;tt&amp;gt;helloworld.xml&amp;lt;/tt&amp;gt; file to indicate the new version:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&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.2.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;January 2014&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.5&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The description is optional and defaults to the name --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Description of the Hello World component ...&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;update&amp;gt; &amp;lt;!-- Runs on update; New since J2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu link=&#039;index.php?option=com_helloworld&#039;&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;/administration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can test this variable request by putting &amp;lt;tt&amp;gt;index.php?option=com_helloworld&amp;amp;id=1&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;index.php?option=com_helloworld&amp;amp;id=2&amp;lt;/tt&amp;gt; in your browser address.&lt;br /&gt;
&lt;br /&gt;
== Empaqueter le composant ==&lt;br /&gt;
Contenu de votre répertoire de code :&lt;br /&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;[[#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;[[#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|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[S:MyLanguage/J3.2:Developing_an_MVC_Component/Developing_a_Basic_Component#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#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/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;
&lt;br /&gt;
Créez un fichier compressé de ce répertoire ou téléchargez directement l&#039;[https://github.com/scionescire/Joomla-3.2-Hello-World-Component/archive/step-5-adding-a-menu-variable-request.zip archive] et installez-le en utilisant le gestionnaire des extensions Joomla. Vous pouvez ajouter un élément de menu pour ce composant à l&#039;aide du gestionnaire de menus dans le backend.&lt;br /&gt;
&lt;br /&gt;
{{notice|Merci de créer un pull request ou un rapport d&#039;anomalie sur https://github.com/joomla/Joomla-3.2-Hello-World-Component pour toute incohérence dans le code ou pour modifier le code source de cette page.}}&lt;br /&gt;
&lt;br /&gt;
==Contributeurs==&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: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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Adding a model to the site part|Préc. : Ajout d&#039;un modèle à la partie site|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|S:MyLanguage/J3.x:Developing_an_MVC_Component/Using the database|Suiv. : Utilisation de la base de données|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;
[[Category:Joomla! 3.x/fr|Joomla! 3.x]]&lt;br /&gt;
[[Category:Joomla! 3.0/fr|Joomla! 3.0]]&lt;br /&gt;
[[Category:Joomla! 3.1/fr|Joomla! 3.1]]&lt;br /&gt;
[[Category:Joomla! 3.2/fr|Joomla! 3.2]]&lt;br /&gt;
[[Category:Joomla! 3.3/fr|Joomla! 3.3]]&lt;br /&gt;
[[Category:Joomla! 3.4/fr|Joomla! 3.4]]&lt;br /&gt;
[[Category:Beginner Development/fr|Développement pour débutants]]&lt;br /&gt;
[[Category:Component Development/fr|Développement de composants]]&lt;br /&gt;
[[Category:Tutorials/fr|Didacticiels]]&lt;br /&gt;
[[Category:Tutorials in a Series/fr|Didacticiels en série]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/7/fr&amp;diff=206326</id>
		<title>Translations:J3.x:Developing an MVC Component/Adding a variable request in the menu type/7/fr</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Translations:J3.x:Developing_an_MVC_Component/Adding_a_variable_request_in_the_menu_type/7/fr&amp;diff=206326"/>
		<updated>2015-07-20T07:51:51Z</updated>

		<summary type="html">&lt;p&gt;Perete: Created page with &amp;quot;* le nom de l&amp;#039;attribut peut être transmis à la composante dans l&amp;#039;URL. Dans ce cas &amp;lt;tt&amp;gt;?option=com_helloworld&amp;amp;id=1&amp;lt;/tt&amp;gt; indiquerait que vous avez choisi l&amp;#039;option 1.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* le nom de l&#039;attribut peut être transmis à la composante dans l&#039;URL. Dans ce cas &amp;lt;tt&amp;gt;?option=com_helloworld&amp;amp;id=1&amp;lt;/tt&amp;gt; indiquerait que vous avez choisi l&#039;option 1.&lt;/div&gt;</summary>
		<author><name>Perete</name></author>
	</entry>
</feed>