Skip to content

RegisterResourceTokenParser ​

Type
Class
Namespace
craft\web\twig\tokenparsers
Inherits
craft\web\twig\tokenparsers\RegisterResourceTokenParser » Twig\TokenParser\AbstractTokenParser
Since
3.0.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
defaultPositioninteger, null – The default $position value that should be possed to the method, if it has a $position argument.
methodstring – The View method the tag represents
tagstring – The tag name

allowOptions ​

Type
boolean
Default value
false

Whether the tag can specify additional options

View source

allowPosition ​

Type
boolean
Default value
false

Whether the tag can specify the position of the resource

View source

allowRuntimePosition ​

Type
boolean
Default value
false

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

View source

allowTagPair ​

Type
boolean
Default value
false

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

View source

defaultPosition ​

Type
integer, null
Default value
null
Since
3.6.11

The default $position value that should be possed to the method, if it has a $position argument.

View source

method ​

Type
string
Default value
null

The View method the tag represents

View source

tag ​

Type
string
Default value
null

The tag name

View source

Public Methods ​

MethodDescription
__construct()
decideBlockEnd()
getTag()
parse()

__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

decideBlockEnd() ​

View source

Arguments ​

  • $token (\Twig\Token)

Returns ​

boolean

getTag() ​

View source

parse() ​

View source

Arguments ​

  • $token