Configs & Settings
There are various ways to configure FUEL CMS. Configuration files provide the most common way to make configurations. However, new in FUEL CMS 1.0 is the ability to create and manage your custom config settings in the CMS for Advanced Modules.
What's the Difference Between Configs and Settings?
An Advanced Module (including the FUEL Advanced Module) normally contains a single config file that is the same name as the Advanced Module (e.g. fuel/modules/{module}/config/{module}.php). This config file works just like the main CodeIgniter config file but is specific to Advanced Module's and contains an array of values you can change to affect the module's behavior. The config values can be accessed from the Advanced Module's object like so:
... echo $this->fuel->config('site_name');
Config values are not editable in the CMS. To fix this issue, we've implemented Fuel_settings which allows you to create settings forms in the CMS to manage configuration aspects of your Advanced Modules. To do so, you add a settings key in the Advanced Modules config with Form_builder fields with keys that correspond to config values. This gives you the flexibility to expose as much or little of the configuration to CMS users. If no settings values are set, then they default to the static config values. A either be a "super" admin user or be subscribed to the {module}_settings permission to have access to an Advanced Module's settings in the CMS.
$config['my_module']['settings'] = array(); $config['my_module']['settings']['my_config'] = array();
Note that Advance Module config settings use their {module} as a key for namespacing purposes to prevent potential conflicts.
FUEL Specific Application Config Files
The following are configuration files specific to FUEL CMS (and not editable in the CMS):
- asset: configuration parameters for the asset class
- form_builder: used by FUEL's Form_builder class to set initialization preferences, in particular custom field types. By default includes configuration parameters from the fuel/modules/fuel/config/form_builder.php file
- google: used by FUEL's Google helper
- model: used by FUEL's MY_Model class
- MY_config: this configuration file is meant to augment the CodeIgniter config and is autoloaded. You can set additional dev_email (default testing email address) and date_format configuration parameters
- MY_fuel_layouts: used to create the FUEL layouts for the CMS
- MY_fuel_modules: used to create FUEL simple modules
- MY_fuel: used to overwrite any of the default FUEL configuration settings
- parser: used by the template parsing engine and is where you can specify which functions are allowed to be parsed
- redirects: used to create redirects for FUEL
- states: a configuration containing states. Can be used by forms mostly and in particular the custom field type states
CodeIgniter Specific Application Config Files
The following are configuration files specific to CodeIgniter (and not editable in the CMS):
- autoload: sets the packages, libraries, helpers, configs, languages and model files. FUEL automatically includes the fuel/modules/fuel folder as a package path which allows it to store a lot of the files in that folder instead of the fuel/application folder
- config: the CodeIgniter config file
- constants: includes both the Codeigniter and FUEL specific constants and is loaded very early on in the bootstrap process
- database: the CodeIgniter database config file
- doctypes: used in the CodeIgniter HTML helper function doctype()
- foreign_chars: used in the CodeIgniter text helper function convert_accented_characters()
- hooks: the CodeIgniter Hooks configuration. By default it includes the fuel/modules/fuel/config/fuel_hooks.php file which contains FUEL specific hooks.
- migration: the CodeIgniter Migration configuration.
- mimes: the CodeIgniter mimes configuration used by such classes as the CodeIgniter Output class, the Upload class, the file helper and the download helper.
- routes: the CodeIgniter Routing configuration
- smileys: the Smiley helper function configuration