首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CI_Exceptions错误

CI_Exceptions错误
EN

Stack Overflow用户
提问于 2014-09-24 18:26:16
回答 1查看 852关注 0票数 0

在我的主页上,我正面临以下错误。请帮助我解决这个错误。

代码语言:javascript
复制
Strict Standards: Declaration of AI_Exceptions::show_404() should be compatible with CI_Exceptions::show_404($page = ) in /home/enjoythe/public_html/application/libraries/AI_Exceptions.php on line 32

AI_Exceptions.php文件

代码语言:javascript
复制
/**
* Exceptions Class that extends the codeIgniter Core Exceptions Class.
*
* @author Prasanna_13AG04
* @copyright Copyright (c) 2007 {@link http://www.agriya.com Agriya Infoway}
* @license http://www.agriya.com Agriya Infoway Licence
* @since Nov 26, 2008
*/

class AI_Exceptions extends CI_Exceptions
{
    /**
     * Constructor
     */
    function __construct()
    {
        //call the parent class constructor
        parent::__construct();

        //Log the loading of this class
        log_message('debug', "AgriyaIgniter Exceptions Class Initialized");
    }

    function show_404($page)
    {
        $config =& get_config();
        header('Location: ' . $config['base_url'] . $config['index_page'] . 'pagenotfound/' . $page);
        exit;
    }
}
// END AI_Exceptions Class

/* End of file AI_Exceptions.php */
/* Location: ./application/libraries/AI_Exceptions.php */
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-09-24 18:31:51

为$page添加默认值

代码语言:javascript
复制
function show_404($page = '')
{
    $config =& get_config();
    header('Location: ' . $config['base_url'] . $config['index_page'] . 'pagenotfound/' . $page);
    exit;
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26023889

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档