Lines Matching refs:as

18     share them with others, you should then create an extension as described
53 * The tag is not flexible as you cannot use it in an expression:
131 side of the filter (before the pipe ``|``) as first argument and the extra
132 arguments passed to the filter (within parentheses ``()``) as extra arguments.
134 Defining a filter is as easy as associating the filter name with a PHP
150 As you can see, the ``'TWIG'`` string is passed as a first argument to the PHP
178 Adding a filter is as simple as calling the ``addFilter()`` method on the
185 Here, we use ``Twig_Filter_Function`` as the filter is a PHP function. The
205 As you can see, the ``prefix`` argument of the filter is passed as an extra
208 Adding this filter is as easy as before::
212 For better encapsulation, a filter can also be defined as a static method of a
214 static methods as filters::
220 In an extension, you can also define a filter as a static method of the
226 The ``Twig_Filter`` classes take options as their last argument. For instance,
232 Twig will then pass the current environment as the first argument to the
247 before printing. If your filter acts as an escaper (or explicitly outputs HTML
266 A filter name containing the special ``*`` character is a dynamic filter as
319 You can also expose extension methods as functions in your templates::
334 as the ``*`` can be any string::
366 feature as you need to understand how Twig's internals work.
381 The ``set`` tag is part of the Core extension and as such is always
397 Adding a tag is as simple as calling the ``addTokenParser`` method on the
487 * ``raw()``: Writes the given string as is.
498 the current node as a comment.
604 way, you just need to implement the ``getName()`` method as the
625 Twig does not care where you save your extension on the filesystem, as all
700 As seen in the previous chapter, you can also define filters as static methods
737 them by creating your own extension. Just use the same names as the one you
762 is as simple as registering the ``MyCoreExtension`` extension by calling the