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 %} +

+ {{valor}} +

+

+ Estamos aprendiendo en san jaun tec +

+{% endblock %} \ No newline at end of file diff --git a/views/base.twig b/views/base.twig deleted file mode 100644 index b835ef5..0000000 --- a/views/base.twig +++ /dev/null @@ -1,115 +0,0 @@ - - - - - Tambo 2021 - - - {% block stylesheets %} - - - - - - - - - - - - - - - - - - - - - - {% endblock %} - - - - - - -
- - {% block header %} -
- - - - - {% endblock %} -
- - - -
- - - - - - - - -
- -
- {% block content %} - - {% endblock %} -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/views/ejemplo.html b/views/ejemplo.html new file mode 100644 index 0000000..56efbdb --- /dev/null +++ b/views/ejemplo.html @@ -0,0 +1,12 @@ + + + + + + + Document + + + + + \ No newline at end of file diff --git a/views/home.twig b/views/home.twig index 0c99bf3..466650c 100644 --- a/views/home.twig +++ b/views/home.twig @@ -1,7 +1,6 @@ -

-{{saludo}} -

- -

-Dia {{fecha[0]}} Mes {{fecha[1]}} Año {{fecha[2]}} -

\ No newline at end of file +{% extends "padre.twig" %} +{% block seccion %} + {% for alumno in listadoAlumnos %} +
{{alumno}}
+ {% endfor %} +{%endblock%} diff --git a/views/padre.twig b/views/padre.twig new file mode 100644 index 0000000..7c3fa57 --- /dev/null +++ b/views/padre.twig @@ -0,0 +1,17 @@ + + + + Document + + +
San Juan Tec
+

+ esto pertenece a la vista padre +

+ + {%block contenido %} + {%endblock%} + + + + \ No newline at end of file