[eluser]eckelarsson[/eluser]
Hello!
Need help with a class question.
See my code here below:
Code:
class model_search extends Model {
public static $my_static = $this->uri->segment(4);
function model_search()
{
parent::Model();
}
function fetch_count_resultat($fritext)
{
// SÖKKRITERER
$filter_postort = $this->uri->segment(4);
$SNI = $this->uri->segment(5);
if($filter_postort == 'allt') { } else { $this->db->where('Postort', $filter_postort); }
if($SNI == 'SNI') { } else { $this->db->where('SNI_kod', $SNI); }
$this->db->like('Foretag', $fritext);
$this->db->or_like('Postort', $fritext);
// ---->
$this->db->from('register');
echo self::$my_static;
return $this->db->count_all_results();
}
}
What i want is to have a few static constants that i can aply with every function of this class. It works if the static look like this;
Code:
public static $my_static = 'foo';
Not if i write:
Code:
public static $my_static = $this->uri->segment(4);
Dose this make some sense?