public static function dropdown()
    {
        // get all records from database and generate
        static $dropdown;
        if ($dropdown === null) {
            $models = static::find()->all();
            foreach ($models as $model) {
                $dropdown[$model->id] = $model->name;
            }
        }
        return $dropdown;
    }
public static function dropdown()
    {
        // get all records from database and generate
        static $dropdown;
        if ($dropdown === null) {
            $models = static::find()->all();
            foreach ($models as $model) {
                $dropdown[$model->id] = $model->name;
            }
        }
        return $dropdown;
    }
public static function dropdown ( ) { // get all records from database and generate static $ dropdown ; if ( $ dropdown === null ) { $ models = static :: find ( ) -> all ( ) ; foreach ( $ models as $ model ) { $ dropdown [ $ model -> id ] = $ model -> name ; } } return $ dropdown ; }
Get list of roles for creating dropdowns
@return array
Get list of roles for creating dropdowns