Hello Dear,
Instead of always doing the below
public function allAction()
{
$alls = $this->session->get("sessvar");
$this->view->allsvar = $alls;
}
...in all my methods, I tried the below
<?php
use Phalcon\Mvc\Controller;
class BaseController extends Controller
{
public function initialize()
{
$svariable = $this->session->get("sessvar");
$this->view->svar = $svariable;
}
}
and it worked!!!!....ie I tried to always inherit it from my base controller after initialization of same and all my views began to see $svar
Question: Is there any security or other vulnerability to this?
(would be so glad if "Baba"-Guti comments on this)