title: Getting the route name inside a service in symfony
body: <p>guys so I have a service in which i have a constructor that accepts router service.</p>
  
  <p>My question is how can I know the current route name?</p>
  
  <p>This is my service:</p>
  
  <pre><code>class Navigation
  {
      protected $modules;
  
      protected $router;
  
      public function __construct($modules, $router)
      {
          $this-&gt;modules = $modules;
          $this-&gt;router = $router;
      }
  }
  </code></pre>
  
  <p>Thanks.</p>