Answer the question
In order to leave comments, you need to log in
How to get data from callback function?
Good afternoon. I'm making a trait for the model, which will build a form for the model according to the passed field config.
That is, I make a config like this
public $fields = [
0 => [
'height' => [
'title_trans' => 'users.fields.height',
'type' => 'text',
'name' => 'trainee[height]',
'required' => 1,
'value' => 'trainee.height',
],
'weight' => [
'title_trans' => 'users.fields.weight',
'type' => 'text',
'name' => 'trainee[weight]',
'required' => 1,
'value' => 'trainee.weight'
],
]
setDataFor($field, $data)
и подготавливать модель в контроллере, но это глупо как по мне. Как это можно реализовать, подскажите?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question