Difference between #1 and #2 of
Managing constants easily

Changes

Title unchanged

Managing constants easily

Category unchanged

Tips

Yii version unchanged

Tags unchanged

model, constant, constants

Content changed

[...]
### getConstants()
For this small problem i am using function **getConstants()**.

```php
public
static function getConstants($token,$objectClass) {
$tokenLen = strlen($token);
[...]
Class::getConstants('MY_STATUS');
*/
public
static function getConstants($token,$objectClass) {
$tokenLen = strlen($token);
[...]
}
//..
public
static function getStatuses() { return self::getConstants('STATUS_',__CLASS__); } public static function getTypes() {
return self::getConstants('TYPE_',__CLASS__);
}

}
```
[...]
4 0
7 followers
Viewed: 30 801 times
Version: 1.1
Category: Tips
Written by: briiC.lv
Last updated by: briiC.lv
Created on: Dec 9, 2011
Last updated: 12 years ago
Update Article

Revisions

View all history