A. *_*lam 4 cakephp cakephp-2.4
我们都知道这$this->element()是被弃用的.他们说,The "$options['plugin']" is deprecated and will be removed in CakePHP 3.0. Use "Plugin.element_name" instead..那么,当我从一个视图而不是一个插件中使用它时,会有什么替代品呢?或者不使用$this->element()from view.
我应该从视图中使用该功能吗?
该element()方法本身不被弃用,只使用数组中的plugin键$options.这意味着你应该使用
$this->element('Contacts.helpbox');
Run Code Online (Sandbox Code Playgroud)
代替
$this->element('helpbox', array(), array('plugin' => 'Contacts'));
Run Code Online (Sandbox Code Playgroud)
另见http://book.cakephp.org/2.0/en/views.html#requesting-elements-from-a-plugin
| 归档时间: |
|
| 查看次数: |
5355 次 |
| 最近记录: |