Codeigniter: Constants in /application/config/constant.php from DB table -


Is it possible to declare constants in /application/config/constant.php from a DB table?

I am trying to do something like that.

  $ result = $ this-> Db- & gt; ('Atri, value') -> ('app_conf') - Choose & gt; Where ('city', 53) - & gt; Or_here ('city', -1) - & gt; Order-B ('City') - & gt; get receive (); $ App_conf = $ Result-> Result_are (); // var_dump ($ app_conf); Foreign Currency ($ app_conf as the $ line) {Define {"{{row_name ['attr']}", $ line ['value']); }   

But now I have to do this in making every controller, that code is being repeated and all the changes need to be done as needed, which seems unnecessary!

Increase the CI controller and place it in the application / core directory as MY_Controller. The above code is in the manufacturer of the extended controller. Now you can increase it to execute the same code from your controllers. So you do not have to type this code again.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -