My forms works perfectly when I used standard controller/view rendering.

But when I want to put into a block service, everything goes wrong.

It seems that the error is trigger when " $formFactory->create(new
GoogleMapType());" is evaluated



public function execute(BlockContextInterface $blockContext, Response
$response = null) {
        $settings = array_merge($this->getDefaultSettings(),
$blockContext->getBlock()->getSettings());

        $formFactory = Forms::createFormFactory();

        $form = $formFactory->create(new GoogleMapType());

        dump($form);// HERE NOT TRIGGERED

        return
$this->renderResponse('ApparRefugeBundle:Block:GoogleMaps.html.twig', array(
                    'block' => $blockContext->getBlock(),
                    'settings' => $settings,
                    'form' => $form->createView(),
                        ), $response);
    }


2016-07-29 19:44 GMT+02:00 Stephane Alamichel <[email protected]>
:

> yes also, i'm going crazy.
>
> 2016-07-29 19:41 GMT+02:00 Cassiano Tartari <[email protected]>:
>
>>
>> 2016-07-29 14:39 GMT-03:00 Stephane Alamichel <
>> [email protected]>:
>>
>>> An exception has been thrown during the rendering of a template ("Could
>>> not load type "EntityType::class"")
>>
>>
>> ​And you've added "use Symfony\Bridge\Doctrine\Form\Type\EntityType​;" ?
>>
>>
>> Att.,
>> Cassiano Tartari
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "sonata-users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/sonata-users/PG-gSsp5YQo/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/sonata-users.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sonata-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sonata-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to