For accessing the state vars of a webobj we use this syntax:
$s_var = $this->getSVar("varName");
Probably it would be more convenient to use this syntax:
$s_var = $this->varName;
or $s_var = $this->s_varName;
(to emphasize the difference
between state vars and any other usual (non-persistent)
vars that the webobj might have)
However,
$this->s_varName = "new_var_value";
cannot be better (in functionality) than
$this->setSVar("varName", "new_var_value");
because the value changed in the first one will be available
after $this->onParse(), and the second one changes it everywhere
immediately.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For accessing the state vars of a webobj we use this syntax:
$s_var = $this->getSVar("varName");
Probably it would be more convenient to use this syntax:
$s_var = $this->varName;
or $s_var = $this->s_varName;
(to emphasize the difference
between state vars and any other usual (non-persistent)
vars that the webobj might have)
However,
$this->s_varName = "new_var_value";
cannot be better (in functionality) than
$this->setSVar("varName", "new_var_value");
because the value changed in the first one will be available
after $this->onParse(), and the second one changes it everywhere
immediately.