phpDocumentor Template
[ class tree: Template ] [ index: Template ] [ all elements ]

Class: Template

Source Location: /classes/Template.php

Class Template

Class Overview

Template

This Template class is a very simplified templating system. Instead of using a templating language, this templating system using PHP as it's own templating language. The reasons behinds this are that most templating systems implement almost all of PHP in their syntax, so why would be bother learning another language to so the same thing? The concept of this template system is to separate business logic from display logic. That is, the template should be modify any system variables, only display them. It might calculate a grade percentage from the number of questions right divided by the number of questions wrong, but it should never do something like store that number in a datastore.

Located in /classes/Template.php [line 25]



		
				Author(s):
		
  • Kyle Hall
Information Tags:
Copyright:  2006

Properties

Methods

[ Top ]
Property Summary
mixed   $vars  

[ Top ]
Method Summary
boolean   __construct()   Constructor
void   display()   Open, parse, and echo the template file.
string   fetch()   Open, parse, and return the template file.
boolean   set()   Set a template variable.

[ Top ]
Properties
mixed   $vars = array() [line 26]
API Tags:
Access:  protected


[ Top ]
Methods
Constructor __construct  [line 33]

  boolean __construct( [string $file = null]  )

Constructor

Parameters:
string   $file:  The file name you want to load

API Tags:
Return:  True on successful construction, False otherwise.
Access:  public


[ Top ]
display  [line 69]

  void display( [$file $file = null]  )

Open, parse, and echo the template file.

Parameters:
$file   $file:  string the template file name

API Tags:
Access:  public


[ Top ]
fetch  [line 52]

  string fetch( [string $file = null]  )

Open, parse, and return the template file.

Parameters:
string   $file:  string the template file name.

API Tags:
Return:  HTML Code.
Access:  public


[ Top ]
set  [line 43]

  boolean set( string $name, value $value  )

Set a template variable.

Parameters:
string   $name:  The name the variable should have inside the template.
value   $value:  The value the variable $name should hold.

API Tags:
Return:  True on successful set, False otherwise.
Access:  public


[ Top ]

Documentation generated on Fri, 15 Dec 2006 11:18:43 -0500 by phpDocumentor 1.3.0