mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Pass the data set along with getOptions methods
This is useful when the model is unreliable, because it is not always populated with the relevant data set. This argument is only needed in edge cases, like when using a repeater or other split class<->data scenarios Refs #2235
This commit is contained in:
parent
675a6a4224
commit
c70db75d38
@ -1041,10 +1041,10 @@ class Form extends WidgetBase
|
||||
}
|
||||
|
||||
if ($this->objectMethodExists($model, $methodName)) {
|
||||
$fieldOptions = $model->$methodName($field->value);
|
||||
$fieldOptions = $model->$methodName($field->value, $this->data);
|
||||
}
|
||||
else {
|
||||
$fieldOptions = $model->getDropdownOptions($attribute, $field->value);
|
||||
$fieldOptions = $model->getDropdownOptions($attribute, $field->value, $this->data);
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user