S
S
symnoob2019-12-16 22:02:43
symfony
symnoob, 2019-12-16 22:02:43

Symfony 4 - how to pass entity to controller dynamically?

Good afternoon, is it possible to transfer an entity to the controller somehow dynamically?
The controller is called via TWIG.
A solution is needed very urgently.
Who has any ideas?
Thanks a lot, everyone

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
index0h, 2019-12-17
@index0h

A controller in a templating engine... sounds like trash.
Write down the service for your entity and pull it already - yes, by shit, but quickly. It is good for the template engine to prepare all the data in advance.

K
kafkiansky, 2019-12-17
@mad_maximus

{{ render(controller('App\\Some\\GovnoController::govnoMethod', {'entity': entity.id})) }}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question