How do I call a helper function from a CakePHP component?

余生颓废 提交于 2020-01-25 01:45:10

问题


How do I call a helper function from a CakePHP component?


回答1:


App::import('helper', 'Upload');
$test = new UploadHelper();
pr($test->hi());



回答2:


use this

$this->controller->helpers[] = "helper name"; 

inside component class



来源:https://stackoverflow.com/questions/4944531/how-do-i-call-a-helper-function-from-a-cakephp-component

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!