Location: PHPKode > scripts > Joomla MVC Classes > example/admin/hellos.php
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
JSubMenuHelper::addEntry(JText::_('Hello'), 'index.php?option=com_hellos&controller=hellos');
if($controller = JRequest::getWord('controller')) {
	$path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php';
	if (file_exists($path)) {
		require_once $path;
	} else {
		$controller = 'hellos';
	}
	$classname = 'HellosController'.$controller;
} else {
	$controller = 'hellos';
	$classname = 'HellosControllerHellos';
}
require_once( JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php' );
$controller = new $classname( );
$controller->execute( JRequest::getVar( 'task' ) );
$controller->redirect();
Return current item: Joomla MVC Classes