I have an error on this line: class matchController extends baseController { private $match = new Match(); .... } the Class Match is located in another folder different from matchController The error is: Parse error: syntax error, unexpected T_NEW in /var/www/kora/trunk/controller/matchController.php on line 5
This is invalid. You can define the property as string, numeric, array (etc) but not a return value of a function or object. You should initialise it in the constructor instead. class matchController extends baseController { private $match; function __construct() { $this->match = new Match(); } } PHP:
Now I am doing the following the error is: Fatal error: Class 'Match' not found in /var/www/kora/trunk/controller/matchController.php on line 10
1. You have to declare a variable and then initialize it with $this-> keyword. 2. You have to include your Match class in this script using include() function, or require() function. Else, your Match class can be below or above your current class. Where is your Match class located?