Póki co w mojej skromnej aplikacji mam dwa pliki, ale bez błędu już się nie obyło.
index.php:
<?php // Ładowanie kontrolera require_once('controller/Controller.php'); $controller = new Controller($_GET['subtopic'], $_GET['action']) or die('Błąd podczas ładowania controllera.'); ?>
Controller.php:
<?php class Controller { private $subtopic; private $action; private __construct(string $xTopic = "index", string $xAction = "none") { $this->subtopic = $xTopic; $this->action = $xAction; } private __get($what) { return $this->self[$what]; } } ?>
Podczas ładowania dostaję następujący error:
Parse error: parse error, expecting `T_VARIABLE' in G:\WAMP\www\thegame2\controller\Controller.php on line 7
Googlowałem, ale odpowiedzi nie znalazłem - wie ktoś z Was jak to naprawić?