fititnt - Especialista e Desenvolvedor Joomla! Visit fititnt.org, and look for some extension or more Joomla Framework info patTemplate
Compiler
[ class tree: patTemplate ] [ index: patTemplate ] [ all elements ]

Class: patTemplate_Compiler

Source Location: /includes/patTemplate/patTemplate/Compiler.php

Class patTemplate_Compiler

Class Overview

Compiler for patTemplate

$Id: Compiler.php 49 2005-09-15 02:55:27Z rhuk $

WARNING: This is still experimental!

Located in /includes/patTemplate/patTemplate/Compiler.php [line 30]

patTemplate
   |
   --patTemplate_Compiler
Author(s): Information Tags:
Version:  3.1.0
Todo:  implement all template types
Todo:  implement getParsedTemplate
Todo:  check for existing compiled template
Todo:  implement variable modifiers

Properties

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From patTemplate

patTemplate::$_defaultAttributes
patTemplate::$_discoveredPlaceholders
patTemplate::$_endTag
patTemplate::$_globals
patTemplate::$_inputFilters
patTemplate::$_moduleDirs
patTemplate::$_modules
patTemplate::$_options
patTemplate::$_outputFilters
patTemplate::$_root
patTemplate::$_startTag
patTemplate::$_systemVars
patTemplate::$_templateList
patTemplate::$_templates
patTemplate::$_tmplCache
patTemplate::$_vars

Inherited From patTemplate

patTemplate::patTemplate()
Create a new patTemplate instance.
patTemplate::addGlobalVar()
Adds a global variable
patTemplate::addGlobalVars()
Adds several global variables
patTemplate::addModuleDir()
add a directory where patTemplate should search for modules.
patTemplate::addObject()
Adds an object to a template
patTemplate::addRows()
Adds several rows of variables to a template
patTemplate::addVar()
add a variable to a template
patTemplate::addVars()
Adds several variables to a template
patTemplate::applyInputFilter()
enable an input filter
patTemplate::applyInputFilters()
apply input filters that have been set
patTemplate::applyOutputFilter()
enable an output filter
patTemplate::clearAllTemplates()
clears all templates
patTemplate::clearAttribute()
Clears an attribute of a template
patTemplate::clearGlobalVar()
Clears a global variable
patTemplate::clearGlobalVars()
Clears all global variables
patTemplate::clearTemplate()
clears a parsed Template
patTemplate::clearVar()
clear the value of a variable
patTemplate::clearVars()
Clear all variables in a template
patTemplate::displayParsedTemplate()
displays a parsed Template
patTemplate::dump()
Displays useful information about all or named templates
patTemplate::exists()
checks wether a template exists
patTemplate::freeAllTemplates()
frees all templates
patTemplate::freeTemplate()
frees a template
patTemplate::getAttribute()
Gets an attribute of a template
patTemplate::getAttributes()
Get all attributes of a template
patTemplate::getDefaultAttributes()
get default attributes
patTemplate::getEndTag()
get end tag for variables
patTemplate::getGlobalVars()
get all global variables
patTemplate::getIncludePath()
get the include path
patTemplate::getNamespace()
gets namespace of patTemplate tags
patTemplate::getObjectVars()
get the vars from an object
patTemplate::getOption()
gets an option
patTemplate::getParsedTemplate()
returns a parsed Template
patTemplate::getRoot()
gets name of root base for the templates
patTemplate::getStartTag()
get start tag for variables
patTemplate::getVar()
get the value of a variable
patTemplate::loadModule()
loads a patTemplate module
patTemplate::loadTemplate()
load a template that had autoload="off"
patTemplate::loadTemplateFromInput()
open any input and load content into template
patTemplate::moduleExists()
checks whether a module exists.
patTemplate::parseIntoVar()
parse a template and push the result into a variable of any other template
patTemplate::parseTemplate()
parses a template
patTemplate::placeholderExists()
checks, whether a placeholder exists in a template
patTemplate::prepareTemplate()
Prepare a template
patTemplate::readTemplatesFromFile()
open a file and parse for patTemplate tags
patTemplate::readTemplatesFromInput()
open any input and parse for patTemplate tags
patTemplate::setAttribute()
Sets an attribute of a template
patTemplate::setAttributes()
Sets several attribute of a template
patTemplate::setBasedir()
sets name of directory where templates are stored
patTemplate::setDefaultAttribute()
set default attribute
patTemplate::setDefaultAttributes()
set default attributes
patTemplate::setNamespace()
sets namespace of patTemplate tags
patTemplate::setOption()
sets an option
patTemplate::setRoot()
sets root base for the template
patTemplate::setTags()
set the start and end tag for variables
patTemplate::setType()
set the type for the templates
patTemplate::useTemplateCache()
enable a template cache
patTemplate::_applyModifers()
apply variable modifiers
patTemplate::_fetchTemplate()
fetch plain template
patTemplate::_fetchVariables()
fetch variables for a template
patTemplate::_getConditionValue()
fetch the value of a condition variable
patTemplate::_getDependencies()
get _all_ dependencies of a template, regardless of the subtemplates
patTemplate::_handleUnusedVars()
handle all unused variables in a template
patTemplate::_hasVariables()
check, whether a template contains variables
patTemplate::_initTemplate()
Initialize a template
patTemplate::_loadTemplatesFromCache()
load from template cache
patTemplate::_parseDependencies()
parse all dependencies in a template
patTemplate::_parseGlobals()
parse global variables in the template
patTemplate::_parseVariables()
parse all variables in a template
patTemplate::__toString()
Convert the template to its string representation.

[ Top ]
Property Summary
array()   $_compiledTemplates   list of all templates that already have been compiled
resource   $_fp   file pointer to the compiled template

[ Top ]
Method Summary
patTemplate_Compiler   patTemplate_Compiler()   constructor
void   compile()   compile the currently loaded templates
void   compileTemplate()   compile a template
void   displayParsedTemplate()   display the compiled template
void   _addToCode()   add a line to the compiled code
void   _compileBuiltinConditions()   compile built-in conditions
void   _compileConditionTemplate()   compile a condition template
void   _compileModuloTemplate()   compile a modulo template
void   _compileSimpleConditionTemplate()   compile a simpleCondition template
void   _compileStandardTemplate()   compile a standard template
void   _getVar()   function, used by the compiler to get a value of a variable
void   _prepareCompiledTemplate()   prepare a template for the compiler
string   _templateToPHP()   build PHP code from a template

[ Top ]
Properties
array()   $_compiledTemplates = array() [line 38]

list of all templates that already have been compiled

API Tags:
Access:  private


[ Top ]
resource   $_fp [line 46]

file pointer to the compiled template

API Tags:
Access:  private


[ Top ]
Methods
Constructor patTemplate_Compiler  [line 56]

  patTemplate_Compiler patTemplate_Compiler( [string $type = 'html']  )

constructor

Creates a new patTemplate Compiler

Parameters:
string   $type:  type of the templates, either 'html' or 'tex'

API Tags:
Access:  public


[ Top ]
compile  [line 68]

  void compile( [string $compileName = null]  )

compile the currently loaded templates

Parameters:
string   $compileName:  name of the input (filename, shm segment, etc.)

API Tags:
Access:  public


[ Top ]
compileTemplate  [line 104]

  void compileTemplate( string $template  )

compile a template

Parameters:
string   $template:  name of the template

API Tags:
Access:  public


[ Top ]
displayParsedTemplate  [line 409]

  void displayParsedTemplate( [string $name = null]  )

display the compiled template

This is a replacement for patTemplate::displayParsedTemplate.

Parameters:
string   $name:  name of the template to display

API Tags:
Access:  public


Redefinition of:
patTemplate::displayParsedTemplate()
displays a parsed Template

[ Top ]
_addToCode  [line 432]

  void _addToCode( string $line, [integer $indent = 0], [ $comment = null]  )

add a line to the compiled code

Parameters:
string   $line:  line to add
integer   $indent:  indentation
   $comment: 

API Tags:
Access:  public


[ Top ]
_compileBuiltinConditions  [line 358]

  void _compileBuiltinConditions( string $template  )

compile built-in conditions

This will create the neccessary PHP code for:

  • __first
  • __last

Parameters:
string   $template:  template name

API Tags:
Access:  private


[ Top ]
_compileConditionTemplate  [line 315]

  void _compileConditionTemplate( string $template  )

compile a condition template

A condition template will be compiled into an 'switch/case' statement.

Parameters:
string   $template:  name of the template

API Tags:
Access:  private


[ Top ]
_compileModuloTemplate  [line 254]

  void _compileModuloTemplate( string $template  )

compile a modulo template

A modulo template will be compiled into a switch/case statement.

Parameters:
string   $template:  name of the template

API Tags:
Access:  private

Information Tags:
Todo:  check special conditions (__first, __last, __default)

[ Top ]
_compileSimpleConditionTemplate  [line 287]

  void _compileSimpleConditionTemplate( string $template  )

compile a simpleCondition template

A simpleCondition template will be compiled into an 'if' statement.

Parameters:
string   $template:  name of the template

API Tags:
Access:  private


[ Top ]
_compileStandardTemplate  [line 237]

  void _compileStandardTemplate( string $template  )

compile a standard template

Parameters:
string   $template:  name of the template

API Tags:
Access:  private


[ Top ]
_getVar  [line 457]

  void _getVar( string $template, string $varname  )

function, used by the compiler to get a value of a variable

Checks, whether the value is locally or globally set

Parameters:
string   $template:  template
string   $varname:  variable name

API Tags:
Access:  private

Information Tags:
Todo:  check for 'unusedvars' attribute

[ Top ]
_prepareCompiledTemplate  [line 474]

  void _prepareCompiledTemplate( string $template  )

prepare a template for the compiler

Parameters:
string   $template:  template name

API Tags:
Access:  private


[ Top ]
_templateToPHP  [line 392]

  string _templateToPHP( string $content, string $template  )

build PHP code from a template

This will replace the variables in a template with PHP Code.

Parameters:
string   $content:  template content
string   $template:  name of the template

API Tags:
Return:  PHP code
Access:  private


[ Top ]

The site fititnt.org is not affiliated with or endorsed by the Joomla! Project or Open Source Matters. If you are looking for official documentation, visit api.joomla.org and docs.joomla.org.
Documentation generated on Mon, 26 Oct 2009 22:51:50 -0200 by phpDocumentor 1.4.3