Skip to content

ConstantExtention allows you testing if a PHP constant is already defined from a Twig template - is constant defined - constant exists - twig - symfony

License

Notifications You must be signed in to change notification settings

timotheemoulin/TwigConstantExtension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

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

No packages published

Languages