0
Ben işlevleri addMenu ve menüyü kullanmak istiyorum ama bu hatayı alıyorum
:laravel 4 Sınıf Fonksiyon çağrısı hatası bu
Using $this when not in object context
Yanlış bir şey mi yaptım? Ya da bu işlevleri çağırmanın başka bir yolu var mı?
Kodum:
class Documentation {
protected $app;
protected $menu = [];
public function __construct(Application $app){
$this->app = $app;
$this->addMenu(["Hello world"]);
}
public static function addMenu($item){
$this->menu[] = $item;
}
public static function menu(){
return $this->menu;
}
}