public static function statusDropdown()
    {
        // get data if needed
        static $dropdown;
        $constPrefix = "STATUS_";
        if ($dropdown === null) {

            // create a reflection class to get constants
            $reflClass = new ReflectionClass(get_called_class());
            $constants = $reflClass->getConstants();

            // check for status constants (e.g., STATUS_ACTIVE)
            foreach ($constants as $constantName => $constantValue) {

                // add prettified name to dropdown
                if (strpos($constantName, $constPrefix) === 0) {
                    $prettyName = str_replace($constPrefix, "", $constantName);
                    $prettyName = Inflector::humanize(strtolower($prettyName));
                    $dropdown[$constantValue] = $prettyName;
                }
            }
        }

        return $dropdown;
    }
public static function statusDropdown()
    {
        // get data if needed
        static $dropdown;
        $constPrefix = "STATUS_";
        if ($dropdown === null) {

            // create a reflection class to get constants
            $reflClass = new ReflectionClass(get_called_class());
            $constants = $reflClass->getConstants();

            // check for status constants (e.g., STATUS_ACTIVE)
            foreach ($constants as $constantName => $constantValue) {

                // add prettified name to dropdown
                if (strpos($constantName, $constPrefix) === 0) {
                    $prettyName = str_replace($constPrefix, "", $constantName);
                    $prettyName = Inflector::humanize(strtolower($prettyName));
                    $dropdown[$constantValue] = $prettyName;
                }
            }
        }

        return $dropdown;
    }
public static function statusDropdown ( ) { // get data if needed static $ dropdown ; $ constPrefix = "STATUS_" ; if ( $ dropdown === null ) { // create a reflection class to get constants $ reflClass = new ReflectionClass ( get_called_class ( ) ) ; $ constants = $ reflClass -> getConstants ( ) ; // check for status constants (e.g., STATUS_ACTIVE) foreach ( $ constants as $ constantName => $ constantValue ) { // add prettified name to dropdown if ( strpos ( $ constantName , $ constPrefix ) === 0 ) { $ prettyName = str_replace ( $ constPrefix , "" , $ constantName ) ; $ prettyName = Inflector :: humanize ( strtolower ( $ prettyName ) ) ; $ dropdown [ $ constantValue ] = $ prettyName ; } } } return $ dropdown ; }
Get list of statuses for creating dropdowns
@return array
Get list of statuses for creating dropdowns