我有一个包含数组形式的常量选项的类:
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'
);
}
如何在 symfony 2.2 twig 中访问 $UNVERSITY_STANDING 或 $GENDER?