浏览代码

helium twig

me@helium 7 年之前
父节点
当前提交
2c6078ed41
共有 3 个文件被更改,包括 16 次插入1 次删除
  1. 3 1
      README.md
  2. 3 0
      TemplateEngine/templates/index.tpl
  3. 10 0
      TemplateEngine/twig_test.php

+ 3 - 1
README.md

@@ -1,3 +1,5 @@
 # ER-SQL
 
-ER && SQL part of PHP Advanced
+ER && SQL part of PHP Advanced
+
+

+ 3 - 0
TemplateEngine/templates/index.tpl

@@ -0,0 +1,3 @@
+<html>
+<a href="{{ url }}">{{ urlText }}</a>
+</html>

+ 10 - 0
TemplateEngine/twig_test.php

@@ -0,0 +1,10 @@
+<?php
+require_once '/usr/share/php/Twig/Autoloader.php';
+Twig_Autoloader::register();
+$loader = new Twig_Loader_Filesystem('templates/');
+$twig = new Twig_Environment($loader, array(
+			'cache' => '/tmp/',
+			));
+
+echo $twig->render('index.tpl', array('url' => 'http://google.com',
+			'urlText' => 'Гугл'));