首页 文章

无法找到指定的类:codeigniter中的Hooks.php

提问于
浏览
0

我的Codeigniter Web应用程序在我的localhost中运行良好,但在实时服务器中我收到错误 Unable to locate the specified class: Hooks.php

在我的localhost应用程序\ config \ hooks.php是空文件和application \ config \ config.php设置$ config ['enable_hooks'] = FALSE;

怎么解决?提前致谢..

2 回答

  • 0

    Enabling Hooks

    通过在 application/config/config.php file: 中设置以下项目,钩子功能可以全局 enabled/disabled

    $config['enable_hooks'] = TRUE;
    

    Defining a Hook

    钩子在_2919783中定义 . 每个钩子都被指定为具有此原型的数组:

    $hook['pre_controller'] = array(
            'class'    => 'MyClass',
            'function' => 'Myfunction',
            'filename' => 'Myclass.php',
            'filepath' => 'hooks',
            'params'   => array('beer', 'wine', 'snacks')
    );
    

    另请参考Hooks

  • 0

    此错误是由于某些文件丢失造成的 . 关于会话和内容的答案很多 . 我的应用程序完美运行,突然发生了这个错误 . 我重新上传了我的应用程序文件夹,一切都恢复正常 .

相关问题