我有CodeIgniter 3 HMVC的问题(我使用CI 3.1.9和php 7.3),当我创建
MYX3_Controller扩展了MX_Controller
我打电话给show_404();在我的方法中将显示
像这样的错误“Unable to locate the specified class: Session.php”(Look at the picture)为什么不显示404自定义页面
这是因为MX Controller无法访问会话。我不知道怎么做。如果你想解决它。 qazxsw poi
MY_Controller有会话类。
它通常发生在我们使用HMVC并且我们创建自己的自定义错误页面时。我发现我们必须扩展MX_Controller而不是CI_Controller。问题应该得到解决。
这是Cutom404控制器的一个例子(位置:application / controllers / Custom404.php):
MX_Controller extends MY_Controller