0

I'm trying to render a controller amd send the $from->createView() object. Now, this works in <=2.1, but I can't seem to get it to work in 2.2.

Here is the code:

EventsContoller::newAction

return $this->render('SplurginEventsBundle:SplurginEventEvents:new.html.twig', array(
    'entity' => $entity,
    'form'   => $form->createView(),
    'existingFiles'=>$existingFiles,
    'editId'=>$editId,
    'isNew'=>true,
));

Right now the form variable is holding an object of the form view, I verified with var_dump.

In twig:

{% render controller('JulLocationBundle:Googlemaps:placesAutocomplete' , {locationForm: form}) %}

When I go to the controller placesAutocomplete and again use var_dump, I can see that it is an array and not an object.

How can I send an object and not an array to the controller being rendered?

EDIT :

this issue was resolved , with lot's of edits .. if any one is interested in the JulLocationBundle i will provide a pull request in a few days .

4

1 回答 1

1

尝试这个 :

{{ render(controller('JulLocationBundle:Googlemaps:placesAutocomplete' , {locationForm: form})) }}

http://symfony.com/doc/current/book/templating.html#embedding-controllers

于 2013-06-10T17:39:19.027 回答