php - set config params from database in yii 1 -


i have created crud global configuration parameters. want apply parameters value main config params (main.php). have found way add value of these parameters .inc file , perform read/write operation. can me how can achieve this? beginner in yii.

i have created table structure :

global_config :  field      | value pagesize   |  20 admin_email|  admin@example.com 

main.php file below :

. . {  'params' = array( 'pagesize' => 10, 'admin_email' => 'admin@example.com',  );  } 

. .

i using config file show above, want change dynamically should value database.

so can make changes in config file front-end side. don't need perform open/write action on main.php

in yii1 can use params can set in main.php

'params'=>array(      'your_param'=>'your_value ', 

...

 yii::app()->params['your_param'];  

and can set value simple array poplulating value form database

$param['yuor_param' =>$your_db_value]; 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -