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