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
Post a Comment