smarty完全中文手册也就是smarty教程,smarty是比较常用的模板编译引擎,次手册包含模板设计者篇和模板程序员篇两个部分,从多方位分析了smarty的高级特点,用户彻底了解smarty的功能和使用方法,有需要的朋友可以下载参考。

手册简介:

smarty手册是php模板引擎的一个中文说明文档,当我们遇上了许多的技术难题的同时,“什么是模板应该做的,什么不该做”这个问题,也被热烈的讨论着。从这些经验,我们决定应该用Php将模板引擎写成一个类,让任何觉得合适的人使用它。所以我们写了一个引擎,从此就有了smarty.

常见问题解答

Smarty/PHP errors错误

Smarty can catch many errors such as missing tag attributes or malformed variable names. If this happens, you will see an error similar to the following:

Smarty能够发现许多类似缺少标签属性或者不规范变量名这样的错误。如果发生这种错误,就会有下面的错误提示:

Example 17-1. Smarty errors错误

Warning: Smarty: [in index.tpl line 4]: syntax error: unknown tag - '%blah'

in /path/to/smarty/Smarty.class.php on line 1041

警告:Smarty: 在index.tpl文件第4行,语法错误:'%blah'标签未知

Fatal error: Smarty: [in index.tpl line 28]: syntax error: missing section name

in /path/to/smarty/Smarty.class.php on line 1041

严重错误:Smarty: 在index.tpl文件第28行,语法错误:缺少节段名字在 /path/to/smarty/路径中的Smarty.class.php文件1041行

Smarty shows you the template name, the line number and the error. After that, the error consists of the actual line number in the Smarty class that the error occured.

Smarty可以显示模板名称以及行号和错误。这些错误显示未所发生错误所属的smarty类所在的实际行号。

There are certain errors that Smarty cannot catch, such as missing close tags. These types of errors usually end up in PHP compile-time parsing errors.

某些错误Smarty不能捕捉,像缺少结束标签。这些类型的错误通常会在在php分析语法错误的编译时间中就捕捉出来了.

Example 17-2. PHP parsing errors

Parse error: parse error in /path/to/smarty/templates_c/index.tpl.php on line 75

When you encounter a PHP parsing error, the error line number will correspond to the compiled PHP script, not the template itself. Usually you can look at the template and spot the syntax error. Here are some common things to look for: missing close tags for {if}{/if} or {section}{/section}, or syntax of logic within an {if} tag. If you can't find the error, you might have to open the compiled PHP file and go to the line number to figure out where the corresponding error is in the template.

当你遇到一个php解析错误时,错误行号将反应到php编译脚本,而不是模板本身。通常,你会看到模板并发现语法错误。通常会发现:缺少if}{/if} 或者

{section}{/section}的结束标签。或者{if}标签内的逻辑语法错误。如果你不能检查出错误,那就得在模板中打开php编译文件按照行号找出相应错误。

php smarty 手册下载,smarty教程相关推荐

  1. Windows环境下smarty安装最简明教程 分享

    记得去年写过一个windows+IIS的PHP4安装最简明教程,那天去baidu搜了一下,竟然查到了好几页,这篇文章被很多网站.blog转载,在论坛上的阅读次数截至今日更是让人难以置信的达到1800多 ...

  2. smarty模板使用详细教程

    smarty模板在当前的php项目开发过程中运用非常广泛,若能熟练掌握smarty模板的使用,那么对于MVC模型会更深的体会与理解(不理解什么是MVC模型的,可以到如何理解MVC模型这篇文章看看!). ...

  3. Smarty - 手册 - 第8章 自定义函数 - {cycle}循环

    Smarty - 手册 - 第8章 自定义函数 - {cycle}循环 {cycle} {cycle} is used to alternate a set of values. This makes ...

  4. php模板引擎smarty案例下载,PHP – Smarty模板引擎 – Download下载 – 2.6.22 | 学步园...

    PHP - Smarty模板引擎 - Download下载 - 2.6.22 [PHP - Smarty模板引擎 - 官方网站] [PHP - Smarty模板引擎 - 下载地址] http://sm ...

  5. smarty手册-smarty中foreach循环语句详解

    原文地址:smarty手册-smarty中foreach循环语句详解作者:谭博 {foreach}循环也有自身属性的变量,可以通过{$smarty.foreach.name.property}访问,其 ...

  6. 【Smarty】Smarty的下载、配置与Helloworld

    Smarty不是一种像ThinkPHP那样的大型框架,只是一个php类库,说白了就是一个写满了函数.类供调用的php文件,类似于jar包.其作用很简单,所谓的模板引擎,就是将一些php语句转化为诸如j ...

  7. php ci框架开发手册下载,php敏捷开发codeigniter框架-CodeIgniter教程(中文手册)pdf格式免费完整版-东坡下载...

    这既是一份CodeIgniter教程,也是一份不可多得的CodeIgniter中文手册,更具体一点来说,它其实是<php敏捷开发codeigniter框架>,如果你需要一份这样的codei ...

  8. PHP官方网站,php官方论坛,中文函数手册下载

    每个人都知道php.net,我们或早或晚的都会来到这里并不断的访问它.它是PHPer的主要参考网站,拥有大量有用的信息,但是这些信息却不是那么显而易见. 比较有用的官方PHP资源: PHP官方函数手册 ...

  9. php的smarty模板,PHP Smarty模板的安装

    最近开发中用到了PHP中smarty模板..作为一个长久以来的前端,开始学习PHP模板..下面将安装教程分享给大家.. 1. 下载Smarty最新版: http://www.smarty.NET/do ...

  10. php smarty安装,php smarty 安装 、配置、使用 及缓存cache的配置使用

    cache 使用: cache配置: $smarty->cache_dir = "/caches/";  //缓存目录 $smarty->caching = true; ...

最新文章

  1. 微信小程序之录音与播放功能(完整示例demo)
  2. 直接内存访问(DMA)
  3. javaScript面向对象表示
  4. 旁瓣对消原理_雷达天线旁瓣对消技术
  5. linux 编译git 客户端源码然后安装
  6. 三个好用的并发工具类
  7. 7种JIRA集成可优化Java开发流程
  8. 论文阅读 - TransNet and TransNet V2
  9. 四个修改Docker默认存储位置的方法
  10. 不会SQL?没关系,以后动动嘴就能查询数据库了 | 附论文
  11. WinAPI: waveOutPause - 暂停播放
  12. php面试题之三——PHP网络编程(高级部分)
  13. 51Nod-1019 逆序数【逆序偶+归并排序】
  14. 20155330 第十一周课堂练习(20170503)
  15. 计算机中英文打字文章,中英文混合打字文章
  16. pwn|软件安全相关问题学习笔记
  17. es中filtered和filter的区别
  18. 实时音视频聊天中的延时问题一篇就够,低延时场景及优化
  19. 中性粒细胞的免疫应用最新研究进展
  20. ubuntu server 安全模式磁盘检查修复

热门文章

  1. Virtual Display Manager(windows虚拟显示器软件)官方中文版V3.3.2.44650 | Win7/win10虚拟显示器下载
  2. sprint会议记录
  3. 智能公交监控调度系统技术方案,等车不再等到心碎
  4. 西南科技大学 SWUST OJ系统942: 逆置顺序表
  5. 16套51单片机开发板资料共享下载,拼命整理
  6. Python 二次开发 AutoCAD 简介
  7. linux vi 替换字符串,Linux vi编辑器如何查找与替换关键字
  8. 如何做项目总结与汇报
  9. 使用触发器对学生表操作进行日志记录
  10. Android视频录制之NV21和NV12