我希望在symfony2中使用自定义查询中的值填充选择框.我尽可能地尝试简化.
调节器
class PageController extends Controller
{
    public function indexAction()
    {
      $fields = $this->get('fields');
      $countries =  $fields->getCountries(); // returns a array of countries e.g. array('UK', 'France', 'etc')
      $routeSetup = new RouteSetup(); // this is the entity
      $routeSetup->setCountries($countries); // sets the array of countries
      $chooseRouteForm = $this->createForm(new ChooseRouteForm(), $routeSetup);
      return $this->render('ExampleBundle:Page:index.html.twig', array(
        'form' => $chooseRouteForm->createView()
      ));
    }
}
ChooseRouteForm
class ChooseRouteForm extends AbstractType
{
  public function buildForm(FormBuilderInterface $builder, array $options)
  {
    // errors... ideally I want this to fetch the items …