So basically I am designing my PHP based website to a newer and more supported framework. Currently my website in written in Kohana 2.3.4 and I am moving to Yii2 framework. The biggest problem I am facing is the difference is that on my Kohana Site, I used constants for all my HTML for the case of translating but now I have no problem since I can just use: Yii::t()
Though I have solved this problem I needed to know how to pass my Settings Array to all actions on every controller. The settings are loaded from my SettingsQuery
model and should be accessed from all the views in the app ie. Something like global constants. I have tried a few tips I got from my research but nothing is working as the scenario is a bit different from this and this.
I have tried a way to implement this way but it works only when I have static values for my settings. What is the best way to do this?