In my controller's view() function, I have something like this:
function view() {
$this->set('myVal', $text);
}
Now is it possible to access $myVal
from another custom function inside the controller?
I tried $myVal
and $this->myVal
but it does not work. Is it only accessible in the add.php, edit.php and view.php and not anywhere else?
You can access it via
$this->getvar('myVal');
You can also access it via
$this->get('myVal');
But this is deprecated as that method should now be used for $_GET
values