PHP
  Home arrow PHP arrow Page 2 - PHP Fast Template
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

PHP Fast Template
By: Ian Felton
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 16
    2001-07-02

    Table of Contents:
  • PHP Fast Template
  • Assigning templates to objects
  • Assigning variables to FastTemplate objects
  • MySQL Data parsed through FastTemplates
  • Multiple templates: Rows of data into a table
  • Summary

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    PHP Fast Template - Assigning templates to objects


    (Page 2 of 6 )

    Once the class file has been included, HTML templates can be assigned to an array for use throughout the script.

    First, a new template object must be instantiated like this:

    $tpl = new FastTemplate("../templates");
    The path in quotes points to the location of the HTML templates being used. This will vary depending upon personal preferences.

    Once the instance exists, external HTML templates are assigned to variables in the array like this:

    $tpl->define(array( "index_tpl" => "some_html_template.tpl" ));
    In the above code, "index_tpl" is arbitrary. In fact many solutions involve assigning many templates to variables within one instance.

    An example of multiple templates declared for use in a script:

    $tpl->define(array( "index_tpl" => "some_html_template.tpl", "sub_idx_tpl" => "another_html_template.tpl", "last_idx_tpl" => "last_html_template.tpl" ));


    More PHP Articles
    More By Ian Felton


       · I worked on a project that was implemented using a template, like this. The CPU...
       · I have been working on several projects using Fast Template now. The setup is so...
     

       

    PHP ARTICLES

    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Database Security: Guarding Against SQL Inje...
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Securing Your Web Application Against Attacks
    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security
    - Building a Content Management System with Co...
    - Filters and Login Systems for Web Applicatio...
    - Working with the Email Class in Code Igniter





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT