diff --git a/app/controllers/HomeController.php b/app/controllers/HomeController.php index 8f71bdb..70f8807 100644 --- a/app/controllers/HomeController.php +++ b/app/controllers/HomeController.php @@ -8,11 +8,20 @@ class HomeController extends BaseController { public function getHome() { - $fecha=explode(',',date('d,m,Y')); - - return $this->renderHTML('home.twig',['saludo'=>"Hola San Juan","fecha"=>$fecha]); + //$fecha=explode(',',date('d,m,Y')); + $alumnos=array('Federico','Fernando','Ismael','Ruben','David','Emmanuel'); + //$fecha=new Fecha(); + + return $this->renderHTML('home.twig' , ['listadoAlumnos'=>$alumnos]); } + public function getAyuda() + { + // return view('home',[]); + $nombre="ayuda"; + + return $this->renderHTML('ayuda.twig' , ["valor"=>$nombre]); + } } ?> \ No newline at end of file diff --git a/public/index.php b/public/index.php index 379c398..5b38de1 100644 --- a/public/index.php +++ b/public/index.php @@ -41,9 +41,9 @@ ); $mapa = $contenedorDeRutas->getMap(); -//--Login----------------------------------------------------------------------------------------------------------------- -$mapa->get('home', '/sistematec/home', ['controller' => 'App\controllers\HomeController', 'action' => 'getHome']); +$mapa->get('home', '/mvc/', ['controller'=>'App\controllers\HomeController', 'action'=> 'getHome']); +$mapa->get('ayuda','/mvc/ayuda',['controller'=>'App\controllers\HomeController','action'=> 'getAyuda'] ); //------Mach whit route------------- $matcher = $contenedorDeRutas->getMatcher(); diff --git a/views/ayuda.twig b/views/ayuda.twig new file mode 100644 index 0000000..b919799 --- /dev/null +++ b/views/ayuda.twig @@ -0,0 +1,10 @@ +{% extends 'padre.twig' %} + +{% block contenido %} +