| 包 | system.base |
|---|---|
| 继承 | class CEnumerable |
| 源自 | 1.0 |
| 版本 | $Id: CComponent.PHP 3521 2011-12-29 22:10:57Z mDOMba $ |
| 源码 |
CEnumerable是所有枚举类的基类。
定义一个枚举类型,继承CEnumberable并定义字符串常量。 每一个枚举值代表一个常数。 常量的名字必须与常量的值相同。 例如,
定义一个枚举类型,继承CEnumberable并定义字符串常量。 每一个枚举值代表一个常数。 常量的名字必须与常量的值相同。 例如,
class TextAlign extends CEnumerable
{
const Left='Left';
const Right='Right';
}
然后,
可以使用TextAlign::Left和TextAlign::Right的枚举值。