CEnumerable

优质
小牛编辑
124浏览
2023-12-01

所有包

system.base
继承class CEnumerable
源自1.0
版本$Id: CComponent.php 3521 2011-12-29 22:10:57Z mdomba $
源码framework/base/CComponent.php

CEnumerable是所有枚举类的基类。

定义一个枚举类型,继承CEnumberable并定义字符串常量。
每一个枚举值代表一个常数。
常量的名字必须与常量的值相同。
例如,

class TextAlign extends CEnumerable
{  const Left='Left';  const Right='Right';
}

然后,
可以使用TextAlign::Left和TextAlign::Right的枚举值。