Hello,
I would like to access my form widget data in my models beforeCreate
method, but I don’t want to save the data out of the form widget.
Here’s my getSaveValue
:
public function getSaveValue($value)
{
if (isset($value) && is_array($value)) {
return $value;
} else {
return [
'action' => 'no_action'
];
}
return \Backend\Classes\FormField::NO_SAVE_DATA;
}
When I put an underline in my form field, the $value
is null in the beforeCreate
method:
public function beforeCreate()
{
dd($this->sozjobs); // is null, when field name is _sozjobs
...
}
Here is my field:
sozjobs:
label: sozjobs.ch
span: full
type: sozjobs