/sources/tempcode_compiler.php

Description
Functions
build_closure_function (line 598)

Build a closure function for a compiled template.

  • return: Finished PHP code
string build_closure_function (string $myfunc, array $parts)
  • string $myfunc: The function name
  • array $parts: An array of lines to be output, each one in PHP format
compile_template (line 66)

Compile a template into a list of appendable outputs, for the closure-style Tempcode implementation.

  • return: A pair: array Compiled result structure, array preprocessable bits (special stuff needing attention that is referenced within the template)
array compile_template (string $data, string $template_name)
  • string $data: The template file contents
  • string $template_name: The name of the template
init__tempcode_compiler (line 24)

Standard code module initialisation function.

void init__tempcode_compiler ()
template_to_tempcode (line 577)

Convert template text into tempcode format.

  • return: The converted/compiled template as tempcode, OR if a directive, encoded directive information
mixed template_to_tempcode (string $text, [integer $symbol_pos = 0], [boolean $inside_directive = false], [ID_TEXT $codename = ''])
  • string $text: The template text
  • integer $symbol_pos: The position we are looking at in the text
  • boolean $inside_directive: Whether this text is infact a directive, about to be put in the context of a wider template
  • ID_TEXT $codename: The codename of the template (e.g. foo)
_do_template (line 492)

A template has not been structurally cached, so compile it and store in the cache.

  • return: The compiled tempcode
tempcode _do_template (ID_TEXT $theme, PATH $path, ID_TEXT $codename, ID_TEXT $_codename, LANGUAGE_NAME $lang, string $suffix, [?ID_TEXT $theme_orig = NULL])
  • ID_TEXT $theme: The theme the template is in the context of
  • PATH $path: The path to the template file
  • ID_TEXT $codename: The codename of the template (e.g. foo)
  • ID_TEXT $_codename: The actual codename to use for the template (e.g. foo_mobile)
  • LANGUAGE_NAME $lang: The language the template is in the context of
  • string $suffix: File type suffix of template file (e.g. .tpl)
  • ?ID_TEXT $theme_orig: The theme to cache in (NULL: main theme)
_length_so_far (line 48)

Helper function or use getting line numbers.

  • return: The sum length of tokens passed
integer _length_so_far (array $bits, integer $i)
  • array $bits: Compiler tokens
  • integer $i: How far we are through the token list

Documentation generated on Sun, 02 Jan 2011 23:26:00 +0000 by phpDocumentor 1.4.3