title: How do I access the Twig path() function from a Controller?
body: <p>Okay, I know I can't literally call a twig template function from a controller, but to make links, I usually do the <code>{{ path('_routeName') }}</code> and that's great.</p>
  
  <p>However, now I want to formulate some links in the controller that will then be passed to the template via parameters like this:</p>
  
  <pre><code>$params = array(
      'breadcrumbs' = array(
          'Donuts' =&gt; '/donuts',
          'Bearclaws' =&gt; '/donuts/bearclaws',
          'Strawberry bearclaw' =&gt; null,
      ),
  );
  return $this-&gt;render('Bundle:Donut:info.html.twig', $params);
  </code></pre>
  
  <p>Except I don't want to hard-code those links. What I'd like is to be able to do</p>
  
  <pre><code>        'Donuts' =&gt; path('_donutRoute'),
  </code></pre>
  
  <p>but how to reach the path method or equivalent?</p>