忽略了一个问题,$this 代表当前对象!! 静态方法中应该使用 类名 、 self 或者 static 关键字来代替!
    static
public function get_info($id) { var_dump($this); // NULL NULL 
       Fatal error: Using $this when not in object context in /home/apache/www/test/web/core/MY_Controller.php on line 80
}

 

相关文章:

  • 2021-07-03
  • 2021-12-21
  • 2021-07-31
  • 2022-12-23
  • 2021-08-01
  • 2021-08-25
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-21
  • 2022-01-19
  • 2021-09-28
相关资源
相似解决方案