RegisterResourceTokenParser

Type
Class
Namespace
craft\web\twig\tokenparsers
Inherits
craft\web\twig\tokenparsers\RegisterResourceTokenParser » Twig_TokenParser
Implements
Twig_TokenParserInterface
Since
3.0

Class RegisterResourceTokenParser

View source

Public Properties

PropertyDescription
$allowOptionsboolean – Whether the tag can specify additional options
$allowPositionboolean – Whether the tag can specify the position of the resource
$allowRuntimePositionboolean – Whether the tag can specify a runtime-based position (load/ready)
$allowTagPairboolean – Whether the tag supports a tag pair mode for capturing the JS/CSS
$methodstring – The View method the tag represents
$newCodestring, null – The new template code that should be used if this tag is deprecated
$tagstring – The tag name

$allowOptions

Type
boolean

Whether the tag can specify additional options

View source

Signature

public boolean $allowOptions = false

$allowPosition

Type
boolean

Whether the tag can specify the position of the resource

View source

Signature

public boolean $allowPosition = false

$allowRuntimePosition

Type
boolean

Whether the tag can specify a runtime-based position (load/ready)

View source

Signature

public boolean $allowRuntimePosition = false

$allowTagPair

Type
boolean

Whether the tag supports a tag pair mode for capturing the JS/CSS

View source

Signature

public boolean $allowTagPair = false

$method

Type
string

The View method the tag represents

View source

Signature

public string $method = null

$newCode

Type
string, null

The new template code that should be used if this tag is deprecated

View source

Signature

public string, null $newCode = null

$tag

Type
string

The tag name

View source

Signature

public string $tag = null

Protected Properties

PropertyDescription
$parserTwig_Parser

Public Methods

MethodDescription
__construct()
decideBlockEnd()
getTag()Gets the tag name associated with this token parser.
parse()Parses a token and returns a node.
setParser()Sets the parser associated with this token parser.

__construct()

View source

Arguments

  • $tag (string) – The tag name
  • $method (string) – The View method the tag represents
  • $config (array) – Name-value pairs that will be used to initialize the object properties

Signature

public void __construct ( \craft\web\twig\tokenparsers\string $tag, \craft\web\twig\tokenparsers\string $method, array $config = [] )

decideBlockEnd()

View source

Arguments

Returns

boolean

Signature

public boolean decideBlockEnd ( Twig_Token $token )

getTag()

Gets the tag name associated with this token parser.

View source

Returns

string – The tag name

Signature

public string getTag ( )

parse()

Parses a token and returns a node.

View source

Arguments

  • $token

Returns

Twig_Node – A Twig_Node instance

Throws

Signature

public Twig_Node parse ( Twig_Token $token )