Zainstalowałem: https://github.com/PUGX/PUGXAutoCompleterBu...es/doc/index.md (select2). Troche musiałem zmienić w js ale formularz działa poprawnie (znaczy się pole wyszukuje poprawnie).
Ale niestety gdy chcę zapisać pole to dostaję błąd:

w kontrolerze daję:
$form = $this->createFormBuilder($company) ->add('id_city','autocomplete',array('label'=>'Miasto','class'=>'Acme\Bundle\AdminBundle\Entity\City')) ->getForm();
Entity dla company:
... /** * Set idCity * * @param \Acme\Bundle\AdminBundle\Entity\City $idCity * @return Company */ public function setIdCity(\Acme\Bundle\AdminBundle\Entity\City $idCity = null) { $this->idCity = $idCity; return $this; } /** * Get idCity * * @return \Acme\Bundle\AdminBundle\Entity\City */ public function getIdCity() { return $this->idCity; }
Entity City wygląda stand. ID | Name itd.
A tutaj transfermer i formularz typu: autocomplete:
https://github.com/PUGX/PUGXAutoCompleterBu...ree/master/Form
Dziękuje.
pozdrawiam