Perl Template Toolkit (Paperback)
暫譯: Perl 模板工具包 (平裝本)

Darren Chamberlain, Dave Cross, Andy Wardley

  • 出版商: O'Reilly
  • 出版日期: 2004-01-27
  • 定價: $1,360
  • 售價: 8.0$1,088
  • 語言: 英文
  • 頁數: 592
  • 裝訂: Paperback
  • ISBN: 0596004761
  • ISBN-13: 9780596004767
  • 相關分類: Perl 程式語言
  • 立即出貨(限量) (庫存=10)

買這商品的人也買了...

商品描述

 

Summary

Among the many different approaches to "templating" with Perl--such as Embperl, Mason, HTML::Template, and hundreds of other lesser known systems--the Template Toolkit is widely recognized as one of the most versatile. Like other templating systems, the Template Toolkit allows programmers to embed Perl code and custom macros into HTML documents in order to create customized documents on the fly. But unlike the others, the Template Toolkit is as facile at producing HTML as it is at producing XML, PDF, or any other output format. And because it has its own simple templating language, templates can be written and edited by people who don't know Perl. In short, the Template Toolkit combines the best features of its competitors, with ease-of-use and flexibility, resulting in a technology that's fast, powerful and extensible, and ideally suited to the production and maintenance of web content and other dynamic document systems.

In Perl Template Toolkit you'll find detailed coverage of this increasingly popular technology. Written by core members of the technology's development team, the book guides you through the entire process of installing, configuring, using, and extending the Template Toolkit. It begins with a fast-paced but thorough tutorial on building web content with the Template Toolkit, and then walks you through generating and using data files, particularly with XML. It also provides detailed information on the Template Toolkit's modules, libraries, and tools in addition to a complete reference manual.

Topics in the book include:


  • Getting started with the template toolkit
  • The Template language
  • Template directives
  • Filters
  • Plugins
  • Extending the Template Toolkit
  • Accessing databases
  • XML
  • Advanced static web page techniques
  • Dynamic web content and web applications


The only book to cover this important tool, Perl Template Toolkit is essential reading for any Perl programmer who wants to create dynamic web content that is remarkably easy to maintain. This book is your surefire guide to implementing this fast, flexible, and powerful templating system.

Table of Contents

Preface

1. Getting Started with the Template Toolkit

     What the Template Toolkit Does

     The Templating Ecosystem

     Installing the Template Toolkit

     Documentation and Support

     Using the Template Toolkit

     The Template Toolkit Language

     Template Variables

     Template Directives

     Integrating and Extending the Template Toolkit

2. Building a Complete Web Site Using the Template Toolkit

     Getting Started

     Template Components

     Defining Variables

     Generating Many Pages

     Adding Headers and Footers Automatically

     More Template Components

     Wrapper and Layout Templates

     Menu Components

     Defining and Using Complex Data

     Assessment

3. The Template Language

     Template Syntax

     Template Variables

     Virtual Methods

4. Template Directives

     Accessing Variables

     Accessing External Templates and Files

     Defining Local Template Blocks

     Loops

     Conditionals

     Filters

     Plugins

     Macros

     Template Metadata

     Exception Handling

     Flow Control

     Debugging

     Perl Blocks

5. Filters

     Using Filters

     Standard Template Toolkit Filters

6. Plugins

     Using Plugins

     Standard Template Toolkit Plugins

7. Anatomy of the Template Toolkit

     Template Modules

     The Runtime Engine

     Module Interfaces

8. Extending the Template Toolkit

     Using and Implementing Noncore Components

     Creating Filters

     Creating Plugins

     Building a New Frontend

     Changing the Language

9. Accessing Databases

     Using the DBI Plugin

     Using Class::DBI

     Using DBIx::Table2Hash

10. XML

     Simple XML Processsing

     Creating XML Documents

     Processing RSS Files with XML.RSS

     Processing XML Documents with XML.DOM

     Processing XML Documents with XML.XPath

     Processing XML Documents with XML.LibXML

     Using Views to Transform XML Content

11. Advanced Static Web Page Techniques

     Getting Started

     Library Templates

     Content Templates

     Navigation Components

     Structuring Page Content

     Creating a New Skin

12. Dynamic Web Content and Web Applications

     CGI Scripts

     CGI Templates

     Apache and mod_perl

     A Complete Web Application

Appendix: Configuration Options

Index

商品描述(中文翻譯)

摘要

在許多不同的 Perl 模板化方法中,例如 Embperl、Mason、HTML::Template 以及數百個其他不太知名的系統,Template Toolkit 被廣泛認為是最具多功能性的工具之一。與其他模板系統類似,Template Toolkit 允許程式設計師將 Perl 代碼和自定義宏嵌入 HTML 文件中,以便即時創建自定義文檔。但與其他系統不同的是,Template Toolkit 在生成 HTML、XML、PDF 或任何其他輸出格式方面都同樣靈活。由於它擁有自己的簡單模板語言,因此即使是不懂 Perl 的人也能編寫和編輯模板。簡而言之,Template Toolkit 結合了競爭對手的最佳特性,具備易用性和靈活性,從而形成了一種快速、強大且可擴展的技術,非常適合於網頁內容和其他動態文檔系統的生產和維護。

在《Perl Template Toolkit》一書中,您將找到對這一日益流行的技術的詳細介紹。該書由技術開發團隊的核心成員撰寫,指導您完成安裝、配置、使用和擴展 Template Toolkit 的整個過程。書中首先提供了一個快速但全面的教程,介紹如何使用 Template Toolkit 構建網頁內容,然後引導您生成和使用數據文件,特別是 XML 文件。它還提供了有關 Template Toolkit 模組、庫和工具的詳細信息,以及完整的參考手冊。

書中的主題包括:
- 開始使用 Template Toolkit
- 模板語言
- 模板指令
- 過濾器
- 插件
- 擴展 Template Toolkit
- 訪問數據庫
- XML
- 高級靜態網頁技術
- 動態網頁內容和網頁應用程式

《Perl Template Toolkit》是唯一一本涵蓋這一重要工具的書籍,對於任何希望創建易於維護的動態網頁內容的 Perl 程式設計師來說,這本書是必讀之作。這本書是您實施這一快速、靈活且強大的模板系統的可靠指南。

目錄

前言

1. 開始使用 Template Toolkit
- Template Toolkit 的功能
- 模板生態系統
- 安裝 Template Toolkit
- 文檔和支持
- 使用 Template Toolkit
- Template Toolkit 語言
- 模板變數
- 模板指令
- 整合和擴展 Template Toolkit

2. 使用 Template Toolkit 建立完整網站
- 開始
- 模板組件
- 定義變數
- 生成多個頁面
- 自動添加標題和頁腳
- 更多模板組件
- 包裝和佈局模板
- 菜單組件
- 定義和使用複雜數據
- 評估

3. 模板語言
- 模板語法
- 模板變數
- 虛擬方法

4. 模板指令
- 訪問變數
- 訪問外部模板和文件
- 定義本地模板區塊
- 迴圈
- 條件語句
- 過濾器
- 插件
- 宏
- 模板元數據
- 異常處理
- 流程控制
- 除錯
- Perl 區塊

5. 過濾器
- 使用過濾器
- 標準 Template Toolkit 過濾器

6. 插件
- 使用插件
- 標準 Template Toolkit 插件

7. Template Toolkit 的結構
- 模板模組
- 運行時引擎
- 模組介面

8. 擴展 Template Toolkit
- 使用和實現非核心組件
- 創建過濾器
- 創建插件
- 建立新的前端
- 更改語言

9. 訪問數據庫
- 使用 DBI 插件
- 使用 Class::DBI
- 使用 DBIx::Table2Hash

10. XML
- 簡單的 XML 處理
- 創建 XML 文檔
- 使用 XML.RSS 處理 RSS 文件
- 使用 XML.DOM 處理 XML 文檔
- 使用 XML.XPath 處理 XML 文檔
- 使用 XML.LibXML 處理 XML 文檔
- 使用視圖轉換 XML 內容

11. 高級靜態網頁技術
- 開始
- 庫模板
- 內容模板
- 導航組件
- 結構化頁面內容
- 創建新外觀

12. 動態網頁內容和網頁應用程式
- CGI 腳本
- CGI 模板
- Apache 和 mod_perl
- 完整的網頁應用程式

附錄:配置選項

索引

最後瀏覽商品 (20)