Enumerator class in PHP
If you want an elegant way to an have enumerated type try this:
class QFlashMessageType {
const Info = 0;
const Error = 1;
}
You can use it in this way:
QFlashMessageType::Info;
An enum class example on stackoverflow: http://stackoverflow.com/questions/254514/php-and-enums
Labels: enumerator enums
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home