Class JTemplate

Description

Template class, provides an easy interface to parse and display a template file

Located in /template/template.php (line 26)

patTemplate
   |
   --JTemplate
Direct descendents
Class Description
Abstract class JDocument Document class, provides an easy interface to parse and display a document
Method Summary
 JTemplate __construct ([string $type = 'html'])
 Object JTemplate ()
 void __destruct ()
 void display (string $name)
 void fetch (string $name)
 jtemplate &getInstance ([string $type = 'html'])
 void parse (string $file)
 boolean setTemplateCachePrefix (string $prefix)
Methods
Constructor __construct (line 56)

Class constructor

The constructor accepts the type of the templates as sole parameter. You may choose one of:

  • html (default)
  • tex
The type influences the tags you are using in your templates.

  • access: protected
JTemplate __construct ([string $type = 'html'])
  • string $type: (either html or tex)

Redefined in descendants as:
Constructor JTemplate (line 36)

A hack to support __construct() on PHP 4

Hint: descendant classes have no PHP4 class_name() constructors, so this constructor gets called first and calls the top-layer __construct() which (if present) should call parent::__construct()

Object JTemplate ()
Destructor __destruct (line 76)

Class destructor

  • access: protected
void __destruct ()
display (line 119)

Execute and display a the template

  • access: public
void display (string $name)
  • string $name: The name of the template

Redefined in descendants as:
fetch (line 130)

Returns a parsed template

  • access: public
void fetch (string $name)
  • string $name: The name of the template
getInstance (line 86)

Returns a reference to a global Template object, only creating it if it doesn't already exist.

  • return: A template object
  • since: 1.1
jtemplate &getInstance ([string $type = 'html'])
  • string $type: (either html or tex)

Redefined in descendants as:
  • JDocument::getInstance() : Returns a reference to the global JDocument object, only creating it if it doesn't already exist.
parse (line 108)

Parse a file

  • access: public
void parse (string $file)
  • string $file: The filename

Redefined in descendants as:
setTemplateCachePrefix (line 151)

Set the prefix of the template cache

  • return: true on success, patError otherwise
  • access: public
boolean setTemplateCachePrefix (string $prefix)
  • string $prefix: the prefix of the template cache

Documentation generated on Sat, 4 Feb 2006 14:26:56 +0100 by phpDocumentor 1.3.0RC4