Inheritance¶
Within IQcms inheritance is one of the most important philosophy within IQcms to understand. It not only works on templating but it’s also applied during paring the configuration of a component.
Template rendering¶
When a component renders a template it will first check if the component folder in <project>/components/<component type>/
has the template. If it doesn’t exist it will check if <iqcms-x>/components/<component type>/
has it. If neither of
the two locations has the template, the render engine will first check if the component has traits and apply the same logic.
For the traits <project>/components/<trait name>/
and <iqcms-x>/components/<trait name>/
will be checked. If the
traits can’t provide the templates the render engine will check the parent of the component and the whole render process
will start over again until no inheritance can be found or a template has been found.
Config.php inheritance¶
When a component configuration is requested the ConfigFactory will first map all the configurations available and starts
at the bottom loading them. Creating the configuration map happens at the lowest parent which in IQcms is always Component.
and from there it will add config.php locations from traits and children until the component is reached on which the
getConfig()
method has been invoked. Once the map has been created this config files will be loaded one by one and can
overwrite the configuration of another component.