I want to have a function that generates me a copyright year range.
I call it in the footer like this: $CopyrightRange(2007)
Then it should print "2007-2008"
But the parameter is always NULL. I checked this with the var_dump you can see below.
If have tested this function in the Page class and in the Page_Controller class but it doesn't work at all.
What goes wrong here??
public function getCopyrightRange($from) {
$to = date('Y');
var_dump($from);
if(!empty($from) && $from < $to) {
return $from . '–' . $to;
}
return $to;
}