社区
基础编程
帖子详情
smarty的问题???
qklove_1
2005-10-20 12:00:16
$tpl->display('xd_3.tpl');
这个是调用模板并显示,smarty有没有只调用模板不显示的函数呀??
...全文
87
5
打赏
收藏
smarty的问题???
$tpl->display('xd_3.tpl'); 这个是调用模板并显示,smarty有没有只调用模板不显示的函数呀??
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
Einar
2005-10-20
打赏
举报
回复
把生成静态页面的程序存放在一个文件中,action到这个文件就行了
qklove_1
2005-10-20
打赏
举报
回复
这个方法我用了,我想生成静态的页面但每次跳转时都把页面内容显示一下才跳转,我不想让他显示
ob_start();
$tpl -> display('xd_3.tpl');//显示模板
$buffer = ob_get_contents();
$path="../new/".$arr[date];
mkdir($path,"0777");
$fp = fopen("$path/$arr[id].html","w");
fwrite($fp,$buffer);
$buffer="";
ob_end_flush();
fclose($fp);
echo "<META HTTP-EQUIV=Refresh CONTENT='0;url=new_list.php?id=$_GET[node_id]'>";
piner
2005-10-20
打赏
举报
回复
你可以用缓存
ob_start();
$tpl->display('xd_3.tpl');
ob_end_clean()
helloyou0
2005-10-20
打赏
举报
回复
看这边的例子即可
http://smarty.php.net/manual/en/api.fetch.php
不用使用ob
---
另,用ob的时候用ob_end_clean()代替ob_end_flush()即可不显示一下
helloyou0
2005-10-20
打赏
举报
回复
fetch
smarty
3 的应用详解
基本文件文件结构 index.php /libs/
Smarty
.class.php #主文件 /libs/sysplugins/ #内部plugin internal.* /plugins/ #外部plugin,可自由扩充 function.mailto.php modifier.escape.php /templates/ #模板,可以是纯php或传统的
smarty
模板 index.tpl index_view.php一个经典的
smarty
调用 代码片断: require('
Smarty
.class.php'); $
smarty
=new
Smarty
; $
smarty
->assign('foo','bar'); $
smarty
->display('index.tpl'); 和之前的版本似乎没什么差别 SINGLETON 这个有意义吗? 代码片断: $
smarty
=
Smarty
::instance(); 模板 之前的
smarty
模板,相当于重新定义了一套标签语言,那么
smarty
3提供了一种新的模板形式,直接支持php语法的模板。 但是
问题
就出来了,我们还有必要用模板吗? 引用php类型模板的一个例子: 代码片断: $
smarty
->display('php:mytemplate.tpl'); 模板中可以直接使用熟悉的语法: =$foo?> =$bar?> 使用php类型模板的话,安全
问题
需要自己解决。但这个对成熟的团队来说不是
问题
。 除此之外,新支持字符串类型的模板,感觉比较生猛,离模板之路也是渐行渐远: 代码片断: $
smarty
->display('string:This is my template, {$foo}!');
smarty
3的相关链接
Smarty
3 Alpha with SVN-- 选择googlecode提供的svn服务还是蛮省钱的
smarty
3开发者邮件组
php手册、mysql手册、
smarty
手册、adodb手册
学习php手册大全,都是chm格式的啊 部分 前言 作者和贡献者 I. 入门指引 1. 简介 2. 简明教程 II. 安装与配置 3. 安装前需要考虑的事项 4. Unix 系统下的安装 5. Mac OS X 系统下的安装 6. Windows 系统下的安装 7. PECL 扩展库安装 8. 还有
问题
? 9. 运行时配置 ……php Table of Contents [内容列表] Preface [序] I. Getting Started [开始] 1. What is
Smarty
? [什么是Smaty?] 2. Installation [安装] Requirements [安装] Basic Installation [基本安装] Extended Setup [扩展设置] II.
Smarty
For Template Designers [模板设计者篇] 3. Basic Syntax [基本语法] Comments [注释] Functions [函数] Attributes [属性] Embedding Vars in Double Quotes [双引号里值的嵌入] Math [数学运算] 4. Variables [变量] ……
smarty
PHP
smarty
手册
Table of Contents [内容列表] Preface [序] I. Getting Started [开始] 1. What is
Smarty
? [什么是Smaty?] 2. Installation [安装] Requirements [安装] Basic Installation [基本安装] Extended Setup [扩展设置] II.
Smarty
For Template Designers [模板设计者篇] 3. Basic Syntax [基本语法] Comments [注释] Functions [函数] Attributes [属性] Embedding Vars in Double Quotes [双引号里值的嵌入] Math [数学运算] 4. Variables [变量] Variables assigned from PHP [从PHP分配的变量] Variables loaded from config files [从配置文件读取的变量] {$
smarty
} reserved variable [{$
smarty
}保留变量] 5. Variable Modifiers [变量调节器] ...
smarty
php手册
Smarty
- PHP 模板编译引擎 我们可以想象
smarty
应该有怎样的最后表现。我们知道php代码如果没有了模板解析的开销将有多快,我们也知道从一般的美工看来php语言是多么的"恐怖",然而这一切可以被一种更简单的模板语法掩饰掉。我们应该怎样把这两种方法的长处结合起来? 于是,
Smarty
诞生了......
smarty
手册
Table of Contents Preface I. Getting Started 1. What is
Smarty
? 2. Installation Requirements Basic Installation Extended Setup II.
Smarty
For Template Designers 3. Basic Syntax Comments Variables Functions Attributes Embedding Vars in Double Quotes Math Escaping
Smarty
Parsing 4. Variables Variables assigned from PHP Variables loaded from config files {$
smarty
} reserved variable 5. Variable Modifiers capitalize cat count_characters 。。。。。。。
基础编程
21,887
社区成员
140,364
社区内容
发帖
与我相关
我的任务
基础编程
从PHP安装配置,PHP入门,PHP基础到PHP应用
复制链接
扫一扫
分享
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章