Skip to content

Instantly share code, notes, and snippets.

@andyhawthorne
Last active October 10, 2015 19:28
Show Gist options
  • Select an option

  • Save andyhawthorne/3739428 to your computer and use it in GitHub Desktop.

Select an option

Save andyhawthorne/3739428 to your computer and use it in GitHub Desktop.
Search term handler method
<?php
public function searchterm_handler($searchterm)
{
if($searchterm)
{
$this->session->set_userdata('searchterm', $searchterm);
return $searchterm;
}
elseif($this->session->userdata('searchterm'))
{
$searchterm = $this->session->userdata('searchterm');
return $searchterm;
}
else
{
$searchterm ="";
return $searchterm;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment