Class patTemplate_Reader

Description

Base class for patTemplate readers

This class is able to parse patTemplate tags from any string you hand it over It will emulate some kind of SAX parsing by calling start-, end- and CData-handlers.

Located in /includes/patTemplate/patTemplate/Reader.php (line 70)

patTemplate_Module
   |
   --patTemplate_Reader
Direct descendents
Class Description
patTemplate_Reader_File patTemplate Reader that reads from a file
patTemplate_Reader_IT patTemplate reader that reads HTML_Template_IT files
patTemplate_Reader_String patTemplate Reader that reads from a string
Variable Summary
array $_path
array $_templates
object $_tmpl
Method Summary
void addFunctionAlias (string $alias, string $function)
string getCurrentInput ()
boolean isInUse ()
string loadTemplate (mixed $input, [array $options = array()])
array readTemplates (mixed $input, [array $options = array()])
void setOptions (array $options)
void setRootAttributes (array $attributes)
boolean shouldMaintainBc ()
Variables
array $_path = array() (line 120)

path to the template

  • access: protected
array $_templates = array() (line 113)

templates that have been found

  • access: protected
object $_tmpl (line 78)

reference to the patTemplate object that instantiated the module

  • access: protected

Inherited Variables

Inherited from patTemplate_Module

patTemplate_Module::$_name
patTemplate_Module::$_params
Methods
addFunctionAlias (line 288)

add an alias for a function

  • access: public
void addFunctionAlias (string $alias, string $function)
  • string $alias: alias
  • string $function: function name
getCurrentInput (line 1512)

get the current input

  • access: public
string getCurrentInput ()
isInUse (line 1542)

returns, whether the reader currently is in use

  • access: public
boolean isInUse ()
loadTemplate (line 256)

load template from any input

If the a template is loaded, the content will not get analyzed but the whole content is returned as a string.

  • return: template content
  • abstract: must be implemented in the template readers
string loadTemplate (mixed $input, [array $options = array()])
  • mixed $input: input to load from. This can be a string, a filename, a resource or whatever the derived class needs to read from
  • array $options: options, not implemented in current versions, but future versions will allow passing of options

Redefined in descendants as:
readTemplates (line 239)

read templates from any input

  • return: template structure
  • abstract: must be implemented in the template readers
array readTemplates (mixed $input, [array $options = array()])
  • mixed $input: input to read from. This can be a string, a filename, a resource or whatever the derived class needs to read from
  • array $options: options, not implemented in current versions, but future versions will allow passing of options

Redefined in descendants as:
setOptions (line 268)

set options

  • access: public
void setOptions (array $options)
  • array $options: array containing options
setRootAttributes (line 299)

set the root attributes

  • access: public
void setRootAttributes (array $attributes)
  • array $attributes: array containing options
setTemplateReference (line 225)

set a reference to the patTemplate object that instantiated the reader

  • access: public
void setTemplateReference (object patTemplate &$tmpl)
shouldMaintainBc (line 1528)

tests whether the reader should maintain backwards compatibility

If enabled, you can still use 'default', 'empty', 'odd' and 'even' instead of '__default', '__empty', etc.

This will be disabled by default in future versions.

  • access: public
boolean shouldMaintainBc ()

Inherited Methods

Inherited From patTemplate_Module

patTemplate_Module::getName()
patTemplate_Module::getParam()
patTemplate_Module::setParams()

Documentation generated on Fri, 4 Mar 2005 13:57:10 +1000 by phpDocumentor 1.3.0RC3