Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
TemplateParser Class Reference

Public Member Functions

 __construct (TemplateGenerator $generator)
 
 parseFileContent (string $fileContent)
 

Protected Member Functions

 parseAllVars (string $text)
 
 parseEquality (string $text)
 
 parseAllConditions (string $text)
 
 parseAllForeachs (string $text)
 
 parseAllBlock (string $text)
 
 parseCallback (string $text, string $pattern, $callback)
 
 parseCallbackWithVar (string $text, string $pattern, $callback)
 

Private Member Functions

 parseVar (string $varStr)
 
 parseForeach (string $foreachStr)
 
 getExpressionPattern (string $clause)
 

Private Attributes

TemplateGenerator $generator
 
string $varPattern = '@\{\{\s?(.*?)\s?}}@'
 
string $blockPattern = '@\{%\s?block\s(.*?)\s?%}@'
 

Detailed Description

Definition at line 8 of file TemplateParser.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( TemplateGenerator  $generator)

Definition at line 16 of file TemplateParser.php.

Member Function Documentation

◆ getExpressionPattern()

getExpressionPattern ( string  $clause)
private

Definition at line 37 of file TemplateParser.php.

◆ parseAllBlock()

parseAllBlock ( string  $text)
protected

Definition at line 94 of file TemplateParser.php.

◆ parseAllConditions()

parseAllConditions ( string  $text)
protected

Definition at line 69 of file TemplateParser.php.

◆ parseAllForeachs()

parseAllForeachs ( string  $text)
protected

Definition at line 81 of file TemplateParser.php.

◆ parseAllVars()

parseAllVars ( string  $text)
protected

Definition at line 41 of file TemplateParser.php.

◆ parseCallback()

parseCallback ( string  $text,
string  $pattern,
  $callback 
)
protected

Definition at line 107 of file TemplateParser.php.

◆ parseCallbackWithVar()

parseCallbackWithVar ( string  $text,
string  $pattern,
  $callback 
)
protected

Definition at line 118 of file TemplateParser.php.

◆ parseEquality()

parseEquality ( string  $text)
protected

Definition at line 54 of file TemplateParser.php.

◆ parseFileContent()

parseFileContent ( string  $fileContent)

Definition at line 131 of file TemplateParser.php.

◆ parseForeach()

parseForeach ( string  $foreachStr)
private

Definition at line 25 of file TemplateParser.php.

◆ parseVar()

parseVar ( string  $varStr)
private

Definition at line 20 of file TemplateParser.php.

Field Documentation

◆ $blockPattern

string $blockPattern = '@\{%\s?block\s(.*?)\s?%}@'
private

Definition at line 14 of file TemplateParser.php.

◆ $generator

TemplateGenerator $generator
private

Definition at line 10 of file TemplateParser.php.

◆ $varPattern

string $varPattern = '@\{\{\s?(.*?)\s?}}@'
private

Definition at line 12 of file TemplateParser.php.


The documentation for this class was generated from the following file: