PHP Classes

File: Library/vendor/twig/twig/doc/functions/constant.rst

Recommend this page to a friend!
  Classes of Duong Huynh Nghia   Lego PHP   Library/vendor/twig/twig/doc/functions/constant.rst   Download  
File: Library/vendor/twig/twig/doc/functions/constant.rst
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Lego PHP
Blog and shopping cart system
Author: By
Last change:
Date: 7 years ago
Size: 431 bytes
 

Contents

Class file image Download
``constant`` ============ .. versionadded: 1.12.1 constant now accepts object instances as the second argument. ``constant`` returns the constant value for a given string: .. code-block:: jinja {{ some_date|date(constant('DATE_W3C')) }} {{ constant('Namespace\\Classname::CONSTANT_NAME') }} As of 1.12.1 you can read constants from object instances as well: .. code-block:: jinja {{ constant('RSS', date) }}