I have in my twig a link as shown below and I would like to send a lot of data (array) to a controller. How do I go about it ? Do I use params? what is the best way to handle this in your opinion? Thanks.
In my twig:
<a href="{{ path('mymodule.send') }}">Send</a>
Routing file:
mymodule.send:
path: '/admin/send'
defaults:
_controller: '\Drupal\mymodule\Controller\MyController::myFunction'
_title: 'Send data'
requirements:
_permission: 'administer site configuration'
options:
_admin_route: TRUE
My controller where I want to send data:
class MyController extends ControllerBase {
public function myFunction() {
}
}