-2
class Affiliates_Shortcodes {
private $earnings;
public static function affiliates_user_tree() {
echo $this->earnings;
}
}
入門錯誤:
Fatal error: Uncaught Error: Using $this when not in object context
靜態函數與對象無關,所以不能在任何靜態上下文中使用$ this。 – xander
所以如何訪問它 –
'echo self :: earnings' - 但$收益必須聲明爲static! – Jeff