Skip to content

Instantly share code, notes, and snippets.

@ad3n
Created April 16, 2016 16:09
Show Gist options
  • Save ad3n/8136b805572ce1c2c278f51700aaf800 to your computer and use it in GitHub Desktop.
Save ad3n/8136b805572ce1c2c278f51700aaf800 to your computer and use it in GitHub Desktop.
AdminBundle Autocomplite
@Util(datePicker=true, autoComplete={"route"="search_donatur", "targetSelector"="donatur"})
->add('donatur', ChoiceType::class, array(
'choices' => array(),
'label' => 'label.domain.donatur',
'attr' => array(
'class' => 'form-control autocomplete donatur',
),
))
/**
* @Route("/search/", name="search_donatur")
*/
public function searchAction(Request $request)
{
return new JsonResponse(array(
array(
'id' => 1,
'text' => 'A',
),
array(
'id' => 2,
'text' => 'B',
),
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment