If I write a public static method in a class, then ...
public static function get_info($type){
switch($type){
case'title':
self::get_title();
break;
}
}
I need to write my get_title () function as public ...
public static function get_title(){
return 'Title';
}
Otherwise, I get an error:
Call to private method Page::get_title()
Which makes me feel that the function get_info()is essentially redundant. I would like to be able to make the call from the static method a private method inside my class for verification. It's impossible?
PHP> 5.0 btw.
! ####### EDIT THE DECISION (BUT DO NOT ANSWER TO THE QUESTION) #########!
In case you are interested, my workaround was to instantiate a static class of functions inside a static function.
So the class name was a page, I would do it ...
public static function get_info($type){
$page = new Page();
switch($type){
case'title':
$page->get_title();
break;
}
}
public function get_title(){
return 'Title';
}