schmunk42\giiant\generators\crud\ProviderTrait::activeField PHP Метод

activeField() публичный Метод

Generates code for active field by using the provider queue.
public activeField ( $attribute, null $model = null ) : mixed | string
$model null
Результат mixed | string
    public function activeField($attribute, $model = null)
    {
        if ($model === null) {
            $model = $this->modelClass;
        }
        $code = $this->callProviderQueue(__FUNCTION__, $attribute, $model, $this);
        if ($code !== null) {
            Yii::trace("found provider for '{$attribute}'", __METHOD__);
            return $code;
        } else {
            $column = $this->getColumnByAttribute($attribute);
            if (!$column) {
                return;
            } else {
                return parent::generateActiveField($attribute);
            }
        }
    }