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
I have tried View, but this does not have User available when it starts and it also feels wrong/hacky.
Thanks
Another option, if you want to set up global constants or variables, is simply to add code to config/site.php
Done that already, but this stuff is dynamic and needs helpers and other bits that are not available in config.php
Thanks.
I have just successfully used thishttp://www.concrete5.org/documentation/how-tos/designers/tutorial-b...
I have just successfully used thishttp://www.concrete5.org/documentation/how-tos/designers/tutorial-b...
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)