Q:

How to access current placeholder value?

Symfony 3.4.
I have annotations for my controller:
/**
 *
 * @Route("/{prefix}", requirements={"prefix":"daily_task|event"})
 */
class TaskController extends Controller

and want to access current {prefix} value directly from controller's methods (which aren't routed actions). How to get it's value?

A:

Finally: $this->get('request_stack')->getCurrentRequest()->get('prefix')

