无论如何,首先显示设置的闪存数据信息,然后在控制器中延迟5秒后重定向到新页面。
... -->
[] | [_], ... .
seq([]) --> [].
seq([E|Es]) --> [E], seq(Es).
affix(Xs, Zs) :-
phrase( ( seq(Xs), ... ), Zs).
suffix(Xs, Zs) :-
phrase( ( ..., seq(Xs) ), Zs).
由于
答案 0 :(得分:3)
当您使用控制器方法设置flashdata时,请发送到time inssec:
Controller.php这样
-> O(log(1) + log(2) + log(3) + log(4).....log(n))
-> O(log(1*2*3*4...*n))
-> O(log(n!))
and O(log(n!)) is equal to O(n log(n))
在您的视图/文件夹/ temp_view.php
中public function do_something(){
//do somthing
$this->session->set_flashdata('message_id', 'Message');//message rendered
$this->session->set_flashdata('seconds_redirect', 5);//time to be redirected (in seconds)
$this->session->set_flashdata('url_redirect', base_url('controller/method'));//url to be redirected
redirect('folder/temp_view', 'refresh');
}
使用此方法传递消息变量,您希望重定向到另一个页面的时间以及重定向到的位置的URL
答案 1 :(得分:2)
由于您正在加载页面,因此您需要使用javascript重定向。
将此代码放入html视图中:
<script>setTimeout(function(){window.location.href='newpage.html'},5000);</script>
答案 2 :(得分:1)
我被困在同一个地方:
1.在视图文件中为静态URL键入此内容:
<?php
header("Refresh: 5; url=\"http://www.google.com\"");
echo "You will be redirected to google in 5 seconds..."
?>
2.在视图文件中为base_url键入此内容:
<?php
header('Refresh:5; url= '. base_url().'/create_event');
echo "You will be redirected in 5 seconds..."
?>