0
我想在CodeIgniter错误页面上显示一条错误消息。我想这一点:CodeIgniter自定义404消息
控制器/ entries.php
public function show_entry()
{
$id = $this->uri->segment(3);
if ($id !== FALSE)
{
..
}
else
{
log_message('error', 'The post ID is missing.');
}
不应该在此显示了CodeIgniter的默认的404错误信息,即我的错误消息“The post ID is missing
”。 “The page you requested was not found
”。
感谢您的回答。我找不到使用show_404的例子。我尝试过使用'show_404('发布ID缺失');'但它不起作用。 – Roman
你尝试过'show_error'吗? – cwallenpoole
是的,工作正常。在看到你的帖子后只是想知道show_404,但无论如何感谢。 – Roman