Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3925

Symfony 4 get repository in template batch action

$
0
0

I use Symfony 4 and sonata admin. I created a custom batch action in the member list. I would like to have access to the other repositories in the batch action template. I would like to be able to select products before sending it to the members.

How to pass the repository by batch action?

    $actions['sendProducts'] = [
        'label' => 'Envoyer les produits',
        'ask_confirmation' => true,
        'template' => 'send-products.html.twig'
    ];

In my template I would like to have a select with all the names of my products (created in my products entity).

Thanks


Viewing all articles
Browse latest Browse all 3925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>