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 .

2
  • what is locationForm , a url parameter ? doesnt the render tag takes a url or a path ? Commented Jun 10, 2013 at 17:00
  • @mpm locationForm is a parameter in the method Commented Jun 10, 2013 at 17:02

1 Answer 1

1

try this :

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

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

Sign up to request clarification or add additional context in comments.

4 Comments

it is that same as im using .. i have tried it before , didnt work . thats though :)
you are using {% render %} tag and not the function in your exemple.Anyway let me check , i'll come back to you ASAP.
thanks for your concern , i really need to get this fixed , i have tried your solution again .. and still that same problem
this seams to be an issue (or more of the way that symfony operates now ) , i will accept the answer .. thanks for the help

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.