session set flashdata

Other topics

How to Set session flash data in controller

You can set flash data in controller just using this syntax

$this->session->set_flashdata('message', 'Message you want to set');

Here 'message' is identifier for access data in view. You can Set more than one message by just changing identifier.

for ex

$this->session->set_flashdata('my_alert', 'Message you want to set');
$this->session->set_flashdata('my_warnig', 'Message you want to set');

How to Display Flashdata in view

You can simply access the fashdata in view like this

<?php echo $this->session->flashdata('message'); ?>

For access multiple message just change identifier

For Ex.

<?php echo $this->session->flashdata('my_alert'); ?>
<?php echo $this->session->flashdata('my_warnig'); ?>

Contributors

Topic Id: 9688

Example Ids: 29888,29889

This site is not affiliated with any of the contributors.