在helper中访问模型是正确还是错误?在 cakephp 应用程序中。
我们如何在自定义助手中访问 htmlhelper?
谢谢
最佳答案
class LinkHelper extends AppHelper {
var $helpers = array('Html');
function makeEdit($title, $url) {
$link = $this->Html->link($title, $url, array('class' => 'edit'));
}
}
您可以在任何地方使用任何模型/ Controller /助手/等,但真的不应该。 Another manual link.
关于cakephp - 我们如何在自定义助手中访问 htmlhelper?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1141835/