[英]Is it possible to change Codeigniter set_flashdata to an array?
I would like to change codeigniter set_flashdata() function to become an array it is it possible ? 我想将codeigniter set_flashdata()函数更改为数组,这可能吗?
the normal function like that: $this->session->set_flashdata('error', 'there is an error');
正常的函数是这样的:
$this->session->set_flashdata('error', 'there is an error');
I need to be like that $this->session->set_flashdata(array('error'=>'there is an error'),'Description'=>'all fields required');
我需要像这样
$this->session->set_flashdata(array('error'=>'there is an error'),'Description'=>'all fields required');
If it possible how to echo it on view? 如果有可能如何在视图上回显它? and if not what you can suggest ?
如果没有,您可以建议什么? thank you!
谢谢!
resolved: 解决:
$this->session->set_flashdata('error', array('error'=>'lock', 'msg'=>'lock'));
view: 视图:
$ero=$this->session->userdata['error']['error'];
$msg=$this->session->userdata['error']['msg'];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.