FetchTag
extends Twig_TokenParser
in package
Defines the 'fetch' template tag that provides backward compatibility with Gryphon-based templates. Objects returned will be wrapped in object compatibility wrappers.
Example:
{% fetch foo as article with [
'limit': 1,
'order': 'created desc',
'where': 'status = 1'
] %}
// find articles with BOTH tags
{% fetch foo as article with [
'limit': 12,
'order': 'created desc',
'where': 'status = 1'
'withTags': ['frontpage', 'sports']
] %}
// find articles with EITHER tags
{% fetch foo as article with [
'limit': 12,
'order': 'created desc',
'where': 'status = 1'
'withTags': ['frontpage|sports']
] %}
Table of Contents
Methods
getTag()
public
getTag() : mixed
Return values
mixed —parse()
public
parse(Twig_Token $tok) : mixed
Parameters
- $tok : Twig_Token