Skip to content

Instantly share code, notes, and snippets.

@juniorb2ss
Created May 23, 2014 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juniorb2ss/cdaccc42bf61b0669dfa to your computer and use it in GitHub Desktop.
Save juniorb2ss/cdaccc42bf61b0669dfa to your computer and use it in GitHub Desktop.
/**
* Add or change flashdata, only available
* until the next request
*
* @access public
* @param mixed
* @param string
* @return void
*/
function set_flashdata($newdata = array(), $newval = '')
{
if (is_string($newdata))
{
$newdata = array($newdata => $newval);
}
if (count($newdata) > 0)
{
foreach ($newdata as $key => $val)
{
$flashdata_key = $this->flashdata_key.':new:'.$key;
$this->set_userdata($flashdata_key, $val);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment