<?php
/**
 * @version    CVS: 1.0.0
 * @package    Com_Prod
 * @author     Jose <satjaisat@gmail.com>
 * @copyright  2023 Jose
 * @license    Licencia Pública General GNU versión 2 o posterior. Consulte LICENSE.txt
 */

defined('_JEXEC') or die;

use \Joomla\CMS\Factory;
use \Joomla\CMS\MVC\Controller\BaseController;

// Include dependancies
jimport('joomla.application.component.controller');

JLoader::registerPrefix('Prod', JPATH_COMPONENT);
JLoader::register('ProdController', JPATH_COMPONENT . '/controller.php');

$controller = 'cProd'; //nombre del controlador
 $path = JPATH_COMPONENT.'/controllers/'.$controller.'.php';
 $input = Factory::getApplication()->input;  
  
	require_once($path);
	$classname = 'ProdController'.$controller;
	$controller = new $classname();
	if($input->get('task') !=''){$task = $input->get('task');}else{$task = 'default';}
 
   $controller->$task();