I have added in oc_setting table around 80 rows with
code = module_myabc - same for all 80 rows
key = module_myabc_color , module_myabc_bgcolor, module_myabc_font_size ....... like these total 80 rows
value = #FF0000, #999999, 12px .... according to above keys.
it is like
---------------------------------------------------------------------------------------------------------
id | code | key | value
----------------------------------------------------------------------------------------------------------
1 | module_myabc | module_myabc_color | #FF0000
----------------------------------------------------------------------------------------------------------
2 | module_myabc | module_myabc_bgcolor | #999999
----------------------------------------------------------------------------------------------------------
3 | module_myabc | module_myabc_font_size | 12px
----------------------------------------------------------------------------------------------------------
Now I want to use these values in style declared in twig file.
e.g.
Code: Select all
<style>
.myclass {
color : {{ module_myabc_color }}; (which should get as #FF0000 as per database table)
background: {{ module_myabc_bgcolor }}};
font-size: {{ module_myabc_font_size }};
}
</style>
I am getting this data with
Code: Select all
$this->load->model('setting/setting');
$this->model_setting_setting->getSetting('module_myabc');
Code: Select all
$data['module_myabc_color'] = '#FF0000';
$data['module_myabc_bgcolor'] = '#999999';
$data['module_myabc_font_size'] = '12px';