Answer the question
In order to leave comments, you need to log in
How to display error in form builder (laravel, symphony)?
No error message is displayed in the form when the field is not filled, built with the form builder (form symphony) used in laravel
])->add("interfaceLangs", "entity", [
"expanded" => true,
"multiple" => true,
"class" => "App\Models\ApplicationInterfaceLang",
"property" => "label",
"label_attr" => ["class" => "control-label required"],
"rules" => "required_with:name",
"selected" => function ($langs) {
if (!$langs) {
return [];
}
return $langs->pluck("id")->toArray();
},
'choice_options' => [
'wrapper' => ['class' => 'form-check-inline checkbox mb-2'],
],
"error_messages" => [
"language.required_with" => 'Обязательное поле',
],
"label" => "Языки интерфейса",
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