That one shall be controller.php, it is a master controller for your component. Please look at my document at
docs.joomla.org, it is about how controller works?
This is a normal dispatcher of component.
defined('_JEXEC') or die('Restricted access');
// Access check.
if (!JFactory::getUser()->authorise('core.manage', 'com_jongman')) {
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}
// import joomla controller library
jimport('joomla.application.component.controller');
// Get an instance of the controller prefixed by Jongman, assign default view 's name in case of no view or task
$controller = JController::getInstance('Jongman', array('default_view'=>'cpanel'));
// Perform the Request task, default task performed if none specified
$controller->execute(JRequest::getCmd('task'));
// Redirect if set by the controller
$controller->redirect();
Hi,
Thanks for reply,component name : mycomponent
I have already paste the code of
mycomponent.php
here it is
<?php
defined('_JEXEC') or die;
jimport('joomla.application.component.controller');
class mycomponentController extends JController
{
public function display($cachable = false)
{
$view = JRequest::getCmd('view', 'orders');
$layout = JRequest::getCmd('layout', 'default');
$id = JRequest::getInt('id');
parent::display($cachable);
//sub menu will start here
}
}
?>
Please confirm your post.