Overview

Namespaces

  • Thelia
    • Action
    • Config
    • Controller
    • Core
      • Bundle
      • DependencyInjection
        • Compiler
        • Loader
      • Event
      • EventListener
      • Template
        • BaseParam
    • Exception
    • Log
      • Destination
    • Model
      • map
      • om
    • Routing
      • Matcher
    • Tools
    • Tpex
      • BaseParam
      • Element
        • Loop
        • TestLoop
      • Event
      • Exception
      • Filter
      • Tokenizer

Classes

  • Tokenize

Interfaces

  • TokenizeInterface
  • Overview
  • Namespace
  • Class
  • Tree

Class Tokenize

Thelia\Tpex\Tokenizer\Tokenize implements Thelia\Tpex\Tokenizer\TokenizeInterface
Namespace: Thelia\Tpex\Tokenizer
Located at core/lib/Thelia/Tpex/Tokenizer/Tokenize.php
Methods summary
public
# __construct( Symfony\Component\HttpFoundation\Request $request, Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher, mixed $content = null )
public
# setLoop( array $loops )

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" );

Parameters

$loops
array
$loops

Throws

InvalidArgumentException
if loop name already exists

Implementation of

Thelia\Tpex\Tokenizer\TokenizeInterface::setLoop()
public array
# getLoop( )

Returns

array
containing all loop. array's key are name loop and array value is the class of this loop
public
# setFilter( array $filters )

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" );

Parameters

$filters
array
$filters

Throws

InvalidArgumentException
if filter name already exists

Implementation of

Thelia\Tpex\Tokenizer\TokenizeInterface::setFilter()
public
# setTestLoop( array $testLoops )

associative array containing information for loop test execution

associative array containing information for loop test execution

key is test loop name value is the class implementing/extending base test loop classes

ex :

$testLoop = array( "equal" => "Thelia\testLoop\Equal", "myTestLoop" => "My\Own\TestLoop" );

Parameters

$testLoops
array
$testLoops

Throws

InvalidArgumentException
public
# getTestLoop( )
public
# getFilter( )
public
# setContent( mixed $content )

the content to parse and tokenize

Parameters

$content
mixed
$content

Implementation of

Thelia\Tpex\Tokenizer\TokenizeInterface::setContent()
public Thelia\Tpex\Element|Thelia\Tpex\Element\ElementCollection
# tokenize( )

Returns

Thelia\Tpex\Element|Thelia\Tpex\Element\ElementCollection

Implementation of

Thelia\Tpex\Tokenizer\TokenizeInterface::tokenize()
protected Thelia\Tpex\Element\ElementCollection
# parseContent( )

Returns

Thelia\Tpex\Element\ElementCollection
protected
# parseArgs( )
protected
# addVar( mixed $token )
protected
# processToken( mixed $atoken )
protected
# controlEndLoop( string $idLoop )

When end tag is found like /THELIA, Tpex control that this end tag is good and ended good loop.

Parameters

$idLoop
string
$idLoop

Throws

Thelia\Tpex\Exception\TokenSyntaxException
protected Thelia\Tpex\Element\SimpleLoopElement
# initSimpleLoop( mixed $token )

Initialize a simpleLoopElement with arguments and content.

name is the seconde part of THELIA_xxx tag (ex : for THELIA_foo foo is the loop name).

$token and \Thelia\Tpex\Element\SimpleLoopElement are push into self::loopIdStack and self::currentLoopStack respectively

Parameters

$token
mixed
$token

Returns

Thelia\Tpex\Element\SimpleLoopElement
protected
# initRepeatLoop( mixed $token )
protected
# initConditionalLoop( mixed $token )
protected
# initConditionalVarLoop( mixed $token )
protected
# initTestLoop( mixed $token )
protected
# skipTo( mixed $val )

skip to the next element containing in $val

Parameters

$val
mixed
$val search value
protected integer
# findTokenType( mixed $token )

This function search if tag is knowing by Tpex and return is int code.

An exception is thrown if token is unknown by Tpex

Parameters

$token
mixed
$token the token to find

Returns

integer

Throws

Thelia\Tpex\Exception\TokenNotFoundException
Properties summary
protected mixed $in_comment
#
protected Symfony\Component\HttpFoundation\Request $request
#
protected Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher
#
protected array $tags array( "THELIA_" => TpexToken::OSL, "/THELIA_" => TpexToken::CSL, "TEST_" => TpexToken::OTL, "/TEST_" => TpexToken::ETL, "//TEST_" => TpexToken::CTL, "T_" => TpexToken::OCL, "/T_" => TpexToken::ECL, "//T_" => TpexToken::CCL, "REM" => TpexToken::OCM, "/REM" => TpexToken::CCM, "REPEAT_" => TpexToken::ORL, "/REPEAT_" => TpexToken::CRL, "T:" => TpexToken::OCVL, "/T:" => TpexToken::ECVL, "//T:" => TpexToken::CCVL )
#

$tags

$tags

protected array $tokens array()
#
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 filter classes

ex :

$filter = array( "upperCase" => "Thelia\Filter\UpperCase", "lowerCase" => "Thelia\Filter\LowerCase", "myFilter" => "My\Own\Filter" );

protected Array $testLoop array()
#

associative array containing information for loop test execution

associative array containing information for loop test execution

key is test loop name value is the class implementing/extending base test loop classes

ex :

$testLoop = array( "equal" => "Thelia\testLoop\Equal", "myTestLoop" => "My\Own\TestLoop" );

protected array $loopIdStack array()
#
protected array $currentLoopStack array()
#
thelia API documentation generated by ApiGen 2.8.0