|
Project Information
Members
Featured
Downloads
Links
|
Sopily is a PHP Template Engine that is a good alternative of Smarty, it has following features:
It is easy and fast. Just try it. Related link: 中文版介紹 http://dev.sopili.net/2009/04/sopily-php-template-engine.html DemoMain Script: index.php $url='http://software.sopili.net/';
require_once('Sopily.class.php');
$sopily=new Sopily;
$sopily->template_dir="/home/www/sopily/demo";
$sopily->assign('url',$url);
$sopily->display('index_tpl.php');Template: index_tpl.php <?
require('header_tpl.php'); //relative path, indicated by $sopily->template_dir
?>
<h1>Demo</h1>
url is <?=$url?> <br>
url with modifier <?=$_escape($url)?> <br>
url with multiple modifier: <?=sopily($url,Array('default'=>'http://www.sopili.net >_<|||','escape'))?> <br>
url with multiple modifier2: <?=sopily($url,'default','http://www.sopili.net')?> <br>
url with multiple modifier3: <?=$_escape($url)?> <br>
url with multiple modifier4: <?=$_escape($url,'html')?> <br>
<?
require('footer_tpl.php');
?>BenchmarkGet memory usage by memory_get_usage(). Get per requests time by apache benchmark. Scripts were modified from Demo file of Smarty.
The structure of Sopily is simple, so it is the fastest one. |