Getting information into master template

With PHP-DI and constructor (dependency) injection you could let the container inject the object with data into the controller/action classes you need.