Libraries: Master: Components Overview: Unterschied zwischen den Versionen

Aus CodeCoupler Wiki
Zur Navigation springen Zur Suche springen
Tm (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
Tm (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
Components are sets of content for the <head> and/or <body> section, that can be enabled or disabled by config or by code. Components can depend on each other. Enabling one component will enable all depending components, too. Disabling a component, will disable all other depending components, if not used otherwise.
Components will always be included before other components depends on it. Also a component can be configured to be included always after another component.
== Default Configuration ==
The goal of the default configuration of components was to have a html5-ready, cross-browser (and lagacy-browser) compatible quick-start boilerplate. To this purpose, several libraries are enabled by default.
=== Normalized CSS ===
The libraries "YAML", "Normalize.css", "HTML5 Boilerplate" have each own normalizing parts. Each of this normalize some style, that other do not. For this reason all of this libraries was used. The normalizers will be used in the following order:
# normalize.css
# main.css from HTML5 Boilerplate
# base.css from YAML
=== Normalized Typographie CSS ===
By default CodeCoupler the following components are enabled:
By default CodeCoupler the following components are enabled:



Version vom 24. Januar 2013, 16:09 Uhr

Components are sets of content for the <head> and/or <body> section, that can be enabled or disabled by config or by code. Components can depend on each other. Enabling one component will enable all depending components, too. Disabling a component, will disable all other depending components, if not used otherwise.

Components will always be included before other components depends on it. Also a component can be configured to be included always after another component.

Default Configuration

The goal of the default configuration of components was to have a html5-ready, cross-browser (and lagacy-browser) compatible quick-start boilerplate. To this purpose, several libraries are enabled by default.

Normalized CSS

The libraries "YAML", "Normalize.css", "HTML5 Boilerplate" have each own normalizing parts. Each of this normalize some style, that other do not. For this reason all of this libraries was used. The normalizers will be used in the following order:

  1. normalize.css
  2. main.css from HTML5 Boilerplate
  3. base.css from YAML

Normalized Typographie CSS

By default CodeCoupler the following components are enabled:


Components Configuration

Components can be configured in application/config/master.php. Every component will be described in one array with three keys:

  • enabled: If TRUE the component will be enabled by default.
  • config: This value ist component specific. Please read the chapter Components: Overview.
  • depends: Thia array tells the framework on what components this one depends. Normally you do not have to modify this.

Enable/Disable Components Dynamicaly

Everywhere in your code you can enable or disable components. You do not have to worry about enabling depending components or the order of the components. Use the following function to handle components:

  • $this->master->enable_component($key): Enable component. Use the key of the component.
  • $this->master->disable_component($key): Enable component. Use the key of the component.
  • $this->master->is_component_enabled($key): Returns TRUE if the component is enabled, otherwise FALSE. Use the key of the component.

You can find an overview of all components, their keys and how to add you own components here: Components: Overview

Development

  • Use always <?= base_url ?>. The url-helper is autoloaded.