Any chance of an example i want to get other configs from the different config files in fuel/applications/config and add them to the settings in the cms especially the profiler so i can turn it on and off when ever i need it
An example can be found on the Search module at the bottom and you basically just need a:$config[{$module}]['settings'] = array(); // <-- Form_builder array syntax for form fields http://docs.getfuelcms.com/general/forms
$config['search']['settings'] = array();
$config['search']['settings']['user_agent'] = array();
$config['search']['settings']['delimiters'] = array('default' => '<div id="main">');
$config['search']['settings']['query_type'] = array('type' => 'select', 'options' => array('match' => 'match', 'match boolean' => 'match boolean', 'like' => 'like'));
https://github.com/daylightstudio/FUEL-CMS-Search/blob/master/config/search.php
i get that and have no problem with the above but what i want to do is add configs from fuel application config folder i already have $config['setting'] in MY_fuel.php but i also want to add some of the configs in MY_config.php but i cant seem to get these configs to load in the settings in fuel if i can do this it would be great ive added then to the autoload file as well
i would like to put $config['enable_profiler'] in the settings for fuel but it is in the My_config.php file and i can seem to get them into the settings any ideas or suggestions
The following would give you a checkbox to enable it. $config['settings']['enable_profiler'] = array('type' => 'checkbox', 'value' => 1); However, there are other issues due to the fact that it is tied to the Fuel_hook::post_controller hook and it looks like it could use a change: public function post_controller()
{
$CI =& get_instance();
$enable = $CI->config->item('enable_profiler') OR $CI->fuel->config('enable_profiler');
$CI->output->enable_profiler($enable);
} I've pushed that change to the develop branch: https://github.com/daylightstudio/FUEL-CMS/commit/7db5ad15a85a14b7cee1a1248633a06536317b53
Comments
$config[{$module}]['settings'] = array(); // <-- Form_builder array syntax for form fields http://docs.getfuelcms.com/general/forms
$config['search']['settings'] = array(); $config['search']['settings']['user_agent'] = array(); $config['search']['settings']['delimiters'] = array('default' => '<div id="main">'); $config['search']['settings']['query_type'] = array('type' => 'select', 'options' => array('match' => 'match', 'match boolean' => 'match boolean', 'like' => 'like'));
https://github.com/daylightstudio/FUEL-CMS-Search/blob/master/config/search.php
$config['settings']['enable_profiler'] = array('type' => 'checkbox', 'value' => 1);
However, there are other issues due to the fact that it is tied to the Fuel_hook::post_controller hook and it looks like it could use a change:
public function post_controller() { $CI =& get_instance(); $enable = $CI->config->item('enable_profiler') OR $CI->fuel->config('enable_profiler'); $CI->output->enable_profiler($enable); }
I've pushed that change to the develop branch:
https://github.com/daylightstudio/FUEL-CMS/commit/7db5ad15a85a14b7cee1a1248633a06536317b53