tags:

views:

58

answers:

1

accessing model in helper is correct or wrong? in cakephp application.

How can we access htmlhelper inside our custom helper?

Thanks

+3  A: 

Link to manual..

class LinkHelper extends AppHelper {
  var $helpers = array('Html');

  function makeEdit($title, $url) {
    $link = $this->Html->link($title, $url, array('class' => 'edit'));
  }
}

You can use any Model/Controller/Helper/etc anywhere, but really shouldn't. Another manual link.

deceze