Welcome Guest, Not a member yet? Register   Sign In
Externalized Strings?
#1

[eluser]Unknown[/eluser]
Hey all,
I want to come up with a system of using externalized strings for my site. The idea is that all the strings are in the DB, they are pulled into PHP and JSON objects and used throughout the site. I already know how I am going to do this however I can't figure the best way to call the function to get it started. I figure I could have a helper function that will do this for me but is there a way to get this called globally and still be available to my models and views? I am trying to avoid having to call this function in every single controller function I have. I want to just call it once and be done with it. Any ideas?
#2

[eluser]techgnome[/eluser]
Make it a library... then put the call in the constructor method. That's what I'm doing with a piece I'm working on. I load some configuration/initial data in the construct and then the library is available to me anywhere I have access to the $this object (which included Models and Views). If it's something you'll need in all your controllers, then add it to the Autoload config file, and BAM! you're done.

-tg




Theme © iAndrew 2016 - Forum software by © MyBB