日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

php smarty模板引擎 性能,smarty性能低?直接使用php模板引擎吧

發布時間:2023/11/27 生活经验 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 php smarty模板引擎 性能,smarty性能低?直接使用php模板引擎吧 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

skymvc框架使用的php模板引擎

1.[代碼][PHP]代碼

class smarty{

public $template_dir = '';//模版文件夾

public $cache_dir = '';//緩存文件夾

public $compile_dir = '';//編譯文件夾

public $html_dir='';//生成靜態文件夾

public $htm_lfile="";

public function __construct(){

}

public function goAssign($tpl_var, $value = ''){

if(get('ajax')){

skymvc_test_page_auto();

C()->goALL("success",0,$tpl_var);

}else{

$this->assign($tpl_var,$value);

}

}

public function assign($tpl_var, $value = '')

{

if (is_array($tpl_var))

{

foreach ($tpl_var AS $key => $val)

{

if ($key != '')

{

$this->_var[$key] = $val;

}

}

}

else

{

if ($tpl_var != '')

{

$this->_var[$tpl_var] = $value;

}

}

}

public function display($filename, $cache_id = ''){

$out = $this->fetch($filename, $cache_id);

if(function_exists("shouQuanTpl")){

$out=shouQuanTpl($out);

}

if($this->html_file){

$this->umkdir(dirname($this->html_file));

file_put_contents($this->html_file,$out);

}

echo $out;

}

public function html($htmlfile,$expire=3600){

$file=$this->html_dir."/".$htmlfile;

$this->html_file=$file;

}

public function fetchhtml($str){

return $str;

}

public function fetch($filename, $cache_id = '',$dir=""){

ob_start();

extract($this->_var);

require $this->template_dir."/".$filename;

$out=ob_get_contents();

ob_end_clean();

return $out;

}

public function is_cached($filename, $cache_id = ''){

return true;

}

public function umkdir($dir){

mkdir($dir,0777,true);

}

}

?>

總結

以上是生活随笔為你收集整理的php smarty模板引擎 性能,smarty性能低?直接使用php模板引擎吧的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。