Closed scsmash3r closed 4 months ago
If you need the session in whole or in part you should send it as a parameter to the render method.
All templates values should (must) be passed into the template. The template should not fetch data from the upper layers in MVC.
So global- and "Super-Global" variables such as $_SESSION
should not be used within a template.
How to reproduce:
In
hello.php
:In
layout.php
:So, in both
hello.php
andlayout.php
you will be able to get$title
var. But, inhello.php
global $_SESSION var will be empty. Expected behavior would be leaving global variables intact.