PHP SMARTY 简单配置
2009-08-02 10:10
405 查看
PHP SMARTY 简单配置##########################################################
1 首先 --------下载:
下载地址:http://www.smarty.net/download.php
文档下载地址:http://www.smarty.net/download-docs.php
2 然后 ---------安装:
1)解压文件后,复制libs文件到网站根目录,改名为smarty;
2)在根目录新建四个文件夹:templates,templates_c,configs,cache;
3 最后 ----------是测试了哦:
1)建个php文件:text.php
<?php
include_once('smarty/Smarty.class.php');
include_once('smarty/Config_File.class.php');
include_once('smarty/Smarty_Compiler.class.php');
$smarty = new Smarty;
$smarty->template_dir = 'templates/'; //模板存放目录
$smarty->compile_dir = 'templates_c/'; //编译目录 $smarty -> left_delimiter = "<{"; //左定界符
$smarty -> right_delimiter = "}>"; //右定界符
$smarty -> assign('name','OK,成功了,OO~:)'); $smarty->assign('title','古月第一次来看看PHP SMARTY 配置!!');
$smarty -> display('index.tpl');
?>
2)在templates下,建个tpl文件:index.tpl
<html>
<head><title><{$title}></head></title>
<body><{$name}></body>
</html>
3)运行test.php, 配置成功。
#########################################################
1 首先 --------下载:
下载地址:http://www.smarty.net/download.php
文档下载地址:http://www.smarty.net/download-docs.php
2 然后 ---------安装:
1)解压文件后,复制libs文件到网站根目录,改名为smarty;
2)在根目录新建四个文件夹:templates,templates_c,configs,cache;
3 最后 ----------是测试了哦:
1)建个php文件:text.php
<?php
include_once('smarty/Smarty.class.php');
include_once('smarty/Config_File.class.php');
include_once('smarty/Smarty_Compiler.class.php');
$smarty = new Smarty;
$smarty->template_dir = 'templates/'; //模板存放目录
$smarty->compile_dir = 'templates_c/'; //编译目录 $smarty -> left_delimiter = "<{"; //左定界符
$smarty -> right_delimiter = "}>"; //右定界符
$smarty -> assign('name','OK,成功了,OO~:)'); $smarty->assign('title','古月第一次来看看PHP SMARTY 配置!!');
$smarty -> display('index.tpl');
?>
2)在templates下,建个tpl文件:index.tpl
<html>
<head><title><{$title}></head></title>
<body><{$name}></body>
</html>
3)运行test.php, 配置成功。
#########################################################
相关文章推荐
- 微信开发环境配置以及开发基础PHP简单说明
- Centos 6.3下配置简单php运行站点
- php smarty 配置四个存放目录
- PHP.ini安全配置检测工具pcc简单介绍
- Linux下Nginx+PHP 简单安装配置
- php smarty 缓存和配置文件的基本使用方法
- 最简单的php二级域名配置
- 用PHP实现简单的控制反转(IOC) 依赖注入(DI),用JSON配置文件
- mac osx系统下 apache-php-mysql 简单配置 & 远程登录lnmp服务器简单操作
- Smarty3.1.18的配置和简单使用
- nginx+php 在windows下的简单配置安装
- php简单的smarty程序
- RH Linux 企业5+apache+mysql+php+phpmyadmin的简单配置.
- php简单smarty入门程序实例
- PHP Smarty 配置变量
- smarty+php+ajax 简单无刷新分页
- 最简单!阿里云服务器采用 LNMP一键安装包 配置 Linux+Nginx+Mysql+PHP
- windows下 简单配置PHP + apache +mysql
- [PHP]配置,使用Smarty技术 转自http://www.blueidea.com/tech/program/2006/3152.asp
- Win7系统配置PHP+MySQL+Apache简单几步