admin管理员组

文章数量:1296280

A PHP Error was encountered
Severity: Deprecated Notice
Message: str_replace(): Passing null to parameter #1 ($search) of type array|string is deprecated
Filename: MX/Controller.php
Line Number: 46
Backtrace:
File: /Applications/XAMPP/xamppfiles/htdocs/titan/plus_app/third_party/MX/Controller.php
Line: 46
Function: str_replace
File: /Applications/XAMPP/xamppfiles/htdocs/titan/plus_app/modules/home/controllers/Home.php
Line: 6
Function: __construct
File: /Applications/XAMPP/xamppfiles/htdocs/titan/index.php
Line: 315

Function: require_once

class MX_Controller
{
    public $autoload = array();

    public function __construct()
    {
        $class = str_replace(CI::$APP->config->item('controller_suffix'), '', get_class($this));
        log_message('debug', $class." MX_Controller Initialized");
        Modules::$registry[strtolower($class)] = $this;

        /* copy a loader instance and initialize */
        $this->load = clone load_class('Loader');
        $this->load->initialize($this);

        /* autoload module items */
        $this->load->_autoloader($this->autoload);
    }

    public function __get($class)
    {
        return CI::$APP->$class;
    }
}

A PHP Error was encountered
Severity: Deprecated Notice
Message: str_replace(): Passing null to parameter #1 ($search) of type array|string is deprecated
Filename: MX/Controller.php
Line Number: 46
Backtrace:
File: /Applications/XAMPP/xamppfiles/htdocs/titan/plus_app/third_party/MX/Controller.php
Line: 46
Function: str_replace
File: /Applications/XAMPP/xamppfiles/htdocs/titan/plus_app/modules/home/controllers/Home.php
Line: 6
Function: __construct
File: /Applications/XAMPP/xamppfiles/htdocs/titan/index.php
Line: 315

Function: require_once

class MX_Controller
{
    public $autoload = array();

    public function __construct()
    {
        $class = str_replace(CI::$APP->config->item('controller_suffix'), '', get_class($this));
        log_message('debug', $class." MX_Controller Initialized");
        Modules::$registry[strtolower($class)] = $this;

        /* copy a loader instance and initialize */
        $this->load = clone load_class('Loader');
        $this->load->initialize($this);

        /* autoload module items */
        $this->load->_autoloader($this->autoload);
    }

    public function __get($class)
    {
        return CI::$APP->$class;
    }
}
Share Improve this question edited Feb 19 at 14:48 TylerH 21.1k77 gold badges79 silver badges112 bronze badges asked Feb 12 at 9:24 Oscar MgayaOscar Mgaya 11 bronze badge 4
  • doublecheck if CI::$APP->config->item('controller_suffix') returns a value. The error says it returns null – Vickel Commented Feb 12 at 11:37
  • What have you tried to resolve the problem? Where are you stuck? – Nico Haase Commented Feb 14 at 12:08
  • CI::$APP->config->item('controller_suffix') does not return a value – Oscar Mgaya Commented Feb 17 at 9:45
  • Then check why this happens. Also, please add all clarification to your question by editing it – Nico Haase Commented Feb 17 at 10:09
Add a comment  | 

1 Answer 1

Reset to default 0

Already checked CI::$APP->config->item('controller_suffix') configuration. Is the 'controller_suffix' configuration loaded correctly?

One solution would be to create a config $config['controller_suffix'] = '';.

本文标签: I am using Codeigniter 3 hmvc with php 82 and i am getting the below errorStack Overflow