我们如何在自定义助手中访问htmlhelper?

2 cakephp

在帮助程序中访问模型是正确还是错误?在cakephp应用程序中.

我们如何在自定义助手中访问htmlhelper?

谢谢

dec*_*eze 6

链接到手册..

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

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

你可以在任何地方使用任何Model/Controller/Helper/etc,但实际上不应该.另一个手动链接.