title: Outputting a hyperlink from a controller in cakePHP
body: <p>I'm just getting started with cakePHP, and things aren't going so well so far.</p>
  
  <p>I have a controller that handles confirming user emails. On registration the user is sent an email with a confirmcode in a link. Depending on the confirm code they give, the controller gives different text responses. One of these responses includes a hyperlink in order to log in.</p>
  
  <p>I'm trying to use the Html helper, but although I've loaded it in $helpers at the top of the class, I an only make it work if I then use App::import, and then instantiate it.</p>
  
  <p>It all seems overkill to simply make a hyperlink! How many times do I have to load the same class?</p>
  
  <p>Wherever I look on the web it keeps telling me it's a bad idea to use a helper in a controller, but how else am I supposed to get the link made?</p>
  
  <p>So I have </p>
  
  <pre><code>var $helpers = array('Html');
  </code></pre>
  
  <p>at the top of the controller, and:</p>
  
  <pre><code>if (isset($this-&gt;User-&gt;id)) { // Check the user's entered it right
    // Do some stuff to remember the user has confirmed
    // This is to load the html helper - supposedly bad form, but how else do I make the link?
    App::import('Helper', 'Html');
    $html = new HtmlHelper();
    $this-&gt;set('message', __("Your email address has been confirmed.", TRUE)." ".$html-&gt;link(__("Please log in", TRUE), array('controller' =&gt; "users", 'action' =&gt; "login" )));
  } else {
    $this-&gt;set('message', __("Please check your mail for the correct URL to confirm your account", TRUE));
  }
  </code></pre>
  
  <p>in the controller's confirm method and </p>
  
  <pre><code>&lt;div&gt;
     &lt;?php echo $message;?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>in the view to output the resulting message</p>
  
  <p>Surely I'm going wrong somewhere - can anyone explain how?</p>