Home > Backend Development > PHP Tutorial > 小弟我这个smarty配置如何了

小弟我这个smarty配置如何了

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 13:43:51
Original
906 people have browsed it

我这个smarty配置怎么了
目录结构如下: smarty_pro1
  ---libs
  ---config
  ---templates (这里放了个,index.tpl)
  ---templates_c
  ---cache
  index.php

index.php 里的内容为
define('SMARTY_PATH','../smarty_pro1/');
include_once(SMARTY_PATH.'libs/Smarty.class.php');

$smarty=new Smarty();

$smarty->template_dir= SMARTY_PATH.'templates/';
$smarty->compile_dir= SMARTY_PATH.'templates_c/';
$smarty->config_dir= SMARTY_PATH.'configs/';
$smarty->cache_dir= SMARTY_PATH.'cache/';

$smarty->left_delimiter='{';
$smarty->right_delimiter='}';
$smarty->assign('title','测试一下');
$smarty->assign('content','内容');
$smarty->display('index.tpl');


?>

index.tpl内容为





{ $title }



{ $content }



涓轰
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
smarty turns on caching garbled characters
From 1970-01-01 08:00:00
0
0
0
Why does tp use smarty template? ?
From 1970-01-01 08:00:00
0
0
0
How do you use smarty to integrate laravel5?
From 1970-01-01 08:00:00
0
0
0
Two ways to install smarty
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template