Vous êtes connecté en tant que anonymous Se Deconnecter
Browse code

Ajout de l'application

git authored on 15/03/2019 11:49:20
Showing 1 changed files
... ...
@@ -16,13 +16,23 @@ class Vue{
16 16
 
17 17
 		ob_start();
18 18
         require CONTROLLER_PATH.DIRECTORY_SEPARATOR.$name.'.php';
19
-        require VIEW_PATH.DIRECTORY_SEPARATOR.$name.'.phtml';
20
-		$this->block_body = ob_get_clean();
19
+        $loader = new \Twig\Loader\FilesystemLoader(VIEW_PATH);
20
+        $twig = new \Twig\Environment($loader, array(
21
+            'cache' => INCLUDE_PATH.DIRECTORY_SEPARATOR.'cache',
22
+            'auto_reload' => true,
23
+            'autoescape' => true
24
+        ));
25
+        $template = $twig->load("$name.html.twig");
26
+        $twig_var['page_title'] = $page_title;
27
+        $twig_var['description'] = $description;
21 28
 
22
-		ob_start();
23
-		require LAYOUT_PATH.DIRECTORY_SEPARATOR."standard.phtml";
29
+        echo $template->render($twig_var);
24 30
 		$this->ecran = ob_get_clean();
25 31
 
32
+		/*ob_start();
33
+		require LAYOUT_PATH.DIRECTORY_SEPARATOR."standard.phtml";
34
+		$this->ecran = ob_get_clean();*/
35
+
26 36
 	}
27 37
 	
28 38
 }
Browse code

initial commmit de la branche Nude with composer

git authored on 14/03/2019 16:48:02
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,28 @@
1
+<?php
2
+
3
+namespace MVC\Classe;
4
+
5
+define( "LAYOUT_PATH" , APPLICATION_PATH . DIRECTORY_SEPARATOR . "layout");
6
+
7
+
8
+class Vue{
9
+	
10
+	public $ecran;
11
+	public $block_body;
12
+	
13
+	public function __construct($baseControlleur){
14
+		
15
+		extract( $baseControlleur->modele->page );
16
+
17
+		ob_start();
18
+        require CONTROLLER_PATH.DIRECTORY_SEPARATOR.$name.'.php';
19
+        require VIEW_PATH.DIRECTORY_SEPARATOR.$name.'.phtml';
20
+		$this->block_body = ob_get_clean();
21
+
22
+		ob_start();
23
+		require LAYOUT_PATH.DIRECTORY_SEPARATOR."standard.phtml";
24
+		$this->ecran = ob_get_clean();
25
+
26
+	}
27
+	
28
+}