Create Action

Create Action Type

First you have to create your php action type class, which implements the Enhavo\Bundle\AppBundle\Action\ActionTypeInterface. Enhavo provide some abstract classes with base functionality such as Enhavo\Bundle\AppBundle\Action\AbstractActionType and Enhavo\Bundle\AppBundle\Action\AbstractActionUrlType.


namespace App\Action;

class ExportActionType extends AbstractActionType implements ActionTypeInterface
    // the view data will be pass to directly to the component
    public function createViewData(array $options, $resource = null)
        $data = parent::createViewData($options, $resource);

        $data = array_merge($data, [


        return $data;

    // define options for your action
    public function configureOptions(OptionsResolver $resolver)

            'component' => 'download-action',
            'label' => 'Export',
            'icon' => 'download',

    public function getType()
        return 'export';

Add to service

Now you have to add the created class to the dependency injection container.

     public: true
         - { name: 'enhavo.action', alias: 'export' }