This line of code:
echo "<strong> {$this->author->last} {$this->date->shortYear()}</strong> ...";
gives me this error:
Fatal error: Call to undefined method Date::shortYear() in /f5/debate/public/libs/Card.php on line 22
Even though in Date.php (which is included in Card.php):
class Date {
public $day;
public $month;
public $year;
public function shortYear() {
return substr($this->year, -2);
}
}
You're instantiating the wrong Date
class. You can use PHP's get_class_methods()
function to confirm which methods are available.
If you work in an setup where you automatically upload your changes from your IDE to the web server your checking your pages on. It might accidentally be the case that it didn't upload the file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With