You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
World Wide Web Server edited this page Jul 4, 2012
·
4 revisions
This is easy to use and simple FlashNotice Helper. It will help you to display error or notice message after some action. The message will be displayed only once and deleted afterwards.
To use it:
save code below as "flash_helper.php" into your applciation/helpers directory.
load helper using $this->load->helper("flash");
to set notice use setflash("Write notice","notice");
to set error use setflash("Write error information","error");
to display notices on the page use <?=flash();?> in your view.
You can use any other notice types in second parameter as this will result in class name of block element. Style #flash using CSS as you wish.
<?php
function flash() {
$flash = $_SESSION["flash"];
unset($_SESSION["flash"]);