IconButtonType

A form button with material icon.

  • Namespace: PrestaShopBundle\Form\Admin\Type
  • Reference: IconButtonType

Type options

Option Type Default value Description
icon string The icon to display
type string The button type (link, …)

Code example

$builder
    ->add('actions', ButtonCollectionType::class, [
        'buttons' => [
            'catalog' => [
                'type' => IconButtonType::class,
                'options' => [
                    'label' => $this->trans('Go to catalog', 'Admin.Catalog.Feature'),
                    'type' => 'link',
                    'icon' => 'arrow_back_ios',
                    'attr' => [
                        'class' => 'btn-outline-secondary go-to-catalog-button',
                        'href' => $this->router->generate('admin_products_index', ['offset' => 'last', 'limit' => 'last']),
                    ],
                ],
            ],
        ],
    ])

Preview example

IconButtonType rendered in form example