Tags: template

  • Sort by: Date / Title / URL

    1. Download sample templates
    2. Pligg template
    3. * 模板引擎 (template engine), 我们真的需要在脚本语言之上再实现一层脚本语言么?? 一直对 Smarty (http://smarty.php.net) 这类的模板引擎觉得有别扭之处, 模板引擎所声称提供的一个好处是协助开发人员分离表现逻辑 (presentation logic) 与业务逻辑 (business logic), 然后, 页面设计人员即便没有 php 的经验, 也能把开发人员传递过来的数据在页面上按需呈现出来. 可是问题就出现了, Smarty 这样的模板引擎自身为了页面的呈现, 为了表现逻辑的表达, 同时为了避开嵌入 php 代码, 于是就搞出了另一套 '准脚本语言' (pesudo-scripting language) - Smarty 自身的一整套类似标签库的东西: http://smarty.php.net/manual/en/smarty.for.designers.php 这时, 页面开发人员能不学这套东西?? 既然都是学, 为何不直接学一点简单的 php 语句? 这篇文章很好地表达了我的感受: http://www.massassi.com/php/articles/template_engines/ 作者锐利地指出了问题所在: 模板引擎的关键在于协助开发人员分离表现逻辑与业务逻辑, 而 *不在于* 分离 php 与 html 标记 - 至少对于 php 这门本来就是脚本语言的语言而言, 这是很正确的! 我们不该在脚本之上再实现脚本了! 脚本语言为的就是起一个胶水的作用, 让我们方面快捷地把其他工具结合在一起以完成我们的任务! 作者在文章里还给了一个实例, 一个 40 行代码就实现了的 php 模板引擎, 中心思想就是: 模板里仍旧使用 php 来表达表现逻辑.
    4. PHPTAL is a PHP implementation of ZPT work. To be short, PHPTAL is a XML/XHTML template library for PHP. While most web developpers continue to use ASP/JSP/PHP tags as the core language of their templates, the Zope community came with a refreshing idea named TAL. The idea was to move presentation actions inside XHTML attributes instead of using plain tags or elements.

    First / Previous / Next / Last / Page 1 of 2