Difference between #1 and #2 of
Managing constants easily

Revision #2 has been created by briiC.lv on Dec 10, 2011, 8:45:10 AM with the memo:

public function => public static function (thanks to twisted1919)
« previous (#1)

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: 31 657 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