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

Class: HTML_Template_Flexy_Token

Source Location: /HTML_Template_Flexy-1.1.2/Flexy/Token.php

Class Overview


Base Class for all Tokens.


Author(s):

Variables

Methods


Child classes:

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

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 389]

array of children to each object.

Type:   array


[ Top ]

$close =

[line 379]

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

Type:   object|none


[ Top ]

$ignoreChildren =  false

[line 440]

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 399]

void buildChildren( int $id)

Build the child array for each element.

RECURSIVE FUNCTION!!!!

  • Static: This method can be called statically
  • 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)
  • Static: This method can be called statically
  • Access: public

Parameters:

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

[ Top ]

compile   [line 141]

string compile( mixed &$compiler)

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

[ Top ]

compileChildren   [line 152]

string compileChildren( mixed &$compiler)

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

[ Top ]

dump   [line 588]

void dump( )

dump to text ATM
  • Access: public

[ Top ]

factory   [line 88]

object Created factory( string $token, mixed $value, int $line, [mixed $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.

[ Top ]

findVar   [line 531]

string findVar( mixed $string)

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

[ Top ]

pullState   [line 473]

boolean pullState( )

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

[ Top ]

pushState   [line 458]

void pushState( )

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

[ Top ]

pushVar   [line 574]

void pushVar( string $string)

add a variable to the stack.
  • Access: public

Parameters:

string   $string     PHP variable

[ 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_If::setValue()
Setvalue - a string
HTML_Template_Flexy_Token_Foreach::setValue()
Setvalue - a array of all three (last one optional)
HTML_Template_Flexy_Token_Var::setValue()
Setvalue - at present raw text.. - needs sorting out..
HTML_Template_Flexy_Token_Method::setValue()
setvalue - at present array method, args (need to add modifier)

Parameters:

mixed   $value     value recieved from factory method

[ Top ]

toVar   [line 493]

string toVar( mixed $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

[ Top ]


Documentation generated on Mon, 11 Apr 2005 14:53:11 -0400 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.