title: How to Create a URL in Controller like HtmlHelper
body: <p><strong>TLDR:</strong> How can I create a URL in the Controller similar to how I can use the HtmlHelper to create URLs in a View?</p>
  
  <hr>
  
  <p><strong>Problem:</strong></p>
  
  <p>I want to print the url of a controller action, in my controller (because I create my JSON string in my controller, not in a view)</p>
  
  <p>In a <code>View</code>, I can use <code>$this-&gt;Html-&gt;url()</code>, but what about in a Controller? </p>
  
  <p>Should I use defined constant like <code>APP_DIR</code> + Controller name + Controller action?)</p>