echo "<strong> {$this->author->last} {$this->date->shortYear()}</strong> ...";
给了我这个错误:
Fatal error: Call to undefined method Date::shortYear() in /f5/debate/public/libs/Card.php on line 22
即使在Date.php(包含在Card.php):
class Date {
public $day;
public $month;
public $year;
public function shortYear() {
return substr($this->year, -2);
}
}
请注意,请检查您是否正在加载“Date.php”文件。 – BoltClock 2010-07-12 04:13:46
我知道我是因为我在第16行(“$ this-> date = new Date;”)定义了一个日期而没有任何错误。 – cactusbin 2010-07-12 04:16:16
我们可以看到Card.php的全部内容吗? – Kalium 2010-07-12 04:23:32