akcja kontrolera:
public function assetAction() { $em = $this->getDoctrine()->getEntityManager(); $task = new asset(); $form = $this->createFormBuilder($task) "error_bubbling" => true, 'required' => false, )) ->getForm(); 'form' => $form->createView()); }
plik Twig:
{{ form_start(form, {'attr' : {'style' : 'color:black' } } ) }} {{ form_errors(form.model) }} {{ form_widget(form.model, {'attr' : {'class' : 'form-inline','autocomplete':'off' } }) }} {{ form_row(form.save, { 'label': 'Szukaj' }) }} {% endblock %}
Plik konfiguracyjny:
validation: { enable_annotations: true }
Plik entity asset:
namespace AppBundle\Entity; class Asset { protected $model; public function getModel() { return $this->model; } public function setModel($model) { $this->model= $model; } }
Co jest źle?? Ponieważ nie mogę wygenerować błędów w formularzu