Skip to content

Action reference

Inherit Options

label

type: string

Overwrite the default label. It will be translated over the translation service automatically (See translationDomain)

yaml
actions:
    myAction:
        label: myLabel
        # ... further option

translation_domain

type: string

Overwrites the default translationDomain. The selected bundle implements a translation service for automatic translation all translatable designations, e.g. the label

yaml
actions:
    myAction:
        translation_domain: myTranslationDomain
        # ... further option

confirm

type: boolean

If value is true, the action must be confirmed again by the user.

yaml
actions:
    myAction:
        confirm: true|false
        # ... further option

confirm_changes

type: boolean

If this value is true, the form registers changes made and the user must confirm that he wants to continue despite the changes made

yaml
actions:
    myAction:
        confirm_changes: true|false
        # ... further option

confirm_label_cancel

type: string

Overwrites the default cancel-button lettering in the confirm modal window. It will be translated over the translation service automatically (See translationDomain)

yaml
actions:
    myAction:
        confirm_label_cancel: myMessage
        # ... further option

confirm_label_ok

type: string

Overwrites the default confirm-button lettering in the confirm modal window. It will be translated over the translation service automatically (See translationDomain)

yaml
actions:
    myAction:
        confirm_label_ok: myMessage
        # ... further option

confirm_message

type: string

Overwrites the default message in the confirm modal window. It will be translated over the translation service automatically (See translationDomain)

yaml
actions:
    myAction:
        confirm_message: myMessage
        # ... further option

hidden

type: boolean

If value set true, the action is hidden

yaml
actions:
    myAction:
        hidden: true|false
        # ... further option

icon

type: string

Overwrite the default icon. The Icon is part of the clickable button.

yaml
actions:
    myAction:
        icon: myIcon
        # ... further option

permission

type: string

Defines the minimum access rights a user needs to use this action.

yaml
actions:
    myAction:
        permission: myPermission
        # ... further options

route

type: string

Defines which route should be used for the overlay.

yaml
actions:
    myAction:
        route: my_route

route_parameters

type: array

If route is defined, you can overwrite the standard parameters to generate your own url.

yaml
actions:
    myAction:
        route_parameters:
            id: $id

view_key

type: string

Set the enhavo view key of the new target window

yaml
actions:
    myAction:
        view_key: 'edit-view'
        # ... further option

Close

The close action closes the current window and can ask the user to save previously made changes.

Typeclose
ClassEnhavo\Bundle\AppBundle\Action\Type\CloseActionType
ParentEnhavo\Bundle\AppBundle\ActionAbstractActionType
Inherit Optionsiconlabel, translation_domain, hidden, permission

Comment

This action redirects the user to the comments that have been posted on an article, blog entry or similar. The class for which this action should be used must implement the CommentSubjectInterface like for example the entity Enhavo\Bundle\ArticleBundle\Entity\Article

Typecomment
ClassEnhavo\Bundle\CommentBundle\Action\CommentsActionType
ParentEnhavo\Bundle\AppBundle\ActionAbstractActionType
Inherit Optionslabel, route, translation_domain, icon, permission, hidden

Create

The CreateAction represents a create button for a specific route.

Typecreate
ClassEnhavo\Bundle\AppBundle\Action\Type\CreateActionType
ParentEnhavo\Bundle\AppBundle\Action\Type\OpenActionType
Optionsroute*
Inherit Optionsroute_parameters, label, translation_domain, hidden, permission, view_key

route

type: string

Define which route should be used for the create overlay.

yaml
actions:
    create:
        type: create
        route: my_create_route

Delete

Deletes the current resource and closes the window.

Typedelete
ClassEnhavo\Bundle\AppBundle\Action\Type\DeleteActionType
Optionsroute*
Inherit Optionsroute_parameters, label, translation_domain, hidden, permission, view_key, confirm, confirm_message, confirm_label_ok, confirm_label_cancel

route

type: string

Define which route should be used to delete the selected resource.

yaml
actions:
    delete:
        type: delete
        route: my_delete_route

Download

Downloads the current resource. The Resource has to implement the Enhavo\\Bundle\\MediaBundle\\Model\\FileInterface{.interpreted-text role="class"}

Typedownload
ClassEnhavo\Bundle\AppBundle\Action\Type\DownloadActionType
Optionsroute*
Inherit Optionsroute_parameters, label, translation_domain, hidden, permission, view_key, confirm, confirm_message, confirm_label_ok, confirm_label_cancel

route

type: string

Defines which route should be used to download the selected resource.

yaml
actions:
    download:
        type: download
        route: my_download_route

ajax

type: boolean

If the value is true, the download request call is executed via "Ajax"-Call in the background.

yaml
actions:
    download:
        type: download
        route: my_download_route
        ajax: true

Duplicate

Duplicates the current resource and creates a new instance with the same values.

Typedownload
ClassEnhavo\Bundle\AppBundle\Action\Type\DuplicateActionType
Optionsroute*
Inherit Optionsroute_parameters, label, translation_domain, hidden, permission, view_key, confirm, confirm_message, confirm_label_ok, confirm_label_cancel

route

type: string

Define which route should be used to duplicate the selected resource.

yaml
actions:
    duplicate:
        type: duplicate
        route: my_duplicate_route

Event

Executes all handlers and behaviors of the specified jQuery event.

Typeevent
ClassEnhavo\Bundle\AppBundle\Action\Type\EventActionType
Optionsroute*, label*, icon*
Inherit Optionsroute_parameters, translation_domain, hidden, permission, view_key, confirm, confirm_message, confirm_label_ok, confirm_label_cancel

event

type: string

The jQuery event that is manually triggered when the action is clicked.

yaml
actions:
    event:
        type: event
        event: myEvent

The event-string "myEvent" represents the jQuery event which has to be present in your project like this general example:

javascript
$(document).on("myEvent", function() {
    doSomething();
});

Filter

Opens an additional view that contains all available filters of a table.

Typeevent
ClassEnhavo\Bundle\AppBundle\Action\Type\EventActionType
Inherit Optionslabel, icon, translation_domain, hidden, permission, view_key

Filters must be added under my_entity_table. By default, this action is only available for the index window which is represented by the my_entity_index route. How to create or add custom filters is described here <add_custom_filter> in more detail.

yaml
app_entity_index:
    options:
        expose: true
    path: /app/entity/index
    methods: [GET]
    defaults:
        _controller: app.controller.entity:indexAction
        _sylius:
            viewer:
                actions:
                    filter:
                        type: filter

app_entity_table:
    options:
        expose: true
    path: /app/entity/table
    methods: [GET,POST]
    defaults:
        _controller: app.controller.entity:tableAction
        _sylius:
            filters:
                my_filter:
                    type: property_type
                    property: property
Typemodal
ClassEnhavo\Bundle\AppBundle\Action\Type\ModalActionType
Optionsmodal
Inherit Optionslabel, icon, translation_domain, hidden, permission

type: string

yaml
actions:
    modal:
        type: modal
        modal: myModal

Open

Opens the specified route in a separate tab in your browser. Can be used, for example, to view self-created newsletters, products, etc.

Typeopen
ClassEnhavo\Bundle\AppBundle\Action\Type\OpenActionType
Optionsroute*target
Inherit Optionsroute_parameters, label, translation_domain, hidden, permission, view_key, confirm, confirm_message, confirm_label_ok, confirm_label_cancel

route

type: string

Defines which route should be used to open the current resource

yaml
actions:
    open:
        type: open
        route: my_open_route

target

type: string

The target attribute specifies the target window base of a reference. If you use _view, the target window will be a new enhavo view.

yaml
actions:
    open:
        target: _targetOption

Output Stream

This action is a specified version of the modal-action <modal_action>. The route defines the controller action that generates the output stream of the current resource.

Typeoutput_stream
ClassEnhavo\Bundle\AppBundle\Action\Type\OutputStreamActionType
Optionsroute*
Inherit Optionsroute_parameters, label, translation_domain, hidden, permission, view_key

route

type: string

The route defines the action that generates the output stream of the current resource.

yaml
actions:
    output_stream:
        type: output_stream
        route: my_output_stream_route

Preview

Opens the integrated preview window with three different display modes for desktop, mobile and tablet.

Typepreview
ClassEnhavo\Bundle\AppBundle\Action\Type\PreviewActionType
Optionsroute*
Inherit Optionsroute_parameters, label, translation_domain, hidden, permission, view_key

route

Defines which preview route should be used to open the preview view.

yaml
actions:
    preview:
        type: preview
        route: my_preview_route

Save

Submits the current form and updates the current resource form view.

Typesave
ClassEnhavo\Bundle\AppBundle\Action\Type\SaveActionType
Optionsroute*
Inherit Optionsroute_parameters, label, translation_domain, hidden, permission, view_key

route

type: string

Define the save route where to send the current form. If you leave that parameter, the form will send to the default action of the form. If the passed resource has already an id, that id will also passed as parameter to the generate url.

yaml
actions:
    save:
        type: save
        route: my_save_route

Newsletter Send

Creates a receiver with a link to the currently selected newsletter for each member, all groups added to the newsletter. After that, the newsletter was prepared, but has not yet been sent out. The enhavo:newsletter:send command will send all newsletters that have not been sent up to that point to their respective receiver. To make sure that this happens regularly (e.g. at the same time every day) it is recommended to set up a cronjob for this command in your production environment.

Typenewsletter_send
ClassEnhavo\Bundle\NewsletterBundle\Action\SendActionType
Options
Inherit Optionslabel, translation_domain, hidden, permission

Newsletter Send Test

Sends the selected newsletter to any e-mail address for testing. The address can be changed each time. In contrast to the normal newsletter_send_action, the newsletter is sent immediately.

Typenewsletter_send
ClassEnhavo\Bundle\NewsletterBundle\Action\SendTestActionType
Optionsmodal,
Inherit Optionslabel, translation_domain, hidden, permission

type: string

php
[
    'component' => 'ajax-form-modal',
    'route' => 'enhavo_newsletter_newsletter_test_form',
    'actionRoute' => 'enhavo_newsletter_newsletter_test'
]

In this modal the e-mail address is entered and the routes for the form and the controller are defined.

yaml
actions:
    modal:
        type: modal
        modal:
            component: my_modal_component
            route: my_modal_form_route
            actionRoute: my_modal_action_route

Update

Opens a window in which the selected resource can be edited. Can be used in a table column if the default opening route is used for something else.

Typeupdate
ClassEnhavo\Bundle\AppBundle\Action\Type\UpdateActionType
Optionsroute*
Inherit Optionsroute_parameters, label, translation_domain, hidden, permission, view_key

route

type: string

Defines which update route should be used to edit the selected resource.

yaml
actions:
    update:
        type: update
        route: my_ressource_update_route