function twig_constant in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/twig/twig/lib/Twig/Extension/Core.php \twig_constant()
Provides the ability to get constants from instances as well as class/global constants.
Parameters
string $constant The name of the constant:
null|object $object The object to get the constant from:
Return value
string
1 string reference to 'twig_constant'
- Twig_Extension_Core::getFunctions in vendor/twig/ twig/ lib/ Twig/ Extension/ Core.php 
File
- vendor/twig/ twig/ lib/ Twig/ Extension/ Core.php, line 1505 
Code
function twig_constant($constant, $object = null) {
  if (null !== $object) {
    $constant = get_class($object) . '::' . $constant;
  }
  return constant($constant);
}