I have two if statements in my __construct method and I keep getting an undefined index error. So if I try to fix it with isset() I get a message saying fatal error cannot use isset () on the result of an expression.
Here is my code
class Bootstrap{
private $controller;
private $action;
private $request;
public function __construct($request){
$this->request = $request;
if ($this->request['controller'] == ""){
$this->controller = 'home';
} else {
$this->controller = $this->request['controller'];
}
if($this->request['action'] == ""){
$this->action = 'index';
} else {
$this->action = $this->request['action'];
}
}
All help greatly appreciated.