apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: HTML_Template_Flexy_Token

Source Location: /HTML_Template_Flexy-1.3.13/HTML/Template/Flexy/Token.php

Class Overview


Base Class for all Tokens.


Author(s):

Variables

Methods


Child classes:

HTML_Template_Flexy_Token_End
Class to handle End statements (eg. close brakets)
HTML_Template_Flexy_Token_Else
Class to handle Else
HTML_Template_Flexy_Token_Tag
A standard HTML Tag = eg. Table/Body etc.
HTML_Template_Flexy_Token_Processing
Class to handle Processing Directives = <?xml or <?php
HTML_Template_Flexy_Token_Foreach
Class to handle foreach statements
HTML_Template_Flexy_Token_Text
Class that represents a text string node.
HTML_Template_Flexy_Token_Method
Class to handle method calls
HTML_Template_Flexy_Token_Var
Class to handle variable output
HTML_Template_Flexy_Token_If
Class to handle If statements

Inherited Variables

Inherited Methods


Class Details

[line 42]
Base Class for all Tokens.
  • Abstract: Provides the static Create Method, and default toString() methods


[ Top ]


Class Variables

$charPos =

[line 71]

the character Position
  • Access: public

Type:   int


[ Top ]

$children = array()

[line 402]

array of children to each object.

Type:   array


[ Top ]

$close =

[line 392]

Matching closing tag for a Token
  • Var: optional closing tag
  • Access: public

Type:   object|none


[ Top ]

$ignoreChildren =  false

[line 453]

Flag to ignore children - Used to block output for select/text area etc.

may not be required as I moved the Tag parsing into the toString ph

  • Var: ingore children
  • Access: public

Type:   boolean


[ Top ]

$line =

[line 64]

the line the token is from
  • Access: public

Type:   int


[ Top ]

$token =

[line 50]

the token type (Depreciated when we have classes for all tokens
  • Access: public

Type:   string


[ Top ]

$value =

[line 57]

the default value (normally a string)
  • Access: public

Type:   string


[ Top ]



Method Detail

buildChildren   [line 412]

void buildChildren( int $id)

Build the child array for each element.

RECURSIVE FUNCTION!!!!

  • Access: public

Parameters:

int   $id   —  id of node to add children to.

[ Top ]

buildTokens   [line 195]

base buildTokens( object Tokenizer $tokenizer)

Run a Tokenizer and Store its results It should build a DOM Tree of the HTML
  • Return: token (really a dummy token, which contains the tree)
  • Access: public

Parameters:

object Tokenizer   $tokenizer   —  to run.. - Theoretically other Tokenizers could be done for email,rtf etc.

[ Top ]

compile   [line 141]

string compile( &$compiler)

compile to String (vistor method) replaces toString
  • Return: HTML
  • Access: public

Parameters:

   &$compiler   — 

[ Top ]

compileChildren   [line 152]

string compileChildren( &$compiler)

compile children (visitor approach).
  • Return: HTML
  • Access: public

Parameters:

   &$compiler   — 

[ Top ]

dump   [line 626]

void dump( )

dump to text ATM
  • Access: public

[ Top ]

factory   [line 88]

object Created factory( string $token, mixed $value, int $line, [ $charPos = 0])

factory a Token

Standard factory method.. - with object vars. ?? rename me to factory?

  • Return: Object
  • Access: public

Parameters:

string   $token   —  Token type
mixed   $value   —  Initialization settings for token
int   $line   —  line that the token is defined.
   $charPos   — 

[ Top ]

findVar   [line 544]

string findVar( $string)

do the stack lookup on the variable this relates to flexy t relates to the object being parsed.
  • Return: PHP variable
  • Access: public

Parameters:

   $string   — 

[ Top ]

pullState   [line 486]

boolean pullState( )

tell the generator you are entering a block
  • Return: parse error - out of bounds
  • Access: public

[ Top ]

pushState   [line 471]

void pushState( )

tell the generator you are entering a block
  • Access: public

[ Top ]

pushVar   [line 587]

void pushVar( string $string)

add a variable to the stack.
  • Access: public

Parameters:

string   $string   —  PHP variable

[ Top ]

scopeVarsToArrayString   [line 605]

void scopeVarsToArrayString( )

get the scoped variables as an array of strings so that it can be passed to child templates...
  • Access: public

[ Top ]

setValue   [line 129]

none setValue( mixed $value)

Standard Value iterpretor
  • Access: public

Overridden in child classes as:

HTML_Template_Flexy_Token_Tag::setValue()
Setvalue - gets name, attribute as an array
HTML_Template_Flexy_Token_Foreach::setValue()
Setvalue - a array of all three (last one optional)
HTML_Template_Flexy_Token_Method::setValue()
setvalue - at present array method, args (need to add modifier)
HTML_Template_Flexy_Token_Var::setValue()
Setvalue - at present raw text.. - needs sorting out..
HTML_Template_Flexy_Token_If::setValue()
Setvalue - a string

Parameters:

mixed   $value   —  value recieved from factory method

[ Top ]

toVar   [line 506]

string toVar( $s)

get the real variable name formated x.y.z => $this->x->y->z if a variable is in the stack it return $x->y->z
  • Return: PHP variable
  • Access: public

Parameters:

   $s   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 16:00:00 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.