Cakephp缺少帮助文件错误 [英] Cakephp missing helper file error

查看:155
本文介绍了Cakephp缺少帮助文件错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到了下面的错误...我不知道这意味着什么,因为我已经包括帮助文件在视图文件...



缺少助手文件

 错误:找不到辅助文件轨道/ views / helpers / request_handler.php或不存在。 

错误:在文件中创建以下类:track / views / helpers / request_handler.php

<?php
类RequestHandlerHelper扩展AppHelper {

}
?>

如果你能让我知道这是什么意思, b

谢谢。
Jae

解决方案

除非你定制你的CakePHP的工作原理,否则这应该适用于大多数情况:



清单


  1. 确保辅助文件在 /app/views/helpers/request_handler.php

  2. 确保 request_handler.php 看起来像这样:

      class RequestHandlerHelper extends AppHelper {
    var $ name ='RequestHandler ';

    // bla ....
    }


  3.   class FancyController扩展AppController {
    var $ name ='Fancy';
    var $ helpers = array('RequestHandler');

    // bla ....
    }


  4. 我想这就是:)


干杯


I'm getting below error...I'm not sure what this means as I have included helper file in the view file...

Missing Helper File

Error: The helper file track/views/helpers/request_handler.php can not be found or does not exist.

Error: Create the class below in file: track/views/helpers/request_handler.php

<?php
class RequestHandlerHelper extends AppHelper {

}
?>

If you can let me know what this means that would be appreciated!

Thank you. Jae

解决方案

Unless you customized how your CakePHP works, this should apply to most cases:

Checklist

  1. Make sure the helper file is created in /app/views/helpers/request_handler.php
  2. Make sure the content of the request_handler.php looks like this:

    class RequestHandlerHelper extends AppHelper {
        var $name = 'RequestHandler';
    
        //bla....
    }
    

  3. Make sure in the controller that renders the view has the helper array included

    class FancyController extends AppController {
        var $name = 'Fancy';
        var $helpers = array('RequestHandler');
    
        //bla....
    }
    

  4. I think that's all :)

Cheers

这篇关于Cakephp缺少帮助文件错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆