It is correct that class extends from BaseController, I have commented the line parent ::__ construct () because if it does not throw me the error of: Cannot call constructor
PHP Code:
namespace App\Controllers;
use App\Models\Modeloejemplo;
class Demo extends BaseController
{
public function __construct(){
//parent::__construct();
//establezco la zona horario par El Salvador
date_default_timezone_set('America/El_Salvador');
//comprobamos si el usuario está logueado
$this->sesion = session();
if($this->sesion->chequear != true)
{
//si no estoy logueado que me envie a index
return redirect()->to(base_url());
}
}
}
Also, if I do not declare
PHP Code:
$this->session = session();
the error throws me making a point that the session property is not defined