Dear all,
I have an issue that i do not understand how to figure out.
I would like to put a form view into a blockService to put on the dashboard.
I have a formType as this :
class GoogleMapType extends AbstractType {
public function buildForm(FormBuilderInterface $builder, array $options) {
...
->add('adoptant', 'entity', array(
'class' => 'acmeBundle:Persons\Adoptant',
'query_builder' => function (AdoptantRepository $ar) {
return $ar->queryFindAll();
...
My block Service is like this
class GoogleMapsBlockService extends BaseBlockService {
public function __construct($type, $templating) {
$this->templating = $templating;
public function getName() {
public function getDefaultSettings() {
public function validateBlock(ErrorElement $errorElement, BlockInterface $block) {
public function buildEditForm(FormMapper $formMapper, BlockInterface $block) {
public function execute(BlockContextInterface $blockContext, Response $response = null) {
$settings = array_merge($this->getDefaultSettings(), $blockContext->getBlock()->getSettings());
$formFactory = Forms::createFormFactory();
$form = $formFactory->create(new GoogleMapType());
return $this->renderResponse('AcmeBundle:Block:GoogleMaps.html.twig', array(
'block' => $blockContext->getBlock(),
'form' => $form->createView(),
When I "plug" the blockservice into sonata admin configuration i have this error
"An exception has been thrown during the rendering of a template ("Could not load type "entity"") in SonataAdminBundle:Core:dashboard.html.twig at line 24."
It's work correctly if there are not 'entity' type into the formType.
Please do you know how to push formtype with entity type ?
Regards
ps : thanks a lot for this project !