model.form.filterFields

Called after the form is initialized

Example usage:

$model->bindEvent('model.form.filterFields', function ((\Backend\Widgets\Form) $formWidget, (stdClass) $fields, (string) $context) use (\Winter\Storm\Database\Model $model) { if ($model->source_type == 'http') { $fields->source_url->hidden = false; $fields->git_branch->hidden = true; } elseif ($model->source_type == 'git') { $fields->source_url->hidden = false; $fields->git_branch->hidden = false; } else { $fields->source_url->hidden = true; $fields->git_branch->hidden = true; } });

Usage

Triggers

Class or file Line
Backend\Widgets\Form 1280
Copyright © 2024 Winter CMS