We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

something about globals?

In the Controller A.php:

I set global $W; $W['NAME'] = 1; in function initialize();

In the other Controller B.php:

I read the global $W;var_dump($W); in fucntion anyAction()

WHY it dump NULL?

edited Aug '16

Why you even use globals ? Just put value of global to di for example ? You sure code in both controllers are executed for request ?

Good for save config.