Hello I had following structure
class app_base extends Phalcon\Mvc\Controller
{
public $__currentPage = 1;
public $__request;
public function initialize()
{
$this->__currentPage = $this->request->getQuery('page','int',1);
}
}
class app_stage_base extends app_base
{
public $stageUser = false;
public function beforeExecuteRoute()
{
if(!$this->stageUser) {
header("login");
}
}
public function initialize()
{
}
}
class app_stage_module_model_base extends app_stage_base
{
public function initialize()
{
parent::initialize();
if(!$this->stageUser) {
$this->response->redirect("login");
}
}
}
class OnlineController extends app_stage_module_model_base
{
public function initialize()
{
parent::initialize();
}
public function indexAction()
{
$srv = new service_vmodel_online();
$srv->initRooster();
$srv->setRoom();
}
}
$srv->setRoom(); needs session variable. If does not found throws a exception as usual.
How ever. when session expires.
public function initialize()
{
parent::initialize();
if(!$this->stageUser) {
$this->response->redirect("login");
}
}
Was not working. Code executes to end and throws an exception.
Could anyone lead me to correct this problem.
My Best regards.