<?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=Neo314</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=Neo314"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Neo314"/>
	<updated>2026-05-15T20:02:09Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Adding_categories&amp;diff=82503</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=82503"/>
		<updated>2013-03-12T13:20:16Z</updated>

		<summary type="html">&lt;p&gt;Neo314: /* Hiding the submenu on edit forms. */ new section&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;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
People who are using Joomla &amp;gt;= 2.5.5. will probably encounter a problem with categories menu - buttons for basic user actions missing (such as &amp;quot;New&amp;quot;, &amp;quot;Edit&amp;quot; etc.) The solution can be found here: http://forum.joomla.org/viewtopic.php?f=642&amp;amp;t=730171&lt;br /&gt;
&lt;br /&gt;
== Additional explanation about the controller helloworld.php file changes would be helpful. ==&lt;br /&gt;
&lt;br /&gt;
The controller helloworld.php file changes from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;// set default view if not set&amp;lt;br/&amp;gt;&lt;br /&gt;
            JRequest::setVar(&#039;view&#039;, JRequest::getCmd(&#039;view&#039;, &#039;HelloWorlds&#039;));&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;// set default view if not set&amp;lt;br/&amp;gt;&lt;br /&gt;
            $input = JFactory::getApplication()-&amp;gt;input;&amp;lt;br/&amp;gt;&lt;br /&gt;
            $input-&amp;gt;set(&#039;view&#039;, $input-&amp;gt;getCmd(&#039;view&#039;, &#039;HelloWorlds&#039;));&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
without any explanation as to the changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*** JRequest is depricated and JInput is to be used&lt;br /&gt;
&lt;br /&gt;
== The helper filename is important ==&lt;br /&gt;
&lt;br /&gt;
I think this is the first place the helper file was discussed, and I found out the hard way that the file name needs to be the component name (in lower case I think). HelloWorldHelper.php (named after the class) seemed to work in every respect except for maintaining the submenu when on the categories submenu item. It has to be helloworld.php&lt;br /&gt;
&lt;br /&gt;
== Hiding the submenu on edit forms. ==&lt;br /&gt;
&lt;br /&gt;
I would suggest adding the code to hide the submenu on the edit form. If the user has the submenu items on the list view and goes to an edit form, the submenu is really not valuable and could cause the user to lose changes with an accidental click. The code could be done like this to only show the submenu on the list views.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static function addSubmenu($submenu) &lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  $subMenuViews = array(&amp;quot;messages&amp;quot;,&amp;quot;categories&amp;quot;);&lt;br /&gt;
  // Prevent the menus from displaying on edit form views like message and category&lt;br /&gt;
  if (in_array($submenu,$subMenuViews))&lt;br /&gt;
  {&lt;br /&gt;
&lt;br /&gt;
    JSubMenuHelper::addEntry(JText::_(&#039;COM_HELLOWORLD_SUBMENU_MESSAGES&#039;),&lt;br /&gt;
           &#039;index.php?option=com_helloworld&#039;, $submenu == &#039;messages&#039;);&lt;br /&gt;
    JSubMenuHelper::addEntry(JText::_(&#039;COM_HELLOWORLD_SUBMENU_CATEGORIES&#039;),&lt;br /&gt;
           &#039;index.php?option=com_categories&amp;amp;view=categories&amp;amp;extension=com_helloworld&#039;,&lt;br /&gt;
           $submenu == &#039;categories&#039;);&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // set some global property&lt;br /&gt;
  $document = JFactory::getDocument();&lt;br /&gt;
  $document-&amp;gt;addStyleDeclaration(&#039;.icon-48-helloworld &#039; .&lt;br /&gt;
  &#039;{background-image: url(../media/com_helloworld/images/tux-48x48.png);}&#039;);&lt;br /&gt;
  if ($submenu == &#039;categories&#039;) &lt;br /&gt;
  {&lt;br /&gt;
     $document-&amp;gt;setTitle(JText::_(&#039;COM_HELLOWORLD_ADMINISTRATION_CATEGORIES&#039;));&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Neo314</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Adding_categories&amp;diff=82502</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=82502"/>
		<updated>2013-03-12T13:10:29Z</updated>

		<summary type="html">&lt;p&gt;Neo314: /* The helper filename is important */ new section&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;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
People who are using Joomla &amp;gt;= 2.5.5. will probably encounter a problem with categories menu - buttons for basic user actions missing (such as &amp;quot;New&amp;quot;, &amp;quot;Edit&amp;quot; etc.) The solution can be found here: http://forum.joomla.org/viewtopic.php?f=642&amp;amp;t=730171&lt;br /&gt;
&lt;br /&gt;
== Additional explanation about the controller helloworld.php file changes would be helpful. ==&lt;br /&gt;
&lt;br /&gt;
The controller helloworld.php file changes from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;// set default view if not set&amp;lt;br/&amp;gt;&lt;br /&gt;
            JRequest::setVar(&#039;view&#039;, JRequest::getCmd(&#039;view&#039;, &#039;HelloWorlds&#039;));&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;// set default view if not set&amp;lt;br/&amp;gt;&lt;br /&gt;
            $input = JFactory::getApplication()-&amp;gt;input;&amp;lt;br/&amp;gt;&lt;br /&gt;
            $input-&amp;gt;set(&#039;view&#039;, $input-&amp;gt;getCmd(&#039;view&#039;, &#039;HelloWorlds&#039;));&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
without any explanation as to the changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*** JRequest is depricated and JInput is to be used&lt;br /&gt;
&lt;br /&gt;
== The helper filename is important ==&lt;br /&gt;
&lt;br /&gt;
I think this is the first place the helper file was discussed, and I found out the hard way that the file name needs to be the component name (in lower case I think). HelloWorldHelper.php (named after the class) seemed to work in every respect except for maintaining the submenu when on the categories submenu item. It has to be helloworld.php&lt;/div&gt;</summary>
		<author><name>Neo314</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Adding_ACL&amp;diff=82501</id>
		<title>Archived talk:Developing a MVC Component/Adding ACL</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Adding_ACL&amp;diff=82501"/>
		<updated>2013-03-12T12:59:31Z</updated>

		<summary type="html">&lt;p&gt;Neo314: /* Adding Dependent Table Permissions (Expanded from the tutorial and not part of it) */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Checking the permissions on the Server Side ==&lt;br /&gt;
&lt;br /&gt;
The tutorial at the moment of writing is not enforcing the permissions on the server side, allowing a forged request to modify data. (Permissions are only declared and set, but not checked!)&lt;br /&gt;
&lt;br /&gt;
Looking at how this is handled in other components in Joomla I&#039;ve noticed that:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;core.delete&amp;quot;&#039;&#039;&#039; is enforced in the model class: &#039;&#039;admin/models/helloworld.php&#039;&#039; by adding these lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
        /**&lt;br /&gt;
         * Method to check if it&#039;s OK to delete a message. Overwrites JModelAdmin::canDelete&lt;br /&gt;
         */&lt;br /&gt;
        protected function canDelete($record)&lt;br /&gt;
        {&lt;br /&gt;
            if( !empty( $record-&amp;gt;id ) ){&lt;br /&gt;
                $user = JFactory::getUser();&lt;br /&gt;
                return $user-&amp;gt;authorise( &amp;quot;core.delete&amp;quot;, &amp;quot;com_helloworld.message.&amp;quot; . $record-&amp;gt;id );&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;core.edit&amp;quot;&#039;&#039;&#039; (and &#039;&#039;&#039;core.add&#039;&#039;&#039; if you wish) are enforced in the sub-controller (NOT in the model). I don&#039;t know why this is so, but that&#039;s how other components do it. You need to add the following lines in the file: &#039;&#039;/admin/controllers/helloworld.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;php&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Implement to allowAdd or not&lt;br /&gt;
     *&lt;br /&gt;
     * Not used at this time (but you can look at how other components use this....)&lt;br /&gt;
     * Overwrites: JControllerForm::allowAdd&lt;br /&gt;
     *&lt;br /&gt;
     * @param array $data&lt;br /&gt;
     * @return bool&lt;br /&gt;
     */&lt;br /&gt;
    protected function allowAdd($data = array())&lt;br /&gt;
    {&lt;br /&gt;
        return parent::allowAdd($data);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Implement to allow edit or not&lt;br /&gt;
     * Overwrites: JControllerForm::allowEdit&lt;br /&gt;
     *&lt;br /&gt;
     * @param array $data&lt;br /&gt;
     * @param string $key&lt;br /&gt;
     * @return bool&lt;br /&gt;
     */&lt;br /&gt;
    protected function allowEdit($data = array(), $key = &#039;id&#039;)&lt;br /&gt;
    {&lt;br /&gt;
        $id = isset( $data[ $key ] ) ? $data[ $key ] : 0;&lt;br /&gt;
        if( !empty( $id ) ){&lt;br /&gt;
            $user = JFactory::getUser();&lt;br /&gt;
            return $user-&amp;gt;authorise( &amp;quot;core.edit&amp;quot;, &amp;quot;com_helloworld.message.&amp;quot; . $id );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you implement the changes above the tutorial should work as intended. (&#039;&#039;allowAdd&#039;&#039; should also be implemented to check for category permission at least, but since the author of the tutorial did not add a &amp;quot;core.add&amp;quot; action for the &amp;quot;message&amp;quot; section, I&#039;ll leave like it is.&lt;br /&gt;
&lt;br /&gt;
[[User:Ilie.pandia|Ilie Pandia]] ([[User talk:Ilie.pandia|talk]]) 06:08, 11 October 2012 (CDT)&lt;br /&gt;
&lt;br /&gt;
Somehow the ACL doesn&#039;t work on Edit permission for me. It shows both Save &amp;amp; New and Save as Copy buttons when it has no create rights. Gone through the code twice, but cannot see anything wrong with it... Anybody else have same problem? --[[User:A2Ggeir|A2Ggeir]] 10:19, 6 December 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Did a little debug and it seems the values from function canDo() in Helper does not return the right values when it is in edit view. &lt;br /&gt;
&lt;br /&gt;
Result when in listview:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   &#039;core.admin&#039; =&amp;gt; NULL,&lt;br /&gt;
   &#039;core.manage&#039; =&amp;gt; true,&lt;br /&gt;
   &#039;core.create&#039; =&amp;gt; false,&lt;br /&gt;
   &#039;core.edit&#039; =&amp;gt; true,&lt;br /&gt;
   &#039;core.delete&#039; =&amp;gt; false,&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Result when in editview:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   &#039;core.admin&#039; =&amp;gt; NULL,&lt;br /&gt;
   &#039;core.manage&#039; =&amp;gt; NULL,&lt;br /&gt;
   &#039;core.create&#039; =&amp;gt; true,&lt;br /&gt;
   &#039;core.edit&#039; =&amp;gt; true,&lt;br /&gt;
   &#039;core.delete&#039; =&amp;gt; true,&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--[[User:A2Ggeir|A2Ggeir]] 12:02, 7 December 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Delet dosn&#039;t work ==&lt;br /&gt;
&lt;br /&gt;
when you want to delete a message it goes wrong and the message appears:&lt;br /&gt;
&lt;br /&gt;
500 - Es ist ein Fehler aufgetreten&lt;br /&gt;
&lt;br /&gt;
Layout „default“ nicht gefunden&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
downt know why its not working... maybee some can check this out.&lt;br /&gt;
&lt;br /&gt;
Greetz&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Ok, so I have carefully followed the tutorial to here. What I need to know now is HOW do I allow a user who only has edit.own rights to get to the admin edit for the component??&lt;br /&gt;
&lt;br /&gt;
I tried for a while to create an edit page on the front end, but no luck and no help. It occurred to me that perhaps if I could not bring the mountain to Mohammed, I could get Mohammed access to the mountain. But how to do it without making every user an administrator? Even a manager has too much other access.&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[User:IslandBilly|&amp;amp;quot;In theory, there&amp;amp;#39;s no difference between theory and practice; in practice, there is&amp;amp;quot;  --Yogi Berra]] 10:14, 12 November 2011 (CST) Using v1.7&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
I think that this example is missing something in the bind method.&lt;br /&gt;
 &lt;br /&gt;
        // Bind the rules.&lt;br /&gt;
        if (isset($array[&#039;rules&#039;]) &amp;amp;&amp;amp; is_array($array[&#039;rules&#039;]))&lt;br /&gt;
        {&lt;br /&gt;
            $rules = new JAccessRules($array[&#039;rules&#039;]);&lt;br /&gt;
            $this-&amp;gt;setRules($rules);&lt;br /&gt;
        }&lt;br /&gt;
If we don&#039;t bind the rules then they are not saved in the asset table for the message/item...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Missing asset_id field==&lt;br /&gt;
&lt;br /&gt;
I think database table is missing field &amp;quot;asset_id&amp;quot;, which is required. Watch this link here.&lt;br /&gt;
&lt;br /&gt;
https://www.joomlajingle.com/blog/39-joomla-acl-for-developers&lt;br /&gt;
&lt;br /&gt;
[[User:Vipantonio|Vipantonio]] 06:19, 9 August 2012 (CDT)&lt;br /&gt;
&lt;br /&gt;
== Adding Dependent Table Permissions (Expanded from the tutorial and not part of it) ==&lt;br /&gt;
&lt;br /&gt;
It might be worth noting that if one is using dependent tables in a component, the permissions need to be extended to the dependent table&#039;s views. For example, if you had a component for making picture Galleries with pictures as Gallery Items, you would have views for Galleries, Gallery (Edit Form), GalleryItems,and GalleryItem (Edit Form).&lt;br /&gt;
&lt;br /&gt;
Adding permissions to the Gallery views (Galleries and Gallery) would be the same as shown in the tutorial. To add the permissions to the Gallery Item views (GalleryItems and GalleryItem) is slightly different. &lt;br /&gt;
&lt;br /&gt;
Assuming one wants the Gallery Items to have the same permissions as their parent Gallery (and not individual permissions for each item), the foreign key needs to be fed back to the getActions function.&lt;br /&gt;
&lt;br /&gt;
In the GalleryItems view the statement would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$this-&amp;gt;canDo = GalleryHelper::getActions($this-&amp;gt;items[0]-&amp;gt;gallery_id);&lt;br /&gt;
// gallery_id being the foreign key to the gallery table&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since this is the list view of the items contained in the gallery, the view gets items (plural). Their foreign keys are all the same though, so looking at the first one in the array gets the correct value.&lt;br /&gt;
&lt;br /&gt;
The GalleryItem view, which only pulls up one item would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$this-&amp;gt;canDo = GalleryHelper::getActions($this-&amp;gt;item-&amp;gt;gallery_id);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The logic may be slightly different as well. For example, adding or deleting a Gallery Item is editing the Gallery, so it may be better to simply use core.edit for every action in the Gallery Items portion of the component.&lt;br /&gt;
&lt;br /&gt;
Lastly, the permission code in the tutorial prevents the tasks from being completed. The views can still be loaded by direct url access as long as the user is logged into the back end and has access to the component. If there are actions that can be taken like using a media manager which may not require the form to be submitted, or if something confidential may be displayed, consider preventing the view with something like this for the dependent table (GalleryItems) where no action should be taken without edit permission:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.edit&#039;))&lt;br /&gt;
{&lt;br /&gt;
	parent::display($tpl);&lt;br /&gt;
} else {&lt;br /&gt;
	JFactory::getApplication()-&amp;gt;enqueueMessage(JText::_(&#039;COM_GALLERY_NO_EDIT_PERMISSION&#039;), &#039;error&#039;);&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or this for the primary table (Galleries) where one might create a new gallery even if they can&#039;t edit some of the galleries:&lt;br /&gt;
&amp;lt;pre&amp;gt;if ($this-&amp;gt;item-&amp;gt;gallery_id)&lt;br /&gt;
{&lt;br /&gt;
	if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.edit&#039;))&lt;br /&gt;
	{&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	} else {&lt;br /&gt;
		JFactory::getApplication()-&amp;gt;enqueueMessage(JText::_(&#039;COM_GALLERY_NO_EDIT_PERMISSION&#039;), &#039;error&#039;);&lt;br /&gt;
	}&lt;br /&gt;
// IF THIS IS A NEW ITEM (gallery_id == null)&lt;br /&gt;
} else {&lt;br /&gt;
	if ($this-&amp;gt;canDo-&amp;gt;get(&#039;core.create&#039;))&lt;br /&gt;
	{&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
	} else {&lt;br /&gt;
		JFactory::getApplication()-&amp;gt;enqueueMessage(JText::_(&#039;COM_GALLERY_NO_CREATE_PERMISSION&#039;), &#039;error&#039;);&lt;br /&gt;
	}&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[User:Neo314|Neo314]] ([[User talk:Neo314|talk]]) 07:59, 12 March 2013 (CDT)&lt;/div&gt;</summary>
		<author><name>Neo314</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Adding_configuration&amp;diff=79902</id>
		<title>Archived talk:Developing a MVC Component/Adding configuration</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Adding_configuration&amp;diff=79902"/>
		<updated>2013-01-14T02:22:33Z</updated>

		<summary type="html">&lt;p&gt;Neo314: /* Modifications that would make the tutorial clearer */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In the function&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
	/**&lt;br /&gt;
	 * Overloaded load function&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param       int $pk primary key&lt;br /&gt;
	 * @param       boolean $reset reset data&lt;br /&gt;
	 * @return      boolean&lt;br /&gt;
	 * @see JTable:load&lt;br /&gt;
	 */&lt;br /&gt;
	public function load($pk = null, $reset = true) &lt;br /&gt;
	{&lt;br /&gt;
		if (parent::load($pk, $reset)) &lt;br /&gt;
		{&lt;br /&gt;
			// Convert the params field to a registry.&lt;br /&gt;
			$params = new JRegistry;                 &lt;br /&gt;
                       // loadJSON is @deprecated    12.1  Use loadString passing JSON as the format instead.&lt;br /&gt;
                       // $params-&amp;gt;loadString($this-&amp;gt;item-&amp;gt;params, &#039;JSON&#039;);&lt;br /&gt;
//------------------------------------------------------------&lt;br /&gt;
                       $params-&amp;gt;loadJSON($this-&amp;gt;item-&amp;gt;params);&lt;br /&gt;
//------------------------------------------------------------&lt;br /&gt;
 &lt;br /&gt;
			$this-&amp;gt;params = $params;&lt;br /&gt;
			return true;&lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line bracketed above is actually, $params-&amp;gt;loadJSON($this-&amp;gt;params);&lt;br /&gt;
I am not sure which is 100% correct.&lt;br /&gt;
&lt;br /&gt;
Just done a quick test and the one WITHOUT the &#039;&#039;&#039;&#039;item&#039;&#039;&#039;&#039; is correct.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After changing files from 0.12 to 0.13 and downloading part13.zip I can&#039;t reach FrontEnd of HelloWorld component. I receive erorr 500. :( [[User:CodeBY|CodeBY]] 04:48, 4 May 2012 (CDT)&lt;br /&gt;
&lt;br /&gt;
== missing  &amp;lt;/fieldset&amp;gt; in admin\views\helloworld\tmpl\edit.php ==&lt;br /&gt;
&lt;br /&gt;
It is not a critical error. &lt;br /&gt;
&lt;br /&gt;
Looking at line 27 in the file admin\views\helloworld\tmpl\edit.php should look like this, as shown in the tutorial.&lt;br /&gt;
             &#039;&#039;&#039;&amp;lt;/fieldset&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
The file in the zipfile is missing this line &amp;lt;/fieldset&amp;gt; (line 27)&lt;br /&gt;
&lt;br /&gt;
Another minor detail is that the page on the website shows blocks of &amp;lt;?php ... ?&amp;gt; whereas the file as the php open and close per line.&lt;br /&gt;
&lt;br /&gt;
Does not influence the working. But is good to know when comparing your code. I use winmerge to compare my files with those in the zip file. Hoping to find that typo that prevents my version from running as it should ;-(&lt;br /&gt;
&lt;br /&gt;
== Modifications that would make the tutorial clearer ==&lt;br /&gt;
&lt;br /&gt;
I think the following 2 modifications would make this section of the tutorial clearer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Earlier in the tutorial, in the file site/models/helloworld.php $msg was used for the message, and here is is $item. I think it would be helpful to stay with the same variable name throughout the tutorial.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In the file admin/tables/helloworld.php, the comment about deprecated code is confusing. It might be better if it read&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;// loadJSON is @deprecated    12.1 (Joomla! 3)  Use loadString...&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
so it is more obvious that the current code is correct for this version (2.5) but not the future version (3). Not everyone knows what the 12.1 is referring to and it looks like it is saying the code the tutorial is telling you to use is deprecated.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Neo314</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Adding_categories&amp;diff=79901</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=79901"/>
		<updated>2013-01-14T00:32:15Z</updated>

		<summary type="html">&lt;p&gt;Neo314: /* Additional explanation about the controller helloworld.php file changes would be helpful. */ new section&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;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
People who are using Joomla &amp;gt;= 2.5.5. will probably encounter a problem with categories menu - buttons for basic user actions missing (such as &amp;quot;New&amp;quot;, &amp;quot;Edit&amp;quot; etc.) The solution can be found here: http://forum.joomla.org/viewtopic.php?f=642&amp;amp;t=730171&lt;br /&gt;
&lt;br /&gt;
== Additional explanation about the controller helloworld.php file changes would be helpful. ==&lt;br /&gt;
&lt;br /&gt;
The controller helloworld.php file changes from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;// set default view if not set&amp;lt;br/&amp;gt;&lt;br /&gt;
            JRequest::setVar(&#039;view&#039;, JRequest::getCmd(&#039;view&#039;, &#039;HelloWorlds&#039;));&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;// set default view if not set&amp;lt;br/&amp;gt;&lt;br /&gt;
            $input = JFactory::getApplication()-&amp;gt;input;&amp;lt;br/&amp;gt;&lt;br /&gt;
            $input-&amp;gt;set(&#039;view&#039;, $input-&amp;gt;getCmd(&#039;view&#039;, &#039;HelloWorlds&#039;));&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
without any explanation as to the changes.&lt;/div&gt;</summary>
		<author><name>Neo314</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Adding_verifications&amp;diff=79888</id>
		<title>Archived talk:Developing a MVC Component/Adding verifications</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Adding_verifications&amp;diff=79888"/>
		<updated>2013-01-13T03:26:23Z</updated>

		<summary type="html">&lt;p&gt;Neo314: /* Additional discussion about server-side validation would be helpful. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Why is the protected function _populateState() in the /admin/models/helloworld.php file? It doesn&#039;t appear in the original helloworld.php model file, and there isn&#039;t any indication as to the purpose of this function aside from the annotations within the function, which I don&#039;t fully understand.&lt;br /&gt;
&lt;br /&gt;
== Attention ==&lt;br /&gt;
&lt;br /&gt;
Section about admin/views/helloworld/tmpl/edit.php is not the same as in file present in archive.&lt;br /&gt;
&lt;br /&gt;
== verification seems to operate even when required=&amp;quot;false&amp;quot; is coded  ==&lt;br /&gt;
&lt;br /&gt;
I have expanded the helloworld component to have several other fields now, and set some of them to required=&amp;quot;false&amp;quot; in the /models/forms/app.xml file. I still get &amp;quot;invalid field&amp;quot; when I leave the input box empty. Any ideas?&lt;br /&gt;
&lt;br /&gt;
(later) I think I figured it out: the client-side script operates on every field it&#039;s assigned to, whereas the server-side &amp;lt;i&amp;gt;may&amp;lt;/i&amp;gt; operate only on a field that&#039;s required and not empty. Not sure about that last, but I am sure that the client-side script operates, so you may want to code the regex differently in admin/models/forms/&amp;lt;com-name&amp;gt;.js (the client side) vs admin/models/rules/&amp;lt;field&amp;gt;.php .&lt;br /&gt;
&lt;br /&gt;
[[User:IslandBilly|&amp;amp;quot;In theory, there&amp;amp;#39;s no difference between theory and practice; in practice, there is&amp;amp;quot;  --Yogi Berra]] 10:51, 30 September 2011 (CDT)&lt;br /&gt;
&lt;br /&gt;
== Minor misstatement ==&lt;br /&gt;
&lt;br /&gt;
After editing admin/views/helloworld/view.html.php, where the tutorial reads:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;This view now&amp;lt;/strong&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;verifies if the model has no error;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;&amp;lt;em&amp;gt;&amp;lt;strong&amp;gt;adds two javascript files;&amp;lt;/strong&amp;gt;&amp;lt;/em&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;injects javascript translation using the Joomla JText::script function. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I believe the statement &amp;amp;quot;adds two javascript files;&amp;amp;quot;, is incorrect. One javascript file has been added (submitbutton.js), and the second javascript file is added in the next step in the getScript function, (helloworld.js).&lt;br /&gt;
&lt;br /&gt;
Am I correct on this? If so, I can see where sometimes one might want to use both methods to add scripts, but it seems to only be for demonstration purposes here since it seems both scripts could be added by either method.&lt;br /&gt;
&lt;br /&gt;
== Additional discussion about server-side validation would be helpful. ==&lt;br /&gt;
&lt;br /&gt;
Additional discussion about server-side validation would be helpful. Why does simply declaring the $regex variable create a validation rule? There does not appear to be any rule logic or class method applied to the field value.&lt;br /&gt;
&lt;br /&gt;
I&#039;m also not sure about the function of the javascript language translation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;alert(Joomla.JText._(&#039;COM_HELLOWORLD_HELLOWORLD_ERROR_UNACCEPTABLE&#039;,&#039;Some values are unacceptable&#039;));&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since it does not seem to work unless COM_HELLOWORLD_HELLOWORLD_ERROR_UNACCEPTABLE is in the translation file. Additional explanation on this would be helpful.&lt;/div&gt;</summary>
		<author><name>Neo314</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Adding_verifications&amp;diff=79887</id>
		<title>Archived talk:Developing a MVC Component/Adding verifications</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Adding_verifications&amp;diff=79887"/>
		<updated>2013-01-13T02:10:55Z</updated>

		<summary type="html">&lt;p&gt;Neo314: /* Additional discussion about server-side validation would be helpful. */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Why is the protected function _populateState() in the /admin/models/helloworld.php file? It doesn&#039;t appear in the original helloworld.php model file, and there isn&#039;t any indication as to the purpose of this function aside from the annotations within the function, which I don&#039;t fully understand.&lt;br /&gt;
&lt;br /&gt;
== Attention ==&lt;br /&gt;
&lt;br /&gt;
Section about admin/views/helloworld/tmpl/edit.php is not the same as in file present in archive.&lt;br /&gt;
&lt;br /&gt;
== verification seems to operate even when required=&amp;quot;false&amp;quot; is coded  ==&lt;br /&gt;
&lt;br /&gt;
I have expanded the helloworld component to have several other fields now, and set some of them to required=&amp;quot;false&amp;quot; in the /models/forms/app.xml file. I still get &amp;quot;invalid field&amp;quot; when I leave the input box empty. Any ideas?&lt;br /&gt;
&lt;br /&gt;
(later) I think I figured it out: the client-side script operates on every field it&#039;s assigned to, whereas the server-side &amp;lt;i&amp;gt;may&amp;lt;/i&amp;gt; operate only on a field that&#039;s required and not empty. Not sure about that last, but I am sure that the client-side script operates, so you may want to code the regex differently in admin/models/forms/&amp;lt;com-name&amp;gt;.js (the client side) vs admin/models/rules/&amp;lt;field&amp;gt;.php .&lt;br /&gt;
&lt;br /&gt;
[[User:IslandBilly|&amp;amp;quot;In theory, there&amp;amp;#39;s no difference between theory and practice; in practice, there is&amp;amp;quot;  --Yogi Berra]] 10:51, 30 September 2011 (CDT)&lt;br /&gt;
&lt;br /&gt;
== Minor misstatement ==&lt;br /&gt;
&lt;br /&gt;
After editing admin/views/helloworld/view.html.php, where the tutorial reads:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;This view now&amp;lt;/strong&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;verifies if the model has no error;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;&amp;lt;em&amp;gt;&amp;lt;strong&amp;gt;adds two javascript files;&amp;lt;/strong&amp;gt;&amp;lt;/em&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;injects javascript translation using the Joomla JText::script function. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I believe the statement &amp;amp;quot;adds two javascript files;&amp;amp;quot;, is incorrect. One javascript file has been added (submitbutton.js), and the second javascript file is added in the next step in the getScript function, (helloworld.js).&lt;br /&gt;
&lt;br /&gt;
Am I correct on this? If so, I can see where sometimes one might want to use both methods to add scripts, but it seems to only be for demonstration purposes here since it seems both scripts could be added by either method.&lt;br /&gt;
&lt;br /&gt;
== Additional discussion about server-side validation would be helpful. ==&lt;br /&gt;
&lt;br /&gt;
Additional discussion about server-side validation would be helpful. Why does simply declaring the $regex variable create a validation rule? There does not appear to be any rule logic or class method applied to the field value.&lt;/div&gt;</summary>
		<author><name>Neo314</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Adding_verifications&amp;diff=79886</id>
		<title>Archived talk:Developing a MVC Component/Adding verifications</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Adding_verifications&amp;diff=79886"/>
		<updated>2013-01-13T01:58:38Z</updated>

		<summary type="html">&lt;p&gt;Neo314: /* Minor misstatement */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Why is the protected function _populateState() in the /admin/models/helloworld.php file? It doesn&#039;t appear in the original helloworld.php model file, and there isn&#039;t any indication as to the purpose of this function aside from the annotations within the function, which I don&#039;t fully understand.&lt;br /&gt;
&lt;br /&gt;
== Attention ==&lt;br /&gt;
&lt;br /&gt;
Section about admin/views/helloworld/tmpl/edit.php is not the same as in file present in archive.&lt;br /&gt;
&lt;br /&gt;
== verification seems to operate even when required=&amp;quot;false&amp;quot; is coded  ==&lt;br /&gt;
&lt;br /&gt;
I have expanded the helloworld component to have several other fields now, and set some of them to required=&amp;quot;false&amp;quot; in the /models/forms/app.xml file. I still get &amp;quot;invalid field&amp;quot; when I leave the input box empty. Any ideas?&lt;br /&gt;
&lt;br /&gt;
(later) I think I figured it out: the client-side script operates on every field it&#039;s assigned to, whereas the server-side &amp;lt;i&amp;gt;may&amp;lt;/i&amp;gt; operate only on a field that&#039;s required and not empty. Not sure about that last, but I am sure that the client-side script operates, so you may want to code the regex differently in admin/models/forms/&amp;lt;com-name&amp;gt;.js (the client side) vs admin/models/rules/&amp;lt;field&amp;gt;.php .&lt;br /&gt;
&lt;br /&gt;
[[User:IslandBilly|&amp;amp;quot;In theory, there&amp;amp;#39;s no difference between theory and practice; in practice, there is&amp;amp;quot;  --Yogi Berra]] 10:51, 30 September 2011 (CDT)&lt;br /&gt;
&lt;br /&gt;
== Minor misstatement ==&lt;br /&gt;
&lt;br /&gt;
After editing admin/views/helloworld/view.html.php, where the tutorial reads:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;This view now&amp;lt;/strong&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;verifies if the model has no error;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;&amp;lt;em&amp;gt;&amp;lt;strong&amp;gt;adds two javascript files;&amp;lt;/strong&amp;gt;&amp;lt;/em&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;injects javascript translation using the Joomla JText::script function. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I believe the statement &amp;amp;quot;adds two javascript files;&amp;amp;quot;, is incorrect. One javascript file has been added (submitbutton.js), and the second javascript file is added in the next step in the getScript function, (helloworld.js).&lt;br /&gt;
&lt;br /&gt;
Am I correct on this? If so, I can see where sometimes one might want to use both methods to add scripts, but it seems to only be for demonstration purposes here since it seems both scripts could be added by either method.&lt;/div&gt;</summary>
		<author><name>Neo314</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Adding_language_management&amp;diff=79399</id>
		<title>Archived talk:Developing a MVC Component/Adding language management</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Adding_language_management&amp;diff=79399"/>
		<updated>2012-12-26T06:30:06Z</updated>

		<summary type="html">&lt;p&gt;Neo314: /* Adding translation when installing the component */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There also needs to be a language translation for the ADMIN Menu. Otherwise, the admin menu will only show the menu-item aliases [http://forum.joomla.org/viewtopic.php?f=579&amp;amp;t=537438 See Forum thread].&lt;br /&gt;
&lt;br /&gt;
The specification of the admin menu for the component in the installation manifest would look something like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;menu&amp;gt;com_hello&amp;lt;/menu&amp;gt;&lt;br /&gt;
&amp;lt;submenu&amp;gt;&lt;br /&gt;
	&amp;lt;menu controller=&amp;quot;features&amp;quot;&amp;gt;com_hello_greetings&amp;lt;/menu&amp;gt;&lt;br /&gt;
	&amp;lt;menu controller=&amp;quot;config&amp;quot;&amp;gt;com_hello_config&amp;lt;/menu&amp;gt;&lt;br /&gt;
&amp;lt;/submenu&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we would add an additional language file to the installation manifest called &#039;&#039;&#039;en-GB.com_hello.sys.ini&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;languages folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
       &amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.menu.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
       &amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.com_helloworld.sys.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;/languages&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this new language file would look like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
COM_HELLO=Hello World!&lt;br /&gt;
COM_HELLO_GREETINGS=Manage Greetings&lt;br /&gt;
COM_HELLO_CONFIG=Configuration&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding translation when installing the component ==&lt;br /&gt;
&lt;br /&gt;
This section is unclear to me. It reads, &amp;quot;With your favorite file manager and editor, put a file EXTENSIONROOT/language/en-GB/en-GB.myextension.sys.ini. This file will contain translation for the install.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In the tutorial on making extensions, most everything is in site/... or admin/... so there is no folder called com_helloword/... com_helloworld is created automatically, so where in the package should EXTENSIONROOT/language/en-GB/en-GB.myextension.sys.ini go?&lt;br /&gt;
&lt;br /&gt;
Earlier in the tutorial, there is already a sys.ini created in the admin directory with different content, and all the tutorial references are to the extension being made (e.g. the file would be named en-GB.com_helloworld.sys.ini not en-GB.myextension.sys.ini and the file does not appear in the package list. The package list also contains a file called language/en-GB/en-GB.ini which does not appear to be in the tutorial and does not link to any content.&lt;br /&gt;
&lt;br /&gt;
I think this portion needs some clarification.&lt;br /&gt;
&lt;br /&gt;
--[[User:Neo314|Neo314]] ([[User talk:Neo314|talk]]) 00:30, 26 December 2012 (CST)&lt;/div&gt;</summary>
		<author><name>Neo314</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Basic_backend&amp;diff=79369</id>
		<title>Archived talk:Developing a MVC Component/Basic backend</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Developing_a_MVC_Component/Basic_backend&amp;diff=79369"/>
		<updated>2012-12-24T08:09:26Z</updated>

		<summary type="html">&lt;p&gt;Neo314: /* How to access backend component &amp;amp; task icons not displaying */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Items to be adding/changed on this page:&lt;br /&gt;
&lt;br /&gt;
TODO: Model needs getPagination method&lt;br /&gt;
&lt;br /&gt;
Note that if using core J! javascript in a form, id=&amp;quot;adminForm&amp;quot; must also be included.&lt;br /&gt;
&lt;br /&gt;
Shouldn&#039;t references to $db-&amp;gt;getDBO() be changed to $db-&amp;gt;getDbo() ?&lt;br /&gt;
&lt;br /&gt;
And what is this comment referring to?  &amp;quot;The _populateState method is, by default, automatically called when a state is read by the getState method.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[User:Radiant tech|Radiant tech]] 06:37, 1 September 2011 (CDT)&lt;br /&gt;
&lt;br /&gt;
== Admin Forms in J2.5 ==&lt;br /&gt;
&lt;br /&gt;
Aparently, for the JToolbar Icons to work properly in J2.5, the form elements need the id &amp;quot;adminForm&amp;quot; to be assigned to them. I changed this in &#039;&#039;admin/views/helloworlds/tmpl/default.php&#039;&#039;. However, it also needs to be changed in the packages...&lt;br /&gt;
&lt;br /&gt;
== JController::display ==&lt;br /&gt;
The function declaration has been changed from &lt;br /&gt;
&lt;br /&gt;
public function display($cachable=false)&lt;br /&gt;
&lt;br /&gt;
TO&lt;br /&gt;
&lt;br /&gt;
public function display($cachable=false,$urlparams=false)&lt;br /&gt;
&lt;br /&gt;
== How to access backend component &amp;amp; task icons not displaying ==&lt;br /&gt;
&lt;br /&gt;
The tutorial is unclear on how to access the backend component.  I believe it would be helpful to explain that the component can be accessed in 2 ways:&lt;br /&gt;
&lt;br /&gt;
1) URL e.g. &lt;br /&gt;
http://localhost/joomla/administrator/index.php?option=com_helloworld&lt;br /&gt;
&lt;br /&gt;
2) The &amp;quot;hello-world&amp;quot; menu item under &amp;quot;Components&amp;quot; of the Administration application&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I believe it would also be helpful to note that this component only does 2 things:&lt;br /&gt;
&lt;br /&gt;
a) lists the two options stored in the database: id 1 (Hello World!) and id2 (Good bye World!)&lt;br /&gt;
&lt;br /&gt;
b) allows us to use checkboxes to select one or both options before selecting a task from the toolbar&lt;br /&gt;
&lt;br /&gt;
But this model does not give us a toolbar (i.e. the toolbar is empty without icons) so that we can not do anything with the option item(s) we select.  So I can &amp;quot;check&amp;quot; id 1 (Hello World!) and/or id2 (Good bye World!), but then cannot &amp;quot;Delete&amp;quot; them or &amp;quot;Edit&amp;quot; them since there are no task icons.  &lt;br /&gt;
&lt;br /&gt;
It was also not clear to me that the option items we create with this backend component are the options that will then be available in the &amp;quot;Required Settings&amp;quot; section when Editing a Menu Item.  i.e. when I add a Menu Item and select &amp;quot;Menu Item Type&amp;quot;: &amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot; (part 06 site component), the &amp;quot;Required Settings&amp;quot; drop-down box will contain the options that were created/edited with this backend component (well, at least that WILL be the case when we have a toolbar that gives us a &amp;quot;New&amp;quot; and &amp;quot;Delete&amp;quot; task icons which Part 09 shows us how to do)&lt;br /&gt;
SAbboushi 6/25/2012&lt;br /&gt;
&lt;br /&gt;
I would find it helpful if JHtml::_ were explained in a little more detail. In particular an explanation of the parameter &#039;grid.id&#039; might help to understand the code rather than just copy and trust.&lt;br /&gt;
&lt;br /&gt;
[[User:Neo314|Neo314]] ([[User talk:Neo314|talk]]) 02:09, 24 December 2012 (CST)&lt;br /&gt;
&lt;br /&gt;
== Populatestate ==&lt;br /&gt;
I&#039;m not sure on how to add to the discussion.&lt;br /&gt;
&lt;br /&gt;
The weird comment here about _populateState() seems to be the introduction to a paragraph about this method; from my understanding, what it will do is be able to select specific fields, limits, additional where clauses,etc (Say, I want this table to display things only from a specific category - that should be done with populate state, it seems).&lt;br /&gt;
&lt;br /&gt;
Taken from com_content/site/models/articles.php if you were wondering,that&#039;s what i can read there.&lt;/div&gt;</summary>
		<author><name>Neo314</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Using_the_database&amp;diff=79368</id>
		<title>Archived:Developing a MVC Component/Using the database</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived:Developing_a_MVC_Component/Using_the_database&amp;diff=79368"/>
		<updated>2012-12-24T07:38:31Z</updated>

		<summary type="html">&lt;p&gt;Neo314: After following the tutorial failed, I found this to be the problem.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version/tutor|2.5}}&lt;br /&gt;
{{Chunk:Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Contents}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This tutorial is part of the [[Developing a Model-View-Controller (MVC) Component for Joomla!2.5]] tutorial. You are encouraged to read the previous parts of the tutorial before reading this.&lt;br /&gt;
&lt;br /&gt;
== Using the database ==&lt;br /&gt;
Components usually manage their contents using the database. During the install/uninstall/update phase of a component, you can execute SQL queries through the use of SQL text files.&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor create two files called &#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039; and &#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;. 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;
&#039;&#039;admin/sql/install.mysql.utf8.sql&#039;&#039; and &#039;&#039;admin/sql/updates/mysql/0.0.6.sql&#039;&#039;&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;
   PRIMARY KEY  (`id`)&lt;br /&gt;
) ENGINE=MyISAM AUTO_INCREMENT=0 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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The file &#039;&#039;install.mysql.utf8.sql&#039;&#039; 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 NO 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 &#039;&#039;helloworld.xml&#039;&#039; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;helloworld.xml&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;helloworld.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;extension type=&amp;quot;component&amp;quot; version=&amp;quot;2.5.0&amp;quot; method=&amp;quot;upgrade&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World!&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;!-- The following elements are optional and free of formatting constraints --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;November 2009&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;John Doe&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;john.doe@example.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://www.example.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;Copyright Info&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;License Info&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;!--  The version string is recorded in the components table --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.0.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 in 2.5 --&amp;gt;&lt;br /&gt;
		&amp;lt;schemas&amp;gt;&lt;br /&gt;
			&amp;lt;schemapath type=&amp;quot;mysql&amp;quot;&amp;gt;sql/updates/mysql&amp;lt;/schemapath&amp;gt;&lt;br /&gt;
		&amp;lt;/schemas&amp;gt;&lt;br /&gt;
	&amp;lt;/update&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!-- Site Main File Copy Section --&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
		to copy FROM in the package to install therefore files copied&lt;br /&gt;
		in this section are copied from /site/ in the package --&amp;gt;&lt;br /&gt;
	&amp;lt;files folder=&amp;quot;site&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;controller.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;views&amp;lt;/folder&amp;gt;&lt;br /&gt;
		&amp;lt;folder&amp;gt;models&amp;lt;/folder&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;administration&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Menu Section --&amp;gt;&lt;br /&gt;
		&amp;lt;menu&amp;gt;Hello World!&amp;lt;/menu&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Administration Main File Copy Section --&amp;gt;&lt;br /&gt;
		&amp;lt;!-- Note the folder attribute: This attribute describes the folder&lt;br /&gt;
			to copy FROM in the package to install therefore files copied&lt;br /&gt;
			in this section are copied from /admin/ in the package --&amp;gt;&lt;br /&gt;
		&amp;lt;files folder=&amp;quot;admin&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;!-- Admin Main File Copy Section --&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;filename&amp;gt;helloworld.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
			&amp;lt;!-- SQL files section --&amp;gt;&lt;br /&gt;
			&amp;lt;folder&amp;gt;sql&amp;lt;/folder&amp;gt;&lt;br /&gt;
			&amp;lt;!-- 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;
Do the same for the uninstall file:&lt;br /&gt;
&lt;br /&gt;
With your favorite file manager and editor put a file &#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039; 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;
&#039;&#039;admin/sql/uninstall.mysql.utf8.sql&#039;&#039;&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;
== Adding a new field type ==&lt;br /&gt;
For the moment, we have used a [[Developing_a_Model-View-Controller_%28MVC%29_Component_for_Joomla!2.5_-_Part_03|hard coded field type for messages]]. We need to use our database for choosing the message.&lt;br /&gt;
&lt;br /&gt;
Modify the &#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039; 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;
&#039;&#039;site/views/helloworld/tmpl/default.xml&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;metadata&amp;gt;&lt;br /&gt;
	&amp;lt;layout title=&amp;quot;COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;message&amp;gt;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 &#039;&#039;/administrator/components/com_helloworld/models/fields&#039;&#039; 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;
&#039;&#039;admin/models/fields/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die;&lt;br /&gt;
&lt;br /&gt;
// import the list field type&lt;br /&gt;
jimport(&#039;joomla.form.helper&#039;);&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;
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;
		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;
		$options = array_merge(parent::getOptions(), $options);&lt;br /&gt;
		return $options;&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;
== Display the chosen message ==&lt;br /&gt;
When a menu item of this component is created/updated, Joomla stores the identifier of the message. The &#039;&#039;HelloWorldModelHelloWorld&#039;&#039; model has now to compute the message according to this identifier and the data stored in the database.&lt;br /&gt;
&lt;br /&gt;
Modify the &#039;&#039;site/models/helloworld.php&#039;&#039; file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;site/models/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;site/models/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access to this file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import Joomla modelitem library&lt;br /&gt;
jimport(&#039;joomla.application.component.modelitem&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * HelloWorld Model&lt;br /&gt;
 */&lt;br /&gt;
class HelloWorldModelHelloWorld extends JModelItem&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * @var array messages&lt;br /&gt;
	 */&lt;br /&gt;
	protected $messages;&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Returns a reference to the a Table object, always creating it.&lt;br /&gt;
	 *&lt;br /&gt;
	 * @param	type	The table type to instantiate&lt;br /&gt;
	 * @param	string	A prefix for the table class name. Optional.&lt;br /&gt;
	 * @param	array	Configuration array for model. Optional.&lt;br /&gt;
	 * @return	JTable	A database object&lt;br /&gt;
	 * @since	2.5&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;
	 * Get the message&lt;br /&gt;
	 * @param  int    The corresponding id of the message to be retrieved&lt;br /&gt;
	 * @return string The message to be displayed to the user&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;
			$id = JRequest::getInt(&#039;id&#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;
&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 &#039;&#039;admin/tables/helloworld.php&#039;&#039; file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;admin/tables/helloworld.php&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;admin/tables/helloworld.php&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// No direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
// import Joomla table library&lt;br /&gt;
jimport(&#039;joomla.database.table&#039;);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Hello Table class&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 object 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;
&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;
== Packaging the component ==&lt;br /&gt;
&lt;br /&gt;
Content of your code directory&lt;br /&gt;
* &#039;&#039;[[#helloworld.xml|helloworld.xml]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/helloworld.php|site/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/controller.php|site/controller.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|site/views/helloworld/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_04#site/views/helloworld/view.html.php|site/views/helloworld/view.html.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#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;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_02#site/views/helloworld/tmpl/default.php|site/views/helloworld/tmpl/default.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#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;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#admin/helloworld.php|admin/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#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;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/sql/updates/mysql/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#admin/sql/updates/mysql/0.0.1.sql|admin/sql/updates/mysql/0.0.1.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/sql/install.mysql.utf8.sql|admin/sql/updates/mysql/0.0.6.sql]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/models/fields/index.html]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[#admin/models/fields/helloworld.php|admin/models/fields/helloworld.php]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;[[Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5_-_Part_01#index.html|admin/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;
Create a compressed file of this directory or directly download the [http://joomlacode.org/gf/download/frsrelease/11394/58405/com_helloworld-1.6-part06.zip archive] and install it using the extension manager of Joomla. You can add a menu item of this component using the menu manager in the backend.&lt;br /&gt;
&lt;br /&gt;
Note: site/models/helloworld.php is not up-to-date as mentioned on this page. You need to copy the code yourself.&lt;br /&gt;
&lt;br /&gt;
== Navigate ==&lt;br /&gt;
&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 05|Prev: Adding a variable request in the menu type]]&lt;br /&gt;
[[Developing a Model-View-Controller (MVC) Component for Joomla!2.5 - Part 07|Next: Basic backend]]&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
*[[User:cdemko|Christophe Demko]]&lt;br /&gt;
*[[User:oaksu|Ozgur Aksu]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Joomla! 1.6]]&lt;br /&gt;
[[Category:Joomla! 1.7]]&lt;br /&gt;
[[Category:Joomla! 2.5]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Italic text&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Neo314</name></author>
	</entry>
</feed>