Some basic MVC component questions

For Joomla! 3.x Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Post Reply
adams1
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Fri May 12, 2017 7:34 am

Some basic MVC component questions

Post by adams1 » Sun May 12, 2019 5:17 pm

Hi,

I'm examining the Joomla basic MVC component example and have some questions:

In this PHP line:

Code: Select all

JTable::getInstance($type, $prefix, $config); 
What exactly is $type (beside the name of the table)? What is it exactly used for? In the table definition file\class there is also a table name given in the constructor when calling the JTable parrent class constructor.

$prefix means the class prefix, which is in the table definition .php file?

Furthermore:

Code: Select all

$jinput = JFactory::getApplication()->input;
$id     = $jinput->get('id', 1, 'INT');
"->get()" Which kind of input is accessed this way (i.e. $_GET, $_POST, cookies or sg. else)?

adams1
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Fri May 12, 2017 7:34 am

Re: Some basic MVC component questions

Post by adams1 » Sun May 12, 2019 7:24 pm

Addition:

Why "site/views/helloworld/tmpl/default.xml" tells that where the field definition is ("addfieldpath="/administrator/components/com_helloworld/models/fields") when it will be seen on the admin interface of Joomla (in this case of the online basic tutorial)?

Thank you!


Post Reply

Return to “Joomla! 3.x Coding”