Hola @hhs, gracias por responder
Esa clase es llamada desde este archivo
Código PHP:
<?php spl_autoload_register(function($clase){include"$clase.php";});
# Probamos $_SERVER
#print('<pre>');print_r($_SERVER);print('</pre>');
# Definimos algunas constantes.
define('DS',DIRECTORY_SEPARATOR);
define('ROOT',realpath(dirname(__FILE__)).DS);
define('URL',dirname($_SERVER['PHP_SELF']));
# Definimos: Controlador, Modelo y Argumentos.
$args=array_filter(explode('/',filter_input(INPUT_GET,'url',FILTER_SANITIZE_URL)));
#print('<pre>'.$cont);print_r($args);print('</pre>');
$cont=strtolower(array_shift($args))?:'portada';
$metd=strtolower(array_shift($args))?:'index';
# Comprobamos que el Controlador es funcional.
$file=ROOT.'controller_'.$cont.'.php';
is_readable($file) ? require_once $file : exit('Controlador no disponible.') ;
# Comprobamos que el Metodo es funcioanl
$metd=method_exists(new $cont,$metd) ? $metd : 'error' ;
# Pasamos los parametos al Controlador.
#isset($args) ? call_user_func_array([$cont,$metd],$args) : call_user_func([$cont,$metd]) ;
call_user_func_array([$cont,$metd],$args);
?>
Tengo otro archivo que viene a ser una especie de core:
Código PHP:
<?php class html{
public function head($titulo){include'html'.DS.__FUNCTION__.'.phtml';}
public function foot(){include'html'.DS.__FUNCTION__.'.phtml';}
public function nav(){include'html'.DS.__FUNCTION__.'.phtml';}
public function card($figcaption,$img){include'html'.DS.__FUNCTION__.'.phtml';}
}