I've been trying to learn how to build a Joomla component.
I've been using http://joomlaprogrammingbook.com/ book which is great. I can now do plugins and modules without too much of a problem. However I'm getting stuck with how certain controllers get loaded for components. The site given has the full code if it's needed.
The initial controller loaded is:
class JoomproSubsController extends JController
{
/**
* @var string The default view.
* @since 1.6
*/
protected $default_view = 'submanager';
/**
* Method to display a view.
*
* @param boolean $cachable If true, the view output will be cached
* @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
* @return JController This object to support chaining.
*/
public function display($cachable = false, $urlparams = false)
{
JLoader::register('JoomproSubsHelper', JPATH_COMPONENT.'/helpers/joomprosubs.php');
// Load the submenu.
JoomproSubsHelper::addSubmenu(JRequest::getCmd('view', 'submanager'));
$view = JRequest::getCmd('view', 'submanager');
$layout = JRequest::getCmd('layout', 'default');
$id = JRequest::getInt('id');
// Check for edit form.
if ($view == 'subscription' && $layout == 'edit' && !$this->checkEditId('com_joomprosubs.edit.subscription', $id)) {
// Somehow the person just went to the form - we don't allow that.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(JRoute::_('index.php?option=com_joomprosubs&view=submanager', false));
return false;
}
parent::display();
return $this;
}
}
I can see how and when this is loaded. However at some point in this it also seems to load class JoomproSubsControllerSubManager extends JControllerAdmin
now I though that to do this it would need a url which included com_joomproSubs?task=submanager
but that doesn't exist. So my question is how can this happen?