I have a class containing constant options in array form:
namespace MyNameSpace;
class OptionConstants
{
/**
* Gender options
*/
public static $GENDER = array(
'Male',
'Female'
);
/**
* University year levels
*/
public static $UNVERSITY_STANDING = array(
'--None--',
'First Year',
'Second Year',
'Third Year',
'Fourth Year',
'Graduate Student',
'Graduated',
'Other'
);
}
How can I access $UNVERSITY_STANDING or $GENDER in symfony 2.2 twig?
{{ constant('Namespace\\Classname::CONSTANT_NAME') }}