Global event hook / Bootstrap file

Permalink
Is there a global event hook I can tap into to set some variables up before the main application started?

I have tried View, but this does not have User available when it starts and it also feels wrong/hacky.

Thanks

yolk
 
JohntheFish replied on at Permalink Reply
JohntheFish
I guess you are talking about concrete5 events on the server, not JavaScript events in the browser.

The event you want depends on whether you are in a package controller or a block controller. You can find examples of both loading (amongst others) bootstrap.js in my Load UI addon (free):
http://www.concrete5.org/marketplace/addons/load-jquery-ui/...

When working with concrete5 events generally, an indispensable tool is Mnkras' event tester addon:
http://www.concrete5.org/marketplace/addons/event-tester/...
(Best to get it from Github and patch in the pull request for 5.6 styling)
JohntheFish replied on at Permalink Reply
JohntheFish
Another option, if you want to set up global constants or variables, is simply to add code to config/site.php
yolk replied on at Permalink Reply
yolk
Done that already, but this stuff is dynamic and needs helpers and other bits that are not available in config.php
yolk replied on at Permalink Best Answer Reply
yolk