Class Tpex
Tpex is a parser used by Thelia CMS (http://thelia.net)
Tpex use syntax like loop : <THELIA_name type="loopName"
parameter1="value1" parameter2="value2"> #SUBTITUTION1 #SUBSTITUTION2
#SUBSTITUTION-n </THELIA_name>
you have to implements your own loop, all the logical is in your loop not in
Tpex
filter syntax :
[...(filter_name{param1, param2, ... } ... ]
base param syntax :
PARAM_BASE_parameName=paramValue
Methods summary
public
|
#
init( Symfony\Component\HttpFoundation\Request $request, Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher, string $content, string $basedir )
Parameters
- $request
Symfony\Component\HttpFoundation\Request $request Request object containing current http request
- $dispatcher
Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher for dispatching Tpex event like substitute or include
- $content
string $content the content to parse
- $basedir
string $basedir where files are located
|
public
|
#
configure( array $loops = array(), array $filters = array(), array $baseParams = array() )
|
public
|
#
setLogger( Psr\Log\LoggerInterface $logger )
Parameters
- $logger
Psr\Log\LoggerInterface $logger logger implementing LoggerInterface like Tlog
|
public
|
#
addLoops( array $loops )
add multiple loops in one time in Tpex parser
array key contains loop name array value contain className to execute for
rendering this loop
$loops = array( "product" => "Thelia\Loop\Product", "category" =>
"Thelia\Loop\Category", "myLoop" => "My\Own\Loop" );
Parameters
Throws
InvalidArgumentException
|
public
|
#
addLoop( string $name, type $className )
add a new loop to Tpex parser
Parameters
- $name
string $name loop name. Must be unique
- $className
type $className class name implementing/extending loop classes
Throws
InvalidArgumentException
|
public
|
#
addFilters( array $filters )
add multiple filters in one time in Tpex parser
key is filter name, must be unique value is the class implementing/extending
base loop classes
$filter = array( "upperCase" => "Thelia\Filter\UpperCase", "lowerCase"
=> "Thelia\Filter\LowerCase", "myFilter" => "My\Own\Filter" );
Parameters
Throws
InvalidArgumentException
|
public
|
#
addFilter( string $name, type $className )
add a new filter to Tpex parser
Parameters
- $name
string $name filter name. Must be unique
- $className
type $className class name implementing/extending filter classes
Throws
InvalidArgumentException
|
public
|
#
addBaseParams( array $baseParams )
add multiple baseParam ine one time in Tpex Parser
key is baseParam name value is the class implementing/extending base
baseParam classes
$baseParam = array( "secure" => "Thelia\BaseParam\Secure", "reset" =>
"Thelia\BaseParam\reset", "myBaseParam" => "My\Own\BaseParam" );
Parameters
- $baseParams
array $baseParams
Throws
InvalidArgumentException
|
public
|
#
addBaseParam( type $name, type $className )
add a new baseParam to Tpex param
Parameters
- $name
type $name baseParam name. Must be unique
- $className
type $className class name implementing/extending filter classes
Throws
InvalidArgumentException
|
protected
|
|
protected
|
#
addProperty( mixed $property, mixed $name, mixed $className )
|
public
|
|
protected
|
|
protected
|
|
Properties summary
protected
string
|
$content
|
|
#
$content contains string to parse
|
protected
string
|
$basedir
|
|
#
the base directory for searching all files for inclusion
|
protected
Symfony\Component\HttpFoundation\Request
|
$request
|
|
|
protected
Psr\Log\LoggerInterface
|
$logger
|
|
|
protected
Symfony\Component\EventDispatcher\EventDispatcherInterface
|
$dispatcher
|
|
|
protected
Array
|
$loop
|
array() |
#
associative array containing information for loop execution
associative array containing information for loop execution
key is loop name value is the class implementing/extending base loop
classes
ex :
$loop = array( "product" => "Thelia\Loop\Product", "category" =>
"Thelia\Loop\Category", "myLoop" => "My\Own\Loop" );
|
protected
Array
|
$filter
|
array() |
#
associative array containing information for filter execution
associative array containing information for filter execution
key is filter name value is the class implementing/extending base loop
classes
ex :
$filter = array( "upperCase" => "Thelia\Filter\UpperCase", "lowerCase"
=> "Thelia\Filter\LowerCase", "myFilter" => "My\Own\Filter" );
|
protected
Array
|
$baseParam
|
array() |
#
associative array containing information for baseParam execution
associative array containing information for baseParam execution
key is baseParam name value is the class implementing/extending base
baseParam classes
ex :
$baseParam = array( "secure" => "Thelia\BaseParam\Secure", "reset" =>
"Thelia\BaseParam\reset", "myBaseParam" => "My\Own\BaseParam" );
|
protected
mixed
|
$substitution
|
|
|
protected
mixed
|
$init
|
|
|