<?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=Exps1</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=Exps1"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Exps1"/>
	<updated>2026-06-11T21:29:27Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Talk:Calendar_form_field_type&amp;diff=77577</id>
		<title>Talk:Calendar form field type</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Talk:Calendar_form_field_type&amp;diff=77577"/>
		<updated>2012-11-15T12:44:02Z</updated>

		<summary type="html">&lt;p&gt;Exps1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you need MM-DD-YYYY format create a new calendar type. In 2.5.8 setting format to %m-%d-%Y still throws fatal error.&lt;br /&gt;
&lt;br /&gt;
See long discussion here : http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;amp;tracker_id=8103&amp;amp;tracker_item_id=20826&lt;br /&gt;
&lt;br /&gt;
For my requirement the solution was to create a new type using jQuery UI datepicker. Lots of formatting options&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
/**&lt;br /&gt;
 * Resource Manager Extension&lt;br /&gt;
 * &lt;br /&gt;
 * @author Micah Fletcher&lt;br /&gt;
 * @copyright 2012 Extensible Point Solutions Inc. All Right Reserved&lt;br /&gt;
 * @license GNU GPL version 3, http://www.gnu.org/copyleft/gpl.html&lt;br /&gt;
 * @link http://www.exps.ca&lt;br /&gt;
 * @version 1.0.0&lt;br /&gt;
 * @since 2.5.6&lt;br /&gt;
 * */&lt;br /&gt;
jimport(&#039;joomla.form.formfield&#039;);&lt;br /&gt;
/**&lt;br /&gt;
 * Field JQuery UI DatePicker form field class&lt;br /&gt;
 */&lt;br /&gt;
class JFormFieldJuiDatePicker extends JFormField {&lt;br /&gt;
&lt;br /&gt;
  /**&lt;br /&gt;
   * field type&lt;br /&gt;
   * @var string&lt;br /&gt;
   */&lt;br /&gt;
  protected $type = &#039;JuiDatePicker&#039;;&lt;br /&gt;
&lt;br /&gt;
  /**&lt;br /&gt;
   * Method to get the field input markup&lt;br /&gt;
   */&lt;br /&gt;
  protected function getInput() {&lt;br /&gt;
&lt;br /&gt;
    //script in parent&lt;br /&gt;
&lt;br /&gt;
    $js = &#039;jQuery(function() {&lt;br /&gt;
&lt;br /&gt;
    jQuery(&amp;quot;#&#039;.$this-&amp;gt;id.&#039;&amp;quot;).datepicker({ &lt;br /&gt;
&lt;br /&gt;
      showButtonPanel: true,&lt;br /&gt;
      showOn: &amp;quot;both&amp;quot;,&lt;br /&gt;
      dateFormat: &amp;quot;&#039;.$this-&amp;gt;element[&#039;format&#039;].&#039;&amp;quot;,&lt;br /&gt;
      defaultDate: &amp;quot;&#039;.$this-&amp;gt;element[&#039;defaultDate&#039;].&#039;&amp;quot;,&lt;br /&gt;
      changeYear: true     &lt;br /&gt;
       });&lt;br /&gt;
});&#039;;&lt;br /&gt;
&lt;br /&gt;
    JFactory::getDocument()-&amp;gt;addScriptDeclaration($js);&lt;br /&gt;
&lt;br /&gt;
    // The input field&lt;br /&gt;
    // class=&#039;required&#039; for client side validation&lt;br /&gt;
    $class = &#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
    if ($this-&amp;gt;required) {&lt;br /&gt;
&lt;br /&gt;
        $class = &#039; class=&amp;quot;required&amp;quot;&#039;;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    $html = array();&lt;br /&gt;
    $html[] = &#039;&amp;lt;input &#039; . $class . &#039; type=&amp;quot;text&amp;quot; name=&amp;quot;&#039; . $this-&amp;gt;name . &#039;&amp;quot; id=&amp;quot;&#039; . $this-&amp;gt;id . &#039;&amp;quot; size=&amp;quot;30&amp;quot; value=&amp;quot;&#039; . $this-&amp;gt;value . &#039;&amp;quot; /&amp;gt;&#039;;&lt;br /&gt;
&lt;br /&gt;
    return implode(&amp;quot;\n&amp;quot;, $html);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Exps1</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Talk:Calendar_form_field_type&amp;diff=77556</id>
		<title>Talk:Calendar form field type</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Talk:Calendar_form_field_type&amp;diff=77556"/>
		<updated>2012-11-14T20:51:22Z</updated>

		<summary type="html">&lt;p&gt;Exps1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you need MM-DD-YYYY format create a new calendar type. In 2.5.8 setting format to %m-%d-%Y still throws fatal error.&lt;br /&gt;
&lt;br /&gt;
See long discussion here : http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;amp;tracker_id=8103&amp;amp;tracker_item_id=20826&lt;/div&gt;</summary>
		<author><name>Exps1</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Talk:Calendar_form_field_type&amp;diff=77544</id>
		<title>Talk:Calendar form field type</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Talk:Calendar_form_field_type&amp;diff=77544"/>
		<updated>2012-11-14T02:02:49Z</updated>

		<summary type="html">&lt;p&gt;Exps1: /* Work around for MM-DD-YYYY */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;it seems like the &#039;format&#039; uses the one from strftime, not date. Maybe it would be best to indeed change to date format anyway, but as it is, the documentation points to the wrong information&lt;br /&gt;
&lt;br /&gt;
== Work around for MM-DD-YYYY ==&lt;br /&gt;
&lt;br /&gt;
If you set the format to &amp;quot;%m-%d-%Y&amp;quot; the calendar formats dates correctly.&lt;br /&gt;
However, if you specify default=&amp;quot;NOW&amp;quot; a parse error is thrown like:&lt;br /&gt;
&lt;br /&gt;
DateTime::__construct() [datetime.--construct]: Failed to parse time string (11-13-2012) at position 0 (1): Unexpected character&lt;br /&gt;
&lt;br /&gt;
This seems to be because $this-&amp;gt;value must be in dd-mm-yyyy format.&lt;br /&gt;
&lt;br /&gt;
If you need to have MM-DD-YYYY format AND set the default date create a new calendar type and add:&lt;br /&gt;
&lt;br /&gt;
if($format == &amp;quot;%m-%d-%Y&amp;quot;){&lt;br /&gt;
   //put value in dd-mm-yyyy&lt;br /&gt;
   $tmp = explode(&amp;quot;-&amp;quot;, $this-&amp;gt;value);&lt;br /&gt;
      &lt;br /&gt;
   if($tmp){&lt;br /&gt;
     $this-&amp;gt;value = $tmp[1].&amp;quot;-&amp;quot;.$tmp[0].&amp;quot;-&amp;quot;.$tmp[2];&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Note: Have not tested when using filter.&lt;/div&gt;</summary>
		<author><name>Exps1</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Talk:Calendar_form_field_type&amp;diff=77543</id>
		<title>Talk:Calendar form field type</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Talk:Calendar_form_field_type&amp;diff=77543"/>
		<updated>2012-11-14T02:02:08Z</updated>

		<summary type="html">&lt;p&gt;Exps1: /* Work around for MM-DD-YYYY */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;it seems like the &#039;format&#039; uses the one from strftime, not date. Maybe it would be best to indeed change to date format anyway, but as it is, the documentation points to the wrong information&lt;br /&gt;
&lt;br /&gt;
== Work around for MM-DD-YYYY ==&lt;br /&gt;
&lt;br /&gt;
If you set the format to &amp;quot;%m-%d-%Y&amp;quot; the calendar formats dates correctly.&lt;br /&gt;
However, if you specify default=&amp;quot;NOW&amp;quot; a parse error is thrown like:&lt;br /&gt;
&lt;br /&gt;
DateTime::__construct() [datetime.--construct]: Failed to parse time string (11-13-2012) at position 0 (1): Unexpected character&lt;br /&gt;
&lt;br /&gt;
This seems to be because $this-&amp;gt;value must be in dd-mm-yyyy format.&lt;br /&gt;
&lt;br /&gt;
If you need to have MM-DD-YYYY format AND set the default date create a new calendar type and add:&lt;br /&gt;
&lt;br /&gt;
if($format == &amp;quot;%m-%d-%Y&amp;quot;){&lt;br /&gt;
   //put value in dd-mm-yyyy&lt;br /&gt;
   $tmp = explode(&amp;quot;-&amp;quot;, $this-&amp;gt;value);&lt;br /&gt;
      &lt;br /&gt;
   if($tmp){&lt;br /&gt;
     $this-&amp;gt;value = $tmp[1].&amp;quot;-&amp;quot;.$tmp[0].&amp;quot;-&amp;quot;.$tmp[2];&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Note: Have not test when using filter.&lt;/div&gt;</summary>
		<author><name>Exps1</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Talk:Search_Engine_Friendly_URLs&amp;diff=77468</id>
		<title>Talk:Search Engine Friendly URLs</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Talk:Search_Engine_Friendly_URLs&amp;diff=77468"/>
		<updated>2012-11-07T13:53:14Z</updated>

		<summary type="html">&lt;p&gt;Exps1: Created page with &amp;quot;JRouter class link http://docs.joomla.org/API16:JRouter&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;JRouter class link http://docs.joomla.org/API16:JRouter&lt;/div&gt;</summary>
		<author><name>Exps1</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Adding_an_install-uninstall-update_script_file&amp;diff=77281</id>
		<title>Archived talk:Developing a MVC Component/Adding an install-uninstall-update script file</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Adding_an_install-uninstall-update_script_file&amp;diff=77281"/>
		<updated>2012-10-30T16:02:58Z</updated>

		<summary type="html">&lt;p&gt;Exps1: /* Postflight - uninstall */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I vote for some additional code in the preflight method, since everybody should check against a suitable version prior to install. Here is the code from the v1.6 preflight method example. I will wait for a week, before adding it to the page. Maybe there are suggestions for V2.5, that should be merged into this code, before we publish it. &lt;br /&gt;
--[[User:Gorgonz|gorgonz]] 06:05, 26 May 2012 (CDT)&lt;br /&gt;
&lt;br /&gt;
First we must add some private members to the com_helloWorldInstallerScript class&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
	/*&lt;br /&gt;
	 * The release value to be displayed and checked against throughout this file.&lt;br /&gt;
	 */&lt;br /&gt;
	private $release = &#039;1.0&#039;;&lt;br /&gt;
 &lt;br /&gt;
        /*&lt;br /&gt;
         * Find mimimum required joomla version for this extension. It will be read from the version attribute (install tag) in the manifest file&lt;br /&gt;
         */&lt;br /&gt;
        private $minimum_joomla_release = &#039;2.5.0&#039;;    &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here is the implementation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	/*&lt;br /&gt;
	 * $parent is the class calling this method.&lt;br /&gt;
	 * $type is the type of change (install, update or discover_install, not uninstall).&lt;br /&gt;
	 * preflight runs before anything else and while the extracted files are in the uploaded temp folder.&lt;br /&gt;
	 * If preflight returns false, Joomla will abort the update and undo everything already done.&lt;br /&gt;
	 */&lt;br /&gt;
	function preflight( $type, $parent ) {&lt;br /&gt;
&lt;br /&gt;
		// this component does not work with Joomla releases prior to 2.5&lt;br /&gt;
		// abort if the current Joomla release is older&lt;br /&gt;
		$jversion = new JVersion();&lt;br /&gt;
 &lt;br /&gt;
                // Extract the version number from the manifest. This will overwrite the 1.0 value set above &lt;br /&gt;
                $this-&amp;gt;release=$parent-&amp;gt;get(&amp;quot;manifest&amp;quot;)-&amp;gt;version;&lt;br /&gt;
 &lt;br /&gt;
                // Find mimimum required joomla version&lt;br /&gt;
                $this-&amp;gt;minimum_joomla_release=$parent-&amp;gt;get(&amp;quot;manifest&amp;quot;)-&amp;gt;attributes()-&amp;gt;version;    &lt;br /&gt;
 &lt;br /&gt;
		if( version_compare( $jversion-&amp;gt;getShortVersion(), $this-&amp;gt;minimum_joomla_release, &#039;lt&#039; ) ) {&lt;br /&gt;
			Jerror::raiseWarning(null, &#039;Cannot install com_helloWorld update in a Joomla release prior to &#039;.$this-&amp;gt;minimum_joomla_release);&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
 &lt;br /&gt;
		// abort if the component being installed is not newer than the currently installed version&lt;br /&gt;
		if ( $type == &#039;update&#039; ) {&lt;br /&gt;
			$oldRelease = $this-&amp;gt;getParam(&#039;version&#039;);&lt;br /&gt;
			$rel = $oldRelease . &#039; to &#039; . $this-&amp;gt;release;&lt;br /&gt;
			if ( version_compare( $this-&amp;gt;release, $oldRelease, &#039;le&#039; ) ) {&lt;br /&gt;
				Jerror::raiseWarning(null, &#039;Incorrect version sequence. Cannot upgrade &#039; . $rel);&lt;br /&gt;
				return false;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		else { $rel = $this-&amp;gt;release; }&lt;br /&gt;
 &lt;br /&gt;
		echo &#039;&amp;lt;p&amp;gt;&#039; . JText::_(&#039;COM_HELLOWORLD_UPDATE_PREFLIGHT_&#039; . $type . &#039; &#039; . $rel) . &#039;&amp;lt;/p&amp;gt;&#039;;&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Postflight - uninstall ==&lt;br /&gt;
&lt;br /&gt;
Testing in joomla 2.5.7 it seems that postflight does not handle &amp;quot;uninstall&amp;quot; as indicated here.&lt;br /&gt;
This doc: http://docs.joomla.org/Managing_Component_Updates_with_Joomla!1.6_-_Part_3&lt;br /&gt;
seems to have the correct definition of postflight.&lt;br /&gt;
&lt;br /&gt;
Should we update the article?&lt;/div&gt;</summary>
		<author><name>Exps1</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:Rvsjoen/tutorial/Developing_a_Module/Part_06&amp;diff=67255</id>
		<title>User:Rvsjoen/tutorial/Developing a Module/Part 06</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:Rvsjoen/tutorial/Developing_a_Module/Part_06&amp;diff=67255"/>
		<updated>2012-05-16T15:43:42Z</updated>

		<summary type="html">&lt;p&gt;Exps1: Added language file to manifest, previous entry just copies language folder to module&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Accessing the database =&lt;br /&gt;
&lt;br /&gt;
This part is meant to provide you with a short example on how to access the database and run a query from a module. This is no different than running a query anywhere else in Joomla! but since modules are often the first place you start to learn to write extensions, this tutorial seems like a natural place to cover it.&lt;br /&gt;
&lt;br /&gt;
With your favorite editor, edit the following file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helper.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;tt&amp;gt;helper.php&amp;lt;/tt&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php &lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package	Joomla.Tutorials&lt;br /&gt;
 * @subpackage	Module&lt;br /&gt;
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license	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;&lt;br /&gt;
&lt;br /&gt;
class modHelloWorldHelper&lt;br /&gt;
{&lt;br /&gt;
	public static function getGreeting() {&lt;br /&gt;
		return &amp;quot;Message from the helper&amp;quot;;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public static function getCurrentUsers() {&lt;br /&gt;
		$db = JFactory::getDBO();&lt;br /&gt;
		$db-&amp;gt;setQuery($db-&amp;gt;getQuery(true)&lt;br /&gt;
			-&amp;gt;select(&amp;quot;COUNT(*) as users&amp;quot;)&lt;br /&gt;
			-&amp;gt;from(&amp;quot;#__session&amp;quot;)&lt;br /&gt;
		);&lt;br /&gt;
		return $db-&amp;gt;loadResult();&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;
Here we add a function to our helper class, the function will simply return the number of currently active sessions by counting the number of rows in the session table.&lt;br /&gt;
&lt;br /&gt;
With your favorite editor, edit the following file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;tmpl/default.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;tt&amp;gt;tmpl/default.php&amp;lt;/tt&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php &lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * @package	Joomla.Tutorials&lt;br /&gt;
 * @subpackage	Module&lt;br /&gt;
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.&lt;br /&gt;
 * @license	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;&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;?php echo $params-&amp;gt;get(&#039;greeting&#039;, JText::_(&#039;MOD_HELLOWORLD_GREETING_DEFAULT&#039;)); ?&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;?php echo modHelloWorldHelper::getGreeting(); ?&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;There are &amp;lt;?php echo modHelloWorldHelper::getCurrentUsers(); ?&amp;gt; user(s) logged in&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we modify the module template to echo out the number of currently active users, as provided by our helper.&lt;br /&gt;
&lt;br /&gt;
With your favorite editor, edit the following file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;mod_helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;tt&amp;gt;mod_helloworld.xml&amp;lt;/tt&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;module&amp;quot; version=&amp;quot;2.5.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;MOD_HELLOWORLD&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;Once upon a time&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 stored in the extension 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;MOD_HELLOWORLD_XML_DESCRIPTION&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes what to copy&lt;br /&gt;
		into the module folder --&amp;gt;&lt;br /&gt;
	&amp;lt;files&amp;gt;&lt;br /&gt;
		&amp;lt;filename module=&amp;quot;mod_helloworld&amp;quot;&amp;gt;mod_helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;mod_helloworld.xml&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helper.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;tmpl&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
        &amp;lt;languages folder=&amp;quot;language&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB/en-GB.mod_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB/en-GB.mod_helloworld.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
	&amp;lt;/languages&amp;gt;&lt;br /&gt;
	&amp;lt;config&amp;gt;&lt;br /&gt;
		&amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;field&lt;br /&gt;
					name=&amp;quot;greeting&amp;quot;&lt;br /&gt;
					type=&amp;quot;text&amp;quot;&lt;br /&gt;
					default=&amp;quot;MOD_HELLOWORLD_GREETING_DEFAULT&amp;quot;&lt;br /&gt;
					label=&amp;quot;MOD_HELLOWORLD_GREETING_LABEL&amp;quot;&lt;br /&gt;
					description=&amp;quot;MOD_HELLOWORLD_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;/config&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;
== File listing == &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[#mod_helloworld.xml|mod_helloworld.xml]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[User:Rvsjoen/tutorial/Developing_a_Module/Part_05#mod_helloworld.php|mod_helloworld.php]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[#tmpl/default.php|tmpl/default.php]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[User:Rvsjoen/tutorial/Developing_a_Module/Part_04#language/en-GB.mod_helloworld.ini|language/en-GB.mod_helloworld.ini]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[User:Rvsjoen/tutorial/Developing_a_Module/Part_04#language/en-GB.mod_helloworld.sys.ini|language/en-GB.mod_helloworld.sys.ini]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;[[#helper.php|helper.php]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing your module ==&lt;br /&gt;
&lt;br /&gt;
For details on how to install the module into your Joomla! site, refer to the information provided in&lt;br /&gt;
[[User:Rvsjoen/tutorial/Developing_a_Module/Part_01#Installation_and_Testing|Part 01]].&lt;br /&gt;
&lt;br /&gt;
== Download this part ==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/downloads/rvsjoen/joomla-tutorials/mod_helloworld-part06.zip Download example package]&lt;br /&gt;
&lt;br /&gt;
{{:Chunks:Developing_a_Module_Contents}}&lt;/div&gt;</summary>
		<author><name>Exps1</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Adding_categories&amp;diff=61178</id>
		<title>Archived talk:Developing a MVC Component/Adding categories</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Adding_categories&amp;diff=61178"/>
		<updated>2011-08-04T12:05:26Z</updated>

		<summary type="html">&lt;p&gt;Exps1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Why     $query = new JDatabaseQuery;&lt;br /&gt;
but not $query = &amp;amp;new JDatabaseQuery; ?&lt;br /&gt;
&lt;br /&gt;
In ../models/fields/helloworld.php on line 29&lt;br /&gt;
&lt;br /&gt;
If you use the line, $query = new JDatabaseQuery;, component works, but when helloworlds is added as menu item it causes the following error when item is clicked:&lt;br /&gt;
&lt;br /&gt;
Fatal error: Cannot instantiate abstract class JDatabaseQuery in C:\xampp\htdocs\test_site\administrator\components\com_helloworld\models\fields\helloworld.php on line 29&lt;br /&gt;
&lt;br /&gt;
Reverting back to code from part 11, $query = $db-&amp;gt;getQuery(true);, does not throw error.&lt;br /&gt;
&lt;br /&gt;
Just an observation.&lt;/div&gt;</summary>
		<author><name>Exps1</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Component_parameters&amp;diff=15941</id>
		<title>J1.5 talk:Component parameters</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Component_parameters&amp;diff=15941"/>
		<updated>2009-10-16T13:19:17Z</updated>

		<summary type="html">&lt;p&gt;Exps1: /* Setting  in XML Installer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I find the terms &amp;quot;frontend&amp;quot; and &amp;quot;backend&amp;quot; confusing when applied in this context.&lt;br /&gt;
&lt;br /&gt;
also, links to the standard parameter types would be extremely useful.&lt;br /&gt;
http://docs.joomla.org/Standard_parameter_types&lt;br /&gt;
&lt;br /&gt;
Overall, I found the article extremely useful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Commercemeister, thanks for your comments.  Could you please explain what you find confusing about frontend and backend?  They are commonly used to refer to the main site and the administration parts of a Joomla! website, respectively.  It would be helpful to know how you think they should be clarified (or you could even just do it yourself - that&#039;s the beauty of a wiki!).  Thanks too for the note about parameter types - the article did originally link to a page with this information, but then that page was changed.  I will update it.&lt;br /&gt;
&lt;br /&gt;
One final point - please sign your comments using the four tildes at the end (&amp;lt;nowiki&amp;gt;~~~~&amp;lt;/nowiki&amp;gt;).  Thanks, [[User:Mike dowler|Mike]] 16:18, 3 September 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
I&#039;m confused about the differences between the types of parameters.&lt;br /&gt;
So you&#039;ve got Parameters (Basic), (Advanced), (Component) and (System).&lt;br /&gt;
&lt;br /&gt;
Now what kind of parameters would you put in (basic) and what in (component) if both can be overriden in the menu you create for the component ?&lt;br /&gt;
I just don&#039;t see the distinction between the two...&lt;br /&gt;
[[User:Alfred|Alfred]] 14:12, 25 September 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
Alfred,  &#039;Basic&#039; and &#039;Advanced&#039; parameters are just &#039;article-specific&#039; parameters - the only difference between &#039;basic&#039; and &#039;advanced&#039; is in how they are displayed in the back end.  &#039;Article-specific&#039; parameters are those that are only ever going to apply to that article, whereas &#039;Component&#039; parameters are set for the component as a whole. As you point out, both types can be overridden for a particular menu link;  administrators using your component will thank you if such overrides are the exception rather than the rule!&lt;br /&gt;
&lt;br /&gt;
So, in the screenshot shown, there is the basic parameter &#039;Description text&#039; field which (IIRC) provides a description of the article.  It would make no sense to have this as a component parameter, since you would need to override it almost every time you use it.  Note that there is no &#039;right&#039; or &#039;wrong&#039; here, just common sense.  If a parameter is likely to be the same across the site (e.g. choosing whether or not to display the name of the author, which is likely to be fixed to maintain a consistent feel to a site), then put it in the component params.  If it&#039;s likely to change in each case, make it an article param.  If both would be useful, then use both. (Just make sure that you give the article param a &#039;Use global&#039; (i.e. empty string) option as default, so that the component parameter works as expected.) [[User:Mike dowler|Mike]] 18:23, 28 October 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Component level params must be saved before they show up ==&lt;br /&gt;
&lt;br /&gt;
I&#039;ve seen this effect in several extensions, and it was very confusing and not obvious at first. Perhaps a note can be added.  The issue is that the default params for the component, usually accessed by &amp;quot;Preferences&amp;quot; may not have been actually entered into the database.&lt;br /&gt;
&lt;br /&gt;
It would be nice to just have a note, especially in the overrides section, that you need to make sure the component params are actually saved.  It would also be nice if 3rd party components that use these config params either place a notice to the user that params must be saved, or make sure that the default params are entered into the database during the installation process, if these params do not yet exist.&lt;br /&gt;
&lt;br /&gt;
Hope this makes some sense.  I&#039;m not really sure the best solution to this problem, but more documentation about this potential pitfall I&#039;m sure would be helpful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Snellcode, good point.  Tbh, I think the whole parameters subject is a little difficult to get hold of - my main reason for writing this was so that I could get everything straight in my own head.  The way it &#039;&#039;should&#039;&#039; work is that the &amp;lt;code&amp;gt;COMPONENT_NAME.xml&amp;lt;/code&amp;gt; installation file creates the parameters in the database, so that the component defaults are already set.  If this is &#039;&#039;&#039;not&#039;&#039;&#039; done, then you are right - it is necessary to open the &#039;parameters&#039; window, choose the values, and save, so that the parameters are created.  The wrong way to do things, which may be what is going on, is to try to combine both steps (ignoring the installation file) and give the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; values.  These will show up in the parameters window, but do not appear in the database until they are saved.  The article does kind of refer to this, but I will think about how to make it more explicit.  &lt;br /&gt;
&lt;br /&gt;
You could try point the 3PDs to this article, or simply vote with your feet and use a different extension!   [[User:Mike dowler|Mike]] 21:36, 17 February 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Referencing the parameters XML file in the install file ==&lt;br /&gt;
I have deleted Jmgonet&#039;s paragraph about adding a reference to the install file, as I think it is outside the scope of this article (which tbh is already complicated enough!)  The article is aimed at those developing components, who should be aware of the need to ensure that all necessary files are installed (covered adequately elsewhere).  In any case, the best option is to use a &amp;lt;code&amp;gt;&amp;lt;folder /&amp;gt;&amp;lt;/code&amp;gt; tag in the install file, rather than lots of &amp;lt;code&amp;gt;&amp;lt;filename /&amp;gt;&amp;lt;/code&amp;gt; tags; that way, there is no need to list every single file, and less risk of a file being missed.  Hope that&#039;s ok!  [[User:Mike dowler|Mike]] 21:54, 17 February 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Example Code ==&lt;br /&gt;
&lt;br /&gt;
I am trying to understand all of what has been said on this page. I have a background in php but haven&#039;t programmed for years.&lt;br /&gt;
&lt;br /&gt;
It would really help me if a example component was made and offered up as a zip file. Something just VERY simple, it wouldn&#039;t even need to fulfill a any kind of function. Just show me a working example without all the other stuff. It would not even need to show everything talked about on the page, just the common stuff. After people have the basics, I am sure they could understand your article without an working example.&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
&lt;br /&gt;
Dr. Sassafras&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
One more note about the install.&lt;br /&gt;
&lt;br /&gt;
I now understand by reading the discussion, but it would be nice somewhere in the article if it said that loading the settings was not NECESSARY in the install. It was unclear to me when the install was mentioned if I had to include it in the install, and go through a install for any of what was being said to work.&lt;br /&gt;
&lt;br /&gt;
I know these might be very basic concepts. But thats where I am right now. You have to start somewhere.&lt;br /&gt;
&lt;br /&gt;
Dr. Sassafras&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;In an MVC structure, this code would be placed in the view.html.php file for the particular view required.&lt;br /&gt;
&lt;br /&gt;
Assuming that the item parameters are stored in the params field, and that the particular item has been loaded into the $row object by the method, you would then add in the item parameters to the $params object using:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please give an example of this. Don&#039;t know what you are talking about. I don&#039;t see the an example of how to load the $row ether.&lt;br /&gt;
&lt;br /&gt;
I have been able to get global preferences set, but don&#039;t have enough info override the globals with page specific ones.&lt;br /&gt;
&lt;br /&gt;
[[User:Drsassafras|Drsassafras]] 20:16, 21 March 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Setting &amp;lt;params&amp;gt; in XML Installer ==&lt;br /&gt;
&lt;br /&gt;
There is an issue with using the XML installer file to set params field values in jos_component.&lt;br /&gt;
See: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;amp;tracker_item_id=17767&lt;br /&gt;
&lt;br /&gt;
Including the following code in the XML install file has no affect - db field params remains empty until users saves config in view.&lt;br /&gt;
&amp;lt;install&amp;gt;&lt;br /&gt;
..&lt;br /&gt;
&amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param name=&amp;quot;foo&amp;quot; default=&amp;quot;bar&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/params&amp;gt;&lt;br /&gt;
..&lt;br /&gt;
&amp;lt;/install&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[User:Exps1|Exps1]] 12:54, 16 October 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Exps1</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Component_parameters&amp;diff=15940</id>
		<title>J1.5 talk:Component parameters</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Component_parameters&amp;diff=15940"/>
		<updated>2009-10-16T13:01:59Z</updated>

		<summary type="html">&lt;p&gt;Exps1: /* Setting  in XML Installer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I find the terms &amp;quot;frontend&amp;quot; and &amp;quot;backend&amp;quot; confusing when applied in this context.&lt;br /&gt;
&lt;br /&gt;
also, links to the standard parameter types would be extremely useful.&lt;br /&gt;
http://docs.joomla.org/Standard_parameter_types&lt;br /&gt;
&lt;br /&gt;
Overall, I found the article extremely useful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Commercemeister, thanks for your comments.  Could you please explain what you find confusing about frontend and backend?  They are commonly used to refer to the main site and the administration parts of a Joomla! website, respectively.  It would be helpful to know how you think they should be clarified (or you could even just do it yourself - that&#039;s the beauty of a wiki!).  Thanks too for the note about parameter types - the article did originally link to a page with this information, but then that page was changed.  I will update it.&lt;br /&gt;
&lt;br /&gt;
One final point - please sign your comments using the four tildes at the end (&amp;lt;nowiki&amp;gt;~~~~&amp;lt;/nowiki&amp;gt;).  Thanks, [[User:Mike dowler|Mike]] 16:18, 3 September 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
I&#039;m confused about the differences between the types of parameters.&lt;br /&gt;
So you&#039;ve got Parameters (Basic), (Advanced), (Component) and (System).&lt;br /&gt;
&lt;br /&gt;
Now what kind of parameters would you put in (basic) and what in (component) if both can be overriden in the menu you create for the component ?&lt;br /&gt;
I just don&#039;t see the distinction between the two...&lt;br /&gt;
[[User:Alfred|Alfred]] 14:12, 25 September 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
Alfred,  &#039;Basic&#039; and &#039;Advanced&#039; parameters are just &#039;article-specific&#039; parameters - the only difference between &#039;basic&#039; and &#039;advanced&#039; is in how they are displayed in the back end.  &#039;Article-specific&#039; parameters are those that are only ever going to apply to that article, whereas &#039;Component&#039; parameters are set for the component as a whole. As you point out, both types can be overridden for a particular menu link;  administrators using your component will thank you if such overrides are the exception rather than the rule!&lt;br /&gt;
&lt;br /&gt;
So, in the screenshot shown, there is the basic parameter &#039;Description text&#039; field which (IIRC) provides a description of the article.  It would make no sense to have this as a component parameter, since you would need to override it almost every time you use it.  Note that there is no &#039;right&#039; or &#039;wrong&#039; here, just common sense.  If a parameter is likely to be the same across the site (e.g. choosing whether or not to display the name of the author, which is likely to be fixed to maintain a consistent feel to a site), then put it in the component params.  If it&#039;s likely to change in each case, make it an article param.  If both would be useful, then use both. (Just make sure that you give the article param a &#039;Use global&#039; (i.e. empty string) option as default, so that the component parameter works as expected.) [[User:Mike dowler|Mike]] 18:23, 28 October 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Component level params must be saved before they show up ==&lt;br /&gt;
&lt;br /&gt;
I&#039;ve seen this effect in several extensions, and it was very confusing and not obvious at first. Perhaps a note can be added.  The issue is that the default params for the component, usually accessed by &amp;quot;Preferences&amp;quot; may not have been actually entered into the database.&lt;br /&gt;
&lt;br /&gt;
It would be nice to just have a note, especially in the overrides section, that you need to make sure the component params are actually saved.  It would also be nice if 3rd party components that use these config params either place a notice to the user that params must be saved, or make sure that the default params are entered into the database during the installation process, if these params do not yet exist.&lt;br /&gt;
&lt;br /&gt;
Hope this makes some sense.  I&#039;m not really sure the best solution to this problem, but more documentation about this potential pitfall I&#039;m sure would be helpful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Snellcode, good point.  Tbh, I think the whole parameters subject is a little difficult to get hold of - my main reason for writing this was so that I could get everything straight in my own head.  The way it &#039;&#039;should&#039;&#039; work is that the &amp;lt;code&amp;gt;COMPONENT_NAME.xml&amp;lt;/code&amp;gt; installation file creates the parameters in the database, so that the component defaults are already set.  If this is &#039;&#039;&#039;not&#039;&#039;&#039; done, then you are right - it is necessary to open the &#039;parameters&#039; window, choose the values, and save, so that the parameters are created.  The wrong way to do things, which may be what is going on, is to try to combine both steps (ignoring the installation file) and give the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; values.  These will show up in the parameters window, but do not appear in the database until they are saved.  The article does kind of refer to this, but I will think about how to make it more explicit.  &lt;br /&gt;
&lt;br /&gt;
You could try point the 3PDs to this article, or simply vote with your feet and use a different extension!   [[User:Mike dowler|Mike]] 21:36, 17 February 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Referencing the parameters XML file in the install file ==&lt;br /&gt;
I have deleted Jmgonet&#039;s paragraph about adding a reference to the install file, as I think it is outside the scope of this article (which tbh is already complicated enough!)  The article is aimed at those developing components, who should be aware of the need to ensure that all necessary files are installed (covered adequately elsewhere).  In any case, the best option is to use a &amp;lt;code&amp;gt;&amp;lt;folder /&amp;gt;&amp;lt;/code&amp;gt; tag in the install file, rather than lots of &amp;lt;code&amp;gt;&amp;lt;filename /&amp;gt;&amp;lt;/code&amp;gt; tags; that way, there is no need to list every single file, and less risk of a file being missed.  Hope that&#039;s ok!  [[User:Mike dowler|Mike]] 21:54, 17 February 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Example Code ==&lt;br /&gt;
&lt;br /&gt;
I am trying to understand all of what has been said on this page. I have a background in php but haven&#039;t programmed for years.&lt;br /&gt;
&lt;br /&gt;
It would really help me if a example component was made and offered up as a zip file. Something just VERY simple, it wouldn&#039;t even need to fulfill a any kind of function. Just show me a working example without all the other stuff. It would not even need to show everything talked about on the page, just the common stuff. After people have the basics, I am sure they could understand your article without an working example.&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
&lt;br /&gt;
Dr. Sassafras&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
One more note about the install.&lt;br /&gt;
&lt;br /&gt;
I now understand by reading the discussion, but it would be nice somewhere in the article if it said that loading the settings was not NECESSARY in the install. It was unclear to me when the install was mentioned if I had to include it in the install, and go through a install for any of what was being said to work.&lt;br /&gt;
&lt;br /&gt;
I know these might be very basic concepts. But thats where I am right now. You have to start somewhere.&lt;br /&gt;
&lt;br /&gt;
Dr. Sassafras&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;In an MVC structure, this code would be placed in the view.html.php file for the particular view required.&lt;br /&gt;
&lt;br /&gt;
Assuming that the item parameters are stored in the params field, and that the particular item has been loaded into the $row object by the method, you would then add in the item parameters to the $params object using:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please give an example of this. Don&#039;t know what you are talking about. I don&#039;t see the an example of how to load the $row ether.&lt;br /&gt;
&lt;br /&gt;
I have been able to get global preferences set, but don&#039;t have enough info override the globals with page specific ones.&lt;br /&gt;
&lt;br /&gt;
[[User:Drsassafras|Drsassafras]] 20:16, 21 March 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Setting &amp;lt;params&amp;gt; in XML Installer ==&lt;br /&gt;
&lt;br /&gt;
There is an issue with using the XML installer file to set params field values in jos_component.&lt;br /&gt;
See: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;amp;tracker_item_id=17767&lt;br /&gt;
&lt;br /&gt;
Including the following code in the XML install file has no affect - db field params remains empty until users saves config in view.&lt;br /&gt;
&amp;lt;install&amp;gt;&lt;br /&gt;
..&lt;br /&gt;
&amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param name=&amp;quot;foo&amp;quot; default=&amp;quot;bar&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/params&amp;gt;&lt;br /&gt;
..&lt;br /&gt;
&amp;lt;/install&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values can be set at install time by adding UPDATE statement for params in jos_component in the install.sql file.&lt;br /&gt;
&lt;br /&gt;
[[User:Exps1|Exps1]] 12:54, 16 October 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Exps1</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Component_parameters&amp;diff=15939</id>
		<title>J1.5 talk:Component parameters</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Component_parameters&amp;diff=15939"/>
		<updated>2009-10-16T12:54:41Z</updated>

		<summary type="html">&lt;p&gt;Exps1: /* Setting  in XML Installer */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I find the terms &amp;quot;frontend&amp;quot; and &amp;quot;backend&amp;quot; confusing when applied in this context.&lt;br /&gt;
&lt;br /&gt;
also, links to the standard parameter types would be extremely useful.&lt;br /&gt;
http://docs.joomla.org/Standard_parameter_types&lt;br /&gt;
&lt;br /&gt;
Overall, I found the article extremely useful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Commercemeister, thanks for your comments.  Could you please explain what you find confusing about frontend and backend?  They are commonly used to refer to the main site and the administration parts of a Joomla! website, respectively.  It would be helpful to know how you think they should be clarified (or you could even just do it yourself - that&#039;s the beauty of a wiki!).  Thanks too for the note about parameter types - the article did originally link to a page with this information, but then that page was changed.  I will update it.&lt;br /&gt;
&lt;br /&gt;
One final point - please sign your comments using the four tildes at the end (&amp;lt;nowiki&amp;gt;~~~~&amp;lt;/nowiki&amp;gt;).  Thanks, [[User:Mike dowler|Mike]] 16:18, 3 September 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
I&#039;m confused about the differences between the types of parameters.&lt;br /&gt;
So you&#039;ve got Parameters (Basic), (Advanced), (Component) and (System).&lt;br /&gt;
&lt;br /&gt;
Now what kind of parameters would you put in (basic) and what in (component) if both can be overriden in the menu you create for the component ?&lt;br /&gt;
I just don&#039;t see the distinction between the two...&lt;br /&gt;
[[User:Alfred|Alfred]] 14:12, 25 September 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
Alfred,  &#039;Basic&#039; and &#039;Advanced&#039; parameters are just &#039;article-specific&#039; parameters - the only difference between &#039;basic&#039; and &#039;advanced&#039; is in how they are displayed in the back end.  &#039;Article-specific&#039; parameters are those that are only ever going to apply to that article, whereas &#039;Component&#039; parameters are set for the component as a whole. As you point out, both types can be overridden for a particular menu link;  administrators using your component will thank you if such overrides are the exception rather than the rule!&lt;br /&gt;
&lt;br /&gt;
So, in the screenshot shown, there is the basic parameter &#039;Description text&#039; field which (IIRC) provides a description of the article.  It would make no sense to have this as a component parameter, since you would need to override it almost every time you use it.  Note that there is no &#039;right&#039; or &#039;wrong&#039; here, just common sense.  If a parameter is likely to be the same across the site (e.g. choosing whether or not to display the name of the author, which is likely to be fixed to maintain a consistent feel to a site), then put it in the component params.  If it&#039;s likely to change in each case, make it an article param.  If both would be useful, then use both. (Just make sure that you give the article param a &#039;Use global&#039; (i.e. empty string) option as default, so that the component parameter works as expected.) [[User:Mike dowler|Mike]] 18:23, 28 October 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Component level params must be saved before they show up ==&lt;br /&gt;
&lt;br /&gt;
I&#039;ve seen this effect in several extensions, and it was very confusing and not obvious at first. Perhaps a note can be added.  The issue is that the default params for the component, usually accessed by &amp;quot;Preferences&amp;quot; may not have been actually entered into the database.&lt;br /&gt;
&lt;br /&gt;
It would be nice to just have a note, especially in the overrides section, that you need to make sure the component params are actually saved.  It would also be nice if 3rd party components that use these config params either place a notice to the user that params must be saved, or make sure that the default params are entered into the database during the installation process, if these params do not yet exist.&lt;br /&gt;
&lt;br /&gt;
Hope this makes some sense.  I&#039;m not really sure the best solution to this problem, but more documentation about this potential pitfall I&#039;m sure would be helpful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Snellcode, good point.  Tbh, I think the whole parameters subject is a little difficult to get hold of - my main reason for writing this was so that I could get everything straight in my own head.  The way it &#039;&#039;should&#039;&#039; work is that the &amp;lt;code&amp;gt;COMPONENT_NAME.xml&amp;lt;/code&amp;gt; installation file creates the parameters in the database, so that the component defaults are already set.  If this is &#039;&#039;&#039;not&#039;&#039;&#039; done, then you are right - it is necessary to open the &#039;parameters&#039; window, choose the values, and save, so that the parameters are created.  The wrong way to do things, which may be what is going on, is to try to combine both steps (ignoring the installation file) and give the &amp;lt;code&amp;gt;&amp;lt;param /&amp;gt;&amp;lt;/code&amp;gt; elements in the &amp;lt;code&amp;gt;config.xml&amp;lt;/code&amp;gt; file &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; values.  These will show up in the parameters window, but do not appear in the database until they are saved.  The article does kind of refer to this, but I will think about how to make it more explicit.  &lt;br /&gt;
&lt;br /&gt;
You could try point the 3PDs to this article, or simply vote with your feet and use a different extension!   [[User:Mike dowler|Mike]] 21:36, 17 February 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Referencing the parameters XML file in the install file ==&lt;br /&gt;
I have deleted Jmgonet&#039;s paragraph about adding a reference to the install file, as I think it is outside the scope of this article (which tbh is already complicated enough!)  The article is aimed at those developing components, who should be aware of the need to ensure that all necessary files are installed (covered adequately elsewhere).  In any case, the best option is to use a &amp;lt;code&amp;gt;&amp;lt;folder /&amp;gt;&amp;lt;/code&amp;gt; tag in the install file, rather than lots of &amp;lt;code&amp;gt;&amp;lt;filename /&amp;gt;&amp;lt;/code&amp;gt; tags; that way, there is no need to list every single file, and less risk of a file being missed.  Hope that&#039;s ok!  [[User:Mike dowler|Mike]] 21:54, 17 February 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Example Code ==&lt;br /&gt;
&lt;br /&gt;
I am trying to understand all of what has been said on this page. I have a background in php but haven&#039;t programmed for years.&lt;br /&gt;
&lt;br /&gt;
It would really help me if a example component was made and offered up as a zip file. Something just VERY simple, it wouldn&#039;t even need to fulfill a any kind of function. Just show me a working example without all the other stuff. It would not even need to show everything talked about on the page, just the common stuff. After people have the basics, I am sure they could understand your article without an working example.&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
&lt;br /&gt;
Dr. Sassafras&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
One more note about the install.&lt;br /&gt;
&lt;br /&gt;
I now understand by reading the discussion, but it would be nice somewhere in the article if it said that loading the settings was not NECESSARY in the install. It was unclear to me when the install was mentioned if I had to include it in the install, and go through a install for any of what was being said to work.&lt;br /&gt;
&lt;br /&gt;
I know these might be very basic concepts. But thats where I am right now. You have to start somewhere.&lt;br /&gt;
&lt;br /&gt;
Dr. Sassafras&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;In an MVC structure, this code would be placed in the view.html.php file for the particular view required.&lt;br /&gt;
&lt;br /&gt;
Assuming that the item parameters are stored in the params field, and that the particular item has been loaded into the $row object by the method, you would then add in the item parameters to the $params object using:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please give an example of this. Don&#039;t know what you are talking about. I don&#039;t see the an example of how to load the $row ether.&lt;br /&gt;
&lt;br /&gt;
I have been able to get global preferences set, but don&#039;t have enough info override the globals with page specific ones.&lt;br /&gt;
&lt;br /&gt;
[[User:Drsassafras|Drsassafras]] 20:16, 21 March 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Setting &amp;lt;params&amp;gt; in XML Installer ==&lt;br /&gt;
&lt;br /&gt;
There is an issue with using the XML installer file to set params field values in jos_component.&lt;br /&gt;
See: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;amp;tracker_item_id=17767&lt;br /&gt;
&lt;br /&gt;
Including the following code in the XML install file has no affect - db field params remains empty until users saves config in view.&lt;br /&gt;
&amp;lt;install&amp;gt;&lt;br /&gt;
..&lt;br /&gt;
&amp;lt;params&amp;gt;&lt;br /&gt;
    &amp;lt;param name=&amp;quot;foo&amp;quot; default=&amp;quot;bar&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/params&amp;gt;&lt;br /&gt;
..&lt;br /&gt;
&amp;lt;/install&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values can be set at install time by adding INSERT statement for params in jos_component in the install.sql file.&lt;br /&gt;
&lt;br /&gt;
[[User:Exps1|Exps1]] 12:54, 16 October 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Exps1</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Developing_a_MVC_Component/Basic_Backend_Framework&amp;diff=15937</id>
		<title>J1.5:Developing a MVC Component/Basic Backend Framework</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Developing_a_MVC_Component/Basic_Backend_Framework&amp;diff=15937"/>
		<updated>2009-10-16T00:11:50Z</updated>

		<summary type="html">&lt;p&gt;Exps1: /* The Hellos View */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This article focuses on the entry page/article for the administrator. Whilst the MVC pattern is the same as for the frontend user, this chapter will rapidly go though all steps and setup the backend counter part in the admin section. This article will only focus on setting up the Basic Framework with a list of all the &#039;&#039;Hellos&#039;&#039; but without user interaction. The actual user interaction is added in the succeeding article [[Developing a Model-View-Controller Component - Part 6 - Adding Backend Actions]].&lt;br /&gt;
&lt;br /&gt;
== Tutorial specific naming ==&lt;br /&gt;
Within the next articles the explanation of this administrator section we will keep as close as possible to the component name. For the general overview, lists from the database, we will use &#039;&#039;Hellos&#039;&#039; as identification. The &#039;&#039;Hellos&#039;&#039; naming will be used for viewing and controlling multiple Hellos at once from the database. When selecting a single Hello for Editing or Adding we will use the singular &#039;&#039;Hello&#039;&#039; as naming for the Controller and View. This &#039;&#039;Admin Hello&#039;&#039; has no functional relation with the &#039;&#039;Site Hello&#039;&#039; (the only dependency is the database content of cause).&lt;br /&gt;
&lt;br /&gt;
Where parts 1,2 and 3 of the MVC explanation were working in the site directory tree of com_hello, part 5 and 6 will focus on the admin directory tree. Part 5 and 6 will not add or change files in the site directory tree. Look at the XML file in the attached example of the full com_hello implementation. The XML configuration file will help you with the exact location of the different files being used in this and the following chapter.&lt;br /&gt;
&lt;br /&gt;
== Creating the Basic Framework ==&lt;br /&gt;
&lt;br /&gt;
The basic framework of the administrator panel is very similar to the site portion. The main entry point for the administrator section of the component is hello.php. This file is identical to the hello.php file that was used in the site portion except the name of the controller it loads will be changed to HellosController. The default controller is also called controller.php and this file is identical to the default controller in the site portion, with the exception that the controller is named HellosController instead of HelloController. This difference is so that JController will by default load the hellos view, which will display a list of our greetings.&lt;br /&gt;
&lt;br /&gt;
Here is the listing for hello.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @package    Joomla.Tutorials&lt;br /&gt;
 * @subpackage Components&lt;br /&gt;
 * @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_4&lt;br /&gt;
 * @license    GNU/GPL&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
// No direct access&lt;br /&gt;
&lt;br /&gt;
defined( &#039;_JEXEC&#039; ) or die( &#039;Restricted access&#039; );&lt;br /&gt;
&lt;br /&gt;
// Require the base controller&lt;br /&gt;
&lt;br /&gt;
require_once( JPATH_COMPONENT.DS.&#039;controller.php&#039; );&lt;br /&gt;
&lt;br /&gt;
// Require specific controller if requested&lt;br /&gt;
if($controller = JRequest::getWord(&#039;controller&#039;)) {&lt;br /&gt;
    $path = JPATH_COMPONENT.DS.&#039;controllers&#039;.DS.$controller.&#039;.php&#039;;&lt;br /&gt;
    if (file_exists($path)) {&lt;br /&gt;
        require_once $path;&lt;br /&gt;
    } else {&lt;br /&gt;
        $controller = &#039;&#039;;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Create the controller&lt;br /&gt;
$classname    = &#039;HellosController&#039;.$controller;&lt;br /&gt;
$controller   = new $classname( );&lt;br /&gt;
&lt;br /&gt;
// Perform the Request task&lt;br /&gt;
$controller-&amp;gt;execute( JRequest::getVar( &#039;task&#039; ) );&lt;br /&gt;
&lt;br /&gt;
// Redirect if set by the controller&lt;br /&gt;
$controller-&amp;gt;redirect();&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The view and model that we will start with is the hellos view and the hellos model. We will start with the model.&lt;br /&gt;
&lt;br /&gt;
==== The Hellos Model ====&lt;br /&gt;
&lt;br /&gt;
The Hellos Model will be very simple. The only operation that we currently need is the ability to retrieve the list of hellos from the database. This operation will be implemented in a method called getData().&lt;br /&gt;
&lt;br /&gt;
The JModel class has a built in protected method called _getList(). This method can be used to simplify the task of retrieving a list of records from the database. We simply need to pass it the query and it will return the list of records.&lt;br /&gt;
&lt;br /&gt;
At a later point in time, we might want to use our query from within another method. Therefore, we will create a private method called _buildQuery() which will return the query that will be passed to _getList(). This makes it easier to change the query as well since it is localized in one place.&lt;br /&gt;
&lt;br /&gt;
Therefore we need two methods in our class: getData() and _buildQuery().&lt;br /&gt;
&lt;br /&gt;
_buildQuery() simply returns the query. It looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source  lang=&amp;quot;php&amp;quot;&amp;gt;/**&lt;br /&gt;
 * Returns the query&lt;br /&gt;
 * @return string The query to be used to retrieve the rows from the database&lt;br /&gt;
 */&lt;br /&gt;
function _buildQuery()&lt;br /&gt;
{&lt;br /&gt;
    $query = &#039; SELECT * &#039;&lt;br /&gt;
           . &#039; FROM #__hello &#039;&lt;br /&gt;
    ;&lt;br /&gt;
&lt;br /&gt;
    return $query;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
getData() will obtain the query and retrieve the records from the database. Now it might happen that we need to retrieve this list of data twice in one page load. It would be a waste to have to query the database twice. Therefore, we will have this method store the data in a protected property so that on subsequent requests it can simply return the data it has already retrieved. This property will be called _data. (&#039;&#039;&amp;lt;-- Naming convention conflict. Private or Protected data should be preceded with a &#039;_&#039; but as this reference is returned to the view where this data is directly accessed, this data can only be considered as public.&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
Here is the getData() method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source  lang=&amp;quot;php&amp;quot;&amp;gt;/**&lt;br /&gt;
 * Retrieves the hello data&lt;br /&gt;
 * @return array Array of objects containing the data from the database&lt;br /&gt;
 */&lt;br /&gt;
function getData()&lt;br /&gt;
{&lt;br /&gt;
    // Lets load the data if it doesn&#039;t already exist&lt;br /&gt;
    if (empty( $this-&amp;gt;_data ))&lt;br /&gt;
    {&lt;br /&gt;
        $query = $this-&amp;gt;_buildQuery();&lt;br /&gt;
        $this-&amp;gt;_data = $this-&amp;gt;_getList( $query );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return $this-&amp;gt;_data;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The completed model looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * Hellos Model for Hello World Component&lt;br /&gt;
 * &lt;br /&gt;
 * @package    Joomla.Tutorials&lt;br /&gt;
 * @subpackage Components&lt;br /&gt;
 * @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_4&lt;br /&gt;
 * @license        GNU/GPL&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// Check to ensure this file is included in Joomla!&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die();&lt;br /&gt;
&lt;br /&gt;
jimport( &#039;joomla.application.component.model&#039; );&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Model&lt;br /&gt;
 *&lt;br /&gt;
 * @package    Joomla.Tutorials&lt;br /&gt;
 * @subpackage Components&lt;br /&gt;
 */&lt;br /&gt;
class HellosModelHellos extends JModel&lt;br /&gt;
{&lt;br /&gt;
    /**&lt;br /&gt;
     * Hellos data array&lt;br /&gt;
     *&lt;br /&gt;
     * @var array&lt;br /&gt;
     */&lt;br /&gt;
    var $_data;&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Returns the query&lt;br /&gt;
     * @return string The query to be used to retrieve the rows from the database&lt;br /&gt;
     */&lt;br /&gt;
    function _buildQuery()&lt;br /&gt;
    {&lt;br /&gt;
        $query = &#039; SELECT * &#039;&lt;br /&gt;
            . &#039; FROM #__hello &#039;&lt;br /&gt;
        ;&lt;br /&gt;
        return $query;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Retrieves the hello data&lt;br /&gt;
     * @return array Array of objects containing the data from the database&lt;br /&gt;
     */&lt;br /&gt;
    function getData()&lt;br /&gt;
    {&lt;br /&gt;
        // Lets load the data if it doesn&#039;t already exist&lt;br /&gt;
        if (empty( $this-&amp;gt;_data ))&lt;br /&gt;
        {&lt;br /&gt;
            $query = $this-&amp;gt;_buildQuery();&lt;br /&gt;
            $this-&amp;gt;_data = $this-&amp;gt;_getList( $query );&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        return $this-&amp;gt;_data;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This file is saved as models/hellos.php.&lt;br /&gt;
&lt;br /&gt;
==== The Hellos View ====&lt;br /&gt;
&lt;br /&gt;
Now that we have a model to retrieve our data, we need to display it. This view will be fairly similar to the view from the site section as well.&lt;br /&gt;
&lt;br /&gt;
Just as our model was automatically instantiated in the site, so it is in the administrator. Methods that start with get in the model can be accessed using the get() method of the JView class. So our view has three lines: one to retrieve the data from the model, one to push the data into the template, and one to invoke the display method to display the output. Thus we have:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * Hellos View for Hello World Component&lt;br /&gt;
 * &lt;br /&gt;
 * @package    Joomla.Tutorials&lt;br /&gt;
 * @subpackage Components&lt;br /&gt;
 * @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_4&lt;br /&gt;
 * @license        GNU/GPL&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// Check to ensure this file is included in Joomla!&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die();&lt;br /&gt;
&lt;br /&gt;
jimport( &#039;joomla.application.component.view&#039; );&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hellos View&lt;br /&gt;
 *&lt;br /&gt;
 * @package    Joomla.Tutorials&lt;br /&gt;
 * @subpackage Components&lt;br /&gt;
 */&lt;br /&gt;
class HellosViewHellos extends JView&lt;br /&gt;
{&lt;br /&gt;
    /**&lt;br /&gt;
     * Hellos view display method&lt;br /&gt;
     * @return void&lt;br /&gt;
     **/&lt;br /&gt;
    function display($tpl = null)&lt;br /&gt;
    {&lt;br /&gt;
        JToolBarHelper::title( JText::_( &#039;Hello Manager&#039; ), &#039;generic.png&#039; );&lt;br /&gt;
        JToolBarHelper::deleteList();&lt;br /&gt;
        JToolBarHelper::editListX();&lt;br /&gt;
        JToolBarHelper::addNewX();&lt;br /&gt;
&lt;br /&gt;
        // Get data from the model&lt;br /&gt;
        $items =&amp;amp; $this-&amp;gt;get( &#039;Data&#039;);&lt;br /&gt;
&lt;br /&gt;
        $this-&amp;gt;assignRef( &#039;items&#039;, $items );&lt;br /&gt;
&lt;br /&gt;
        parent::display($tpl);&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This file is saved as views/hellos/view.html.php.&lt;br /&gt;
&lt;br /&gt;
Look carefully at the almost hidden differences compared to &#039;&#039;site&#039;&#039; example. The data is stored in a variable that is encapsulated within the model. Because the data amount is huge due to using the very handy _getList(), the need for returning a reference instead of a value is obvious. This is handled in:&lt;br /&gt;
 $items =&amp;amp; $this-&amp;gt;get( &#039;Data&#039;);&lt;br /&gt;
Looking again at this line and you will notice another difference with respect to the &#039;&#039;site&#039;&#039; view.html.php. The calling of the model function is done implicit. The actual model function name is getData(). In the &#039;&#039;site&#039;&#039; example you had to call following two lines:&lt;br /&gt;
 $model =&amp;amp; $this-&amp;gt;getModel();&lt;br /&gt;
 $greeting = $model-&amp;gt;getData();&lt;br /&gt;
Both lines are now taken care of by calling: &amp;lt;code&amp;gt;$this-&amp;gt;get( &#039;Data&#039;);&amp;lt;/code&amp;gt;. Under the surface of this &amp;lt;code&amp;gt;get()&amp;lt;/code&amp;gt; the &#039;Data&#039; is prefixed with &#039;get&#039; so when using this function make sure the model functions are preceded with &#039;get&#039;. This function can also be used in the &#039;&#039;site&#039;&#039; section. It is considered good programming practise to keep the data in the model and access it by reference, &amp;lt;code&amp;gt;get()&amp;lt;/code&amp;gt; methods are the preferred way of getting data from the model.&lt;br /&gt;
&lt;br /&gt;
==== The Hellos Template ====&lt;br /&gt;
&lt;br /&gt;
The template will take the data pushed into it from the view and produce the output. We will display our output in a simple table. While the frontend template was very simple, in the administrator we will need a minimal amount of extra logic to handle looping through the data.&lt;br /&gt;
&lt;br /&gt;
Here is our template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); ?&amp;gt;&lt;br /&gt;
&amp;lt;form action=&amp;quot;index.php&amp;quot; method=&amp;quot;post&amp;quot; name=&amp;quot;adminForm&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;editcell&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;table class=&amp;quot;adminlist&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;thead&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
            &amp;lt;th width=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;?php echo JText::_( &#039;ID&#039; ); ?&amp;gt;&lt;br /&gt;
            &amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th&amp;gt;&lt;br /&gt;
                &amp;lt;?php echo JText::_( &#039;Greeting&#039; ); ?&amp;gt;&lt;br /&gt;
            &amp;lt;/th&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;            &lt;br /&gt;
    &amp;lt;/thead&amp;gt;&lt;br /&gt;
    &amp;lt;?php&lt;br /&gt;
    $k = 0;&lt;br /&gt;
    for ($i=0, $n=count( $this-&amp;gt;items ); $i &amp;lt; $n; $i++)&lt;br /&gt;
    {&lt;br /&gt;
        $row =&amp;amp; $this-&amp;gt;items[$i];&lt;br /&gt;
        ?&amp;gt;&lt;br /&gt;
        &amp;lt;tr class=&amp;quot;&amp;lt;?php echo &amp;quot;row$k&amp;quot;; ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;td&amp;gt;&lt;br /&gt;
                &amp;lt;?php echo $row-&amp;gt;id; ?&amp;gt;&lt;br /&gt;
            &amp;lt;/td&amp;gt;&lt;br /&gt;
            &amp;lt;td&amp;gt;&lt;br /&gt;
                &amp;lt;?php echo $row-&amp;gt;greeting; ?&amp;gt;&lt;br /&gt;
            &amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
        &amp;lt;?php&lt;br /&gt;
        $k = 1 - $k;&lt;br /&gt;
    }&lt;br /&gt;
    ?&amp;gt;&lt;br /&gt;
    &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;option&amp;quot; value=&amp;quot;com_hello&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;task&amp;quot; value=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;boxchecked&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;controller&amp;quot; value=&amp;quot;hello&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/form&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This template is saved as views/hellos/tmpl/default.php.&lt;br /&gt;
&lt;br /&gt;
You will notice that our output is enclosed in a form. Though this is not necessary now, it will be soon.&lt;br /&gt;
&lt;br /&gt;
We have now completed the basic part of the first view. We have added five files to the admin section of our component:&lt;br /&gt;
&lt;br /&gt;
* hello.php&lt;br /&gt;
* controller.php&lt;br /&gt;
* models/hellos.php&lt;br /&gt;
* views/hellos/view.html.php&lt;br /&gt;
* views/hellos/tmpl/default.php&lt;br /&gt;
&lt;br /&gt;
You can now add these files to the XML install file and give it a try!&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
We have now implemented a basic framework for the backend admin component. A list where all of the Hellos are displayed. The next chapter will extend this framework and add user interaction / database manipulation.&lt;br /&gt;
&lt;br /&gt;
== Articles in this Series ==&lt;br /&gt;
[[Developing a Model-View-Controller Component - Part 1]]&lt;br /&gt;
&lt;br /&gt;
[[Developing a Model-View-Controller Component - Part 2 - Adding a Model]]&lt;br /&gt;
&lt;br /&gt;
[[Developing a Model-View-Controller Component - Part 3 - Using the Database]]&lt;br /&gt;
&lt;br /&gt;
[[Developing a Model-View-Controller Component - Part 4 - Creating an Administrator Interface]]&lt;br /&gt;
&lt;br /&gt;
[[Developing a Model-View-Controller Component - Part 5 - Basic Backend Framework]]&lt;br /&gt;
&lt;br /&gt;
[[Developing a Model-View-Controller Component - Part 6 - Adding Backend Actions]]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
* staalanden&lt;br /&gt;
* jamesconroyuk&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
The full admin component can be downloaded at: [http://joomlacode.org/gf/download/frsrelease/8111/29436/com_hello4_01.zip com_hello4_01].&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Exps1</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Developing_a_MVC_Component/Using_the_Database&amp;diff=15914</id>
		<title>J1.5 talk:Developing a MVC Component/Using the Database</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Developing_a_MVC_Component/Using_the_Database&amp;diff=15914"/>
		<updated>2009-10-15T13:43:19Z</updated>

		<summary type="html">&lt;p&gt;Exps1: /* Saving the install/uninstall files */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Although it is mentioned in the article, I think it is important to underline where the install.sql and uninstall.sql files have to be placed:&lt;br /&gt;
&lt;br /&gt;
install.sql and uninstall.sql files have to be mentioned in two places:&lt;br /&gt;
* In one of the file sections. For example:&lt;br /&gt;
   &amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;filename&amp;gt;...&amp;lt;/filename&amp;gt;&lt;br /&gt;
      &amp;lt;filename&amp;gt;...&amp;lt;/filename&amp;gt;&lt;br /&gt;
      &amp;lt;filename&amp;gt;install.sql&amp;lt;/filename&amp;gt;&lt;br /&gt;
      &amp;lt;filename&amp;gt;uninstall.sql&amp;lt;/filename&amp;gt;&lt;br /&gt;
   &amp;lt;/files&amp;gt;  &lt;br /&gt;
* In the &#039;&#039;install&#039;&#039; / &#039;&#039;uninstall&#039;&#039; sections.&lt;br /&gt;
&lt;br /&gt;
Of course, the files have to be copied in the correct folder (in the example, it should be the &#039;&#039;admin&#039;&#039; folder).&lt;br /&gt;
&lt;br /&gt;
When data is read from a database, it can be retrieved in the class constructor:&lt;br /&gt;
&lt;br /&gt;
   // The constructor accesses the database, and retrieves all properties.&lt;br /&gt;
   function __construct($config = array()) {&lt;br /&gt;
      parent::__construct($config);           // To transmit configuration to parent class.&lt;br /&gt;
      $db =&amp;amp; JFactory::getDBO();		&lt;br /&gt;
      $query = &#039;SELECT greeting FROM #__hello&#039;;&lt;br /&gt;
      $db-&amp;gt;setQuery( $query );&lt;br /&gt;
      $this-&amp;gt;greeting = $db-&amp;gt;loadResult();&lt;br /&gt;
   }&lt;br /&gt;
   // The private property&lt;br /&gt;
   var $greeting;&lt;br /&gt;
   // The public property accessor&lt;br /&gt;
   function getGreeting() {&lt;br /&gt;
      return $this-&amp;gt;greeting;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
/* 2009-07-21 */&lt;br /&gt;
* Are those file names for &amp;quot;install.utf8.sql&amp;quot; and &amp;quot;uninstall.utf8.sql&amp;quot; correctly written into XML file? I see files &amp;quot;install.sql&amp;quot; and &amp;quot;uninstall.sql&amp;quot;, but in the text, there says the files will be named &amp;quot;install.utf8.sql&amp;quot; and &amp;quot;uninstall.utf8.sql&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
== Some glitches ==&lt;br /&gt;
I followed the MVC explanation step by step but this section contains some glitches. &lt;br /&gt;
&lt;br /&gt;
The .sql files should NOT contain &#039;.utf&#039; in the file names. The installer will not find the files (verified on Joomla! 1.5.12).&lt;br /&gt;
&lt;br /&gt;
As indicated above, storing the (un)instal.sql should be in admin directory. So to be concrete the last lines of the chapters &amp;quot;Creating the Installation SQL File&amp;quot; and &amp;quot;Creating the uninstall SQL file&amp;quot; should be:&lt;br /&gt;
&lt;br /&gt;
 We will ... called ./admin/install.sql&lt;br /&gt;
 We will ... called ./admin/uninstall.sql&lt;br /&gt;
&lt;br /&gt;
(both glitches are not in the attachment belonging to the article; the component file: com_hello3_01 is correct)&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:M.A.S.H|M.A.S.H]] 12:09, 2 August 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Saving the install/uninstall files ==&lt;br /&gt;
&lt;br /&gt;
On my system I ran into a problem with the intall.sql / uninstall.sql files.&lt;br /&gt;
I wanted to avoid using the &amp;lt;query&amp;gt; tags by including them in the script and having JIntaller run them. I created files using MySQL Query Browser testing them to make sure they worked.&lt;br /&gt;
When the component is installed JInstaller raises a 1064 db error, which did not make any sense.&lt;br /&gt;
The problem was occurring because I was saving the script as type &amp;quot;SQL Script File UTF-8&amp;quot;, which seemed logical because the charset is utf8. The file must be saved as type &amp;quot;SQL Script File ANSI&amp;quot; or you get the 1064 db error.&lt;br /&gt;
&lt;br /&gt;
Using Joomla 1.5.14, MSQL Query Browser 1.2.12, XP sp3&lt;br /&gt;
&lt;br /&gt;
[[User:Exps1|Exps1]] 13:43, 15 October 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Exps1</name></author>
	</entry>
</feed>