I have a controller class called "query" and another class named "language" to detect the language from the browser and verify it to be one of the available ones. my code looks like this :
in the controller :
Language::detect();
in the "language" class :
public function detect()
{
$this->_verify(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2));
}
private function _verify($input)
{
$languages=array
(
'English' => 'en',
'German' => 'de',
);
if (in_array($input,$languages))
{
echo $input;
}
}
the problem is it seems like the method _verify() is called as if it belongs to the controller and I get a "Fatal error: Call to undefined method ....."
how would I go about calling it so it looks for it within the same class?