-
Notifications
You must be signed in to change notification settings - Fork 0
ConstantExtention allows you testing if a PHP constant is already defined from a Twig template - is constant defined - constant exists - twig - symfony
License
timotheemoulin/TwigConstantExtension
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Twig Constant Extension ========================== For any question : [email protected] How to use : ========================== 1. Copy the extension under /Acme/TwigExtensionBundle/Twig/ConstantExtension.php 2. Add the following lines in /Acme/TwigExtensionBundle/Resources/config/services.yml (or in any loaded configuration file (eg config.yml) 3. Call the function from your Twig template as following: {%if isConstDefined('myConstant')%} It will return you true if the constant is already defined and false otherwise.
About
ConstantExtention allows you testing if a PHP constant is already defined from a Twig template - is constant defined - constant exists - twig - symfony
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published