【发布时间】:2014-05-22 15:04:17
【问题描述】:
我是 CakePHP 的新手,正在学习它的博客教程。我试图不在控制器 PostsController 中编写/包含助手和组件,发现博客运行良好,没有警告或错误。 PostsController 使用这样的助手和组件
public $helpers = array(’Html’, ’Form’, ’Session’);
public $components = array(’Session’);
虽然索引视图使用 Html 助手创建链接为$this->Html->link()。可以在没有任何声明或使用调用的情况下使用帮助程序吗?在 CakePHP 中如何正确使用 helper 或 component?
【问题讨论】: