declare(strict_types=1);
namespace App\Form\Type\UiElement;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints as Assert;
class GoogleMapsType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('link', TextType::class, [
'label' => 'app.ui_element.google_maps.link',
'
// ...
use MonsieurBiz\SyliusRichEditorPlugin\Attribute\AsUiElement;
#[AsUiElement(
code: 'app.google_maps',
icon: 'map pin',
)]
class GoogleMapsType extends AbstractType
// ...
#[AsUiElement(
code: 'app.google_maps',
title: 'my_cusom.title', // Use your own translation key or a string
description: 'my_custom.description',
icon: 'map pin',
templates: new TemplatesUiElement(
adminRender: 'MyCusomPath/google_maps.html.twig',
frontRender: 'MyCusomPath/google_maps.html.twig',
),
uiElement: GoogleMapsUiElement::class, // Use your own UiElement class
tags: ['map'], // Add some tags to filter the UiElement
wireframe: 'google_maps', // Add a wireframe to help the user to understand the UiElement, see below
)]