User Rating: 2 / 5

Star ActiveStar ActiveStar InactiveStar InactiveStar Inactive
 
Controller 

Named Component class contains the name followed by the word Controller, and culminating with the file name. 

For example, create a file named cpanel.php in Component Name com_helloworld class names are equal.

HelloworldControllerCpanel

<?php
defined('_JEXEC') or die('Restricted access');
class HelloworldControllerCpanel extends JControllerLegacy
{
   ...
}
?>

class that extends the generated class Controller of Joomla in this example uses the class name JControllerLegacy. Also, if you use the additional capacity could be used like any other class JControllerAdmin JControllerForm.

 

Model 

The class name contains the name followed by the word Component Model and culminating with the file name. 

For example, create a file named cpanel.php in Component Name com_helloworld class names are equal.

HelloworldModelCpanel

<?php
defined('_JEXEC') or die('Restricted access');
class HelloworldModelCpanel extends JControllerLegacy
{
   ...
}
?>

 

Create a class that extends the class Model are examples of Joomla to use class names JModelLegacy Also, if you use the additional capacity could be used like any other class JModelAdmin JModelForm JModelList JModelItem.

 

View 

Named Component class contains the name followed by the word View, and end with the file name. 

For example, create a file named cpanel.php in Component Name com_helloworld class names are equal. 

HelloworldViewCpanel

<?php
defined('_JEXEC') or die('Restricted access');
class HelloworldViewCpanel extends JControllerLegacy
{
   ...
}
?>

 

class that extends the generated class View of Joomla in this example uses the class name JViewLegacy Also, if you use the additional capacity could be used like any other class JViewHtml JViewBase.

 

 

Chapter 8 - Building Basic Component