当一部分是 link 时如何在 codeigniter 中发送闪存数据
How to send flash data in codeigniter when part of it is a link
我必须显示包含 link 的闪存数据。我尝试了以下方法,但 link 未按应有的方式显示。
如何在 flashdata 中添加 link?
我试过这个:
$cancell = "<a href='<?php echo site_url('document/index');?>Cancell</a>";
$this->session->set_flashdata('success',
'You successfully created the document! ' . $cancell .', if you want to cancell it!');
redirect('document/index/');
尝试像下面这样的代码,但要确保url helper autoloaded
控制器
$link = anchor('document/index', 'cancel');
$message = 'You successfully created the document!' .' '. $link .' '. 'if you want to cancell it!';
$this->session->set_flashdata('success', $message);
redirect('document/index');
查看
<p><?php echo $this->session->flashdata('success');?></p>
我必须显示包含 link 的闪存数据。我尝试了以下方法,但 link 未按应有的方式显示。
如何在 flashdata 中添加 link? 我试过这个:
$cancell = "<a href='<?php echo site_url('document/index');?>Cancell</a>";
$this->session->set_flashdata('success',
'You successfully created the document! ' . $cancell .', if you want to cancell it!');
redirect('document/index/');
尝试像下面这样的代码,但要确保url helper autoloaded
控制器
$link = anchor('document/index', 'cancel');
$message = 'You successfully created the document!' .' '. $link .' '. 'if you want to cancell it!';
$this->session->set_flashdata('success', $message);
redirect('document/index');
查看
<p><?php echo $this->session->flashdata('success');?></p>