schmunk42\giiant\generators\crud\providers\core\OptsProvider::attributeFormat PHP Method

attributeFormat() public method

.]ValueLabel function.
public attributeFormat ( $attribute ) : null | string
return null | string
    public function attributeFormat($attribute)
    {
        $modelClass = $this->generator->modelClass;
        $camel_func = 'get' . str_replace(' ', '', ucwords(implode(' ', explode('_', $attribute)))) . 'ValueLabel';
        if (!method_exists($modelClass::className(), $camel_func)) {
            return;
        }
        return <<<EOS
            [
                'attribute'=>'{$attribute}',
                'value'=>{$modelClass}::{$camel_func}(\$model->{$attribute}),
            ]
EOS;
    }