Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Clone this wiki locally
Default configuration for Components is stored in the file
config.inc in the component's
config folder in the following format:
'show_archive' => false,
Reading Config Values
In classes derived from the Component Baseclasses, the current configuration is available in the attribute
$show_archive = $this->_config->get('show_archive');
The same information is available in the component's Style Elements through
$show_archive = $data['config']->get('show_archive');
To access config information from outside the component source or from DBA classes, it is available via
$config = midcom_baseclasses_components_configuration::get('net.nehmer.blog', 'config'); $show_archive = $config->get('show_archive');
Overriding Config Values
You can override the default config values in your project's
config/midcom directory by creating a subfolder named like your component (e.g.
net.nehmer.blog) and creating a file called
config.inc. Settings are merged, so the ones you don't override will still use the component defaults.
If you don't want to store your configuration in the filesystem, you can also save it in the database in a special Snippetdir called sitegroup-config. To configure a component, a Subsnippetdir with the name of the component has to be created, and then a Snippet named
Additionally, you can also set config values for specific Topics, which are then saved as Parameters in the database. These take precedence over both the component defaults and the project config/sitegroup-config values.