I’m having a really hard time rendering Singletons and searched everywhere. Help!
This is where I ended up and getting nothing:
$marquee = cockpit(‘singletons’)->getData(‘marquee’);
print_r($marquee);
Sorry, my background is design, not programming Love cockpit BTW!!
Where do you try to get the data?
If you are inside the bootstrap process, the function cockpit()
isn’t available yet.
Write $marquee = $this->module('singletons')->getData('marquee');
or do it after the event admin.init
was fired.
$this->on('admin.init', function() {
// now the function cockpit() should be available
});
1 Like