Skip to content

Enhance ActiveForm to dynamically configure enabled, readonly and staticOnly flags #136

@stovesy

Description

@stovesy

I wonder if you would consider the following enhancement.
It is an alteration to the protected function initDisability(&$options) in ActiveField.php
The following will disable any attributes which are not active. I am using this to automatically disable unavailable fields as defined in scenarios.

$model = $this->model;
if (!in_array($this->attribute, $model->activeAttributes())) {
$options['disabled'] = true;
}

Thanks for you time

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions