Libraries: Master: Unterschied zwischen den Versionen
Tm (Diskussion | Beiträge) |
Tm (Diskussion | Beiträge) |
||
| (9 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 117: | Zeile 117: | ||
* '''Add dynamic content via code'''<br>This option is the most flexible. The library offers methods to insert content at runtime in every area and specify the exact position like before or after content of components or static content. Read more about adding dynamic content here: [[#Dynamic_Content]] | * '''Add dynamic content via code'''<br>This option is the most flexible. The library offers methods to insert content at runtime in every area and specify the exact position like before or after content of components or static content. Read more about adding dynamic content here: [[#Dynamic_Content]] | ||
== Basic Configuration == | |||
Basic configurations can be done in '''codecoupler/config/master.php'''. The configuration option are: | |||
* '''master_doctype:''' Defines the HTML-Documenttype. Can be one of the following: xhtml11, xhtml1-strict, xhtml1-trans, xhtml1-frame, html5, html4-strict, html4-trans, and html4-frame. Values are saved in the doctypes config file (application/config/doctypes.php). | |||
* '''master_author:''' Set the author. | |||
* '''master_template:''' Static content can be organized in different static templates. Here you set the name of the static template you want to use. | |||
* '''master_autoload_scripts:''' Array of scripts that should be loaded by default. The files have to be placed into the folder ''assets/js'', inside your applcazion folder or at the top of your webfolder. | |||
* '''master_autoload_styles:''' Array of styles that should be loaded by default. The files have to be placed into the folder ''assets/css'', inside your applcazion folder or at the top of your webfolder. | |||
* '''master_enabled_components:''' Array of names of components that should always be enabled. See [[#Components Concept]] | |||
Furthermore you can set some advanced options described here: [[#Redefine default paths]] | |||
Any language specific configurations can be done by placing a file named '''master_lang.php''' into the language folder. Here an expample showing the default values: | |||
<syntaxhighlight lang="php"> | |||
$lang['master_charset'] = 'UTF-8'; | |||
$lang['master_lang'] = 'en'; | |||
$lang['master_title'] = 'CodeCoupler'; | |||
$lang['master_description'] = 'This is a CodeCoupler based Website'; | |||
</syntaxhighlight> | |||
The configuration options are: | |||
* '''master_charset:''' Set charset of the page. | |||
* '''master_lang:''' Set the attrinbute "lang" of <html>. | |||
* '''master_title:''' Set the <title> of the page. | |||
* '''master_description:''' Set the description of the page. | |||
You can read or manipulate all configuration values dynamically from everywhere in your code by accessing variables the following way: | |||
$this->master->config->X | |||
Replace '''X''' with the name of the configuration variablename without the prefix '''master_'''. Regardless of whether it's a gloabl or a language speicfic setting. To change the author for example: | |||
$this->master->config->author="The new author"; | |||
== Components Concept == | == Components Concept == | ||
| Zeile 163: | Zeile 200: | ||
* '''after:''' This array tells the framework after of what enabled components this one should be included. | * '''after:''' This array tells the framework after of what enabled components this one should be included. | ||
== | == Static Content == | ||
Static content will be defined in eight files. Every file contains content for a specific area in the master template. You can even define if you want to insert the content before the component-snipets or afterthere. | |||
These eight files have to be in one folder. The bunch of files will be called "static template". The folder name is saved in the configuration variable '''master_static_template'''. So it's just easy to create multiple static templates and change them as required in each controller setting '''$this->master->config->static_template'''. | |||
All static template folders have to be within the folder '''codecoupler/views/master'''. The default static template is called '''default-template'''. Therefore the files reside in '''codecoupler/views/master/default-template''' | |||
=== Adding Static Content === | |||
To add static content to the master template you have to add it into the eight static template files as follows: | |||
To add static content at the beginning of <head>: | |||
* '''head_init_beforeComponents.php:''' Before code of components. | * '''head_init_beforeComponents.php:''' Before code of components. | ||
* '''head_init_afterComponents.php:''' After code of components. | * '''head_init_afterComponents.php:''' After code of components. | ||
To add static content at the end of <head>: | |||
* '''head_finish_beforeComponents.php:''' Before code of components. | * '''head_finish_beforeComponents.php:''' Before code of components. | ||
* '''head_finish_afterComponents.php:''' After code of components. | * '''head_finish_afterComponents.php:''' After code of components. | ||
To add static content at the beginning of <body>: | |||
* '''body_init_beforeComponents.php:''' Before code of components. | * '''body_init_beforeComponents.php:''' Before code of components. | ||
* '''body_init_afterComponents.php:''' After code of components. | * '''body_init_afterComponents.php:''' After code of components. | ||
To add static content at the end of <body>: | |||
* '''body_finish_beforeComponents.php:''' Before code of components. | * '''body_finish_beforeComponents.php:''' Before code of components. | ||
| Zeile 265: | Zeile 280: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Remarks: | |||
* You should know, that between the positions '''head_init_afterComponents_afterStatic''', '''head_main''' and '''head_finish_beforeComponents_beforeStatic''' will be nothing else embeded (no components nor static code). They all will be filled by code. If your controller add onetime a snipet into the head, it is irrelevant what of the three positions is used. The three positions are for the sake of completeness available. The only important thing to know is, that the following helper functions will use only '''head_main'''. | |||
* Using the position '''body_main'' will put the content before the controller output. You should think carefully about using this position. It is for the sake of completeness available, but the most useful way is to let the controller output fill this position. If you want to force some content to be inserted directly before or after the controller output, you should use '''body_init_afterComponents_afterStatic''' and '''body_finish_beforeComponents_beforeStatic'''. | |||
=== Helper Methods === | === Helper Methods === | ||
| Zeile 278: | Zeile 295: | ||
$this->master->add_styleheet($style); | $this->master->add_styleheet($style); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==== Add JavaScript ==== | ==== Add JavaScript ==== | ||
| Zeile 289: | Zeile 303: | ||
$this->master->add_script($script); | $this->master->add_script($script); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==== Add Meta Informations ==== | ==== Add Meta Informations ==== | ||
| Zeile 312: | Zeile 323: | ||
==== Adding any Content into body ==== | ==== Adding any Content into body ==== | ||
You can use the following functions to add content into area ''' | You can use the following functions to add content into area '''body_main''': | ||
<syntaxhighlight> | <syntaxhighlight> | ||
| Zeile 347: | Zeile 358: | ||
Every path and filename used in this library can be configured if desired in the file '''codecoupler/config/master.advanced.php''': | Every path and filename used in this library can be configured if desired in the file '''codecoupler/config/master.advanced.php''': | ||
* ''' | * '''master_uri_assets:''' Url to the asset manager controller. This is used by the methods '''add_styleheet''' and '''add_script''' within the <link> and <script> tags. | ||
* '''master_path_views:''' Subpath to folder that contains the views for the structure and the template folders for static content, starting in folder '''views'''. See remark below. | |||
* ''' | * '''master_path_structure:''' Filename of view that contains the base structure of the master-template. Do not use the extension '''.php'''. | ||
* ''' | * '''master_path_head_init_beforeComponents:''' Filename of view that contains static content of the master-template of a specific part. Do not use the extension '''.php'''. | ||
* ''' | * '''master_path_head_init_afterComponents:''' Filename of view that contains static content of the master-template of a specific part. Do not use the extension '''.php'''. | ||
* '''master_path_head_finish_beforeComponents:''' Filename of view that contains static content of the master-template of a specific part. Do not use the extension '''.php'''. | |||
* '''master_path_head_finish_afterComponents:''' Filename of view that contains static content of the master-template of a specific part. Do not use the extension '''.php'''. | |||
* ''' | * '''master_path_body_init_beforeComponents:''' Filename of view that contains static content of the master-template of a specific part. Do not use the extension '''.php'''. | ||
* ''' | * '''master_path_body_init_afterComponents:''' Filename of view that contains static content of the master-template of a specific part. Do not use the extension '''.php'''. | ||
* ''' | * '''master_path_body_finish_beforeComponents:''' Filename of view that contains static content of the master-template of a specific part. Do not use the extension '''.php'''. | ||
* ''' | * '''master_path_body_finish_afterComponents:''' Filename of view that contains static content of the master-template of a specific part. Do not use the extension '''.php'''. | ||
* ''' | |||
* ''' | |||
* ''' | |||
Remark: At subpaths starting in folder '''views''' it's not relevant if you mean the folder '''views''' inside the folder '''codecoupler''' or '''application'''. CodeIgniter will search first into the folder '''codecoupler/views''' and if not find there the file needed it will look into the folder '''application/views'''. By default all codecoupler views are installed within the folder '''codecoupler/views'''. | Remark: At subpaths starting in folder '''views''' it's not relevant if you mean the folder '''views''' inside the folder '''codecoupler''' or '''application'''. CodeIgniter will search first into the folder '''codecoupler/views''' and if not find there the file needed it will look into the folder '''application/views'''. By default all codecoupler views are installed within the folder '''codecoupler/views'''. | ||
| Zeile 374: | Zeile 382: | ||
=== Extended Usage === | === Extended Usage === | ||
In some cases maybe you have to modify the basic structure of the master template. Or you want to define what else then a html-document. In this case you can modify the file '''codecoupler/views/master/ | In some cases maybe you have to modify the basic structure of the master template. Or you want to define what else then a html-document. In this case you can modify the file '''codecoupler/views/master/default-structure.php'''. Within the sourcecode of this file you can read all accessible variables. | ||
Aktuelle Version vom 4. Oktober 2015, 11:24 Uhr
In contrast to the basic CodeIgniter framework, every output of a controller will be surrounded by a master-template. All the handling will be driven by the library "Master" (accesible via $this->master). This library will be autoloaded. This page will explain every single element of the master template and all the members and methods of this library.
HTML Structure
Basic Structure
The Basic structure looks like this:
<!DOCTYPE [CONFIGURED DOCTYPE] />
<html class="no-js" lang="[CONFIGURED LANGUAGE]" >
<head>
...
</head>
<body>
[LEGACY BROWSER HINT]
...
</body>
</html>
The doctype and the language of the template are configurable. The default value of the doctype is <!DOCTYPE html>.
The <html> tag includes a class named no-js in order to allow you to more easily and explicitly add custom styles based on whether JavaScript is disabled (.no-js) or enabled (.js). Using this technique also helps avoid the FOUC.
Head section
The order of the elements are very important. Here will be the order and the meaning of each element within the head section explained.
1. A charset definition, which is configurable. The default value is utf-8. The charset declaration must be included completely within the first 1024 bytes of the document and should be specified as early as possible (before any content that could be controlled by an attacker, such as a <title> element) in order to avoid a potential encoding-related security issue in Internet Explorer. More informations:
- https://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#charset
- https://code.google.com/p/doctype-mirror/wiki/ArticleUtf7
<meta charset="[CONFIGURED CHARSET]" />
2. A <meta> tag for compatibility mode to force IE to use the latest rendering engine and using chromeframe if possible. This tag needs to be included before all other tags except for the <title> and the other <meta> tags. More informations:
- https://msdn.microsoft.com/en-us/library/jj676915%28v=vs.85%29.aspx
- http://stackoverflow.com/questions/14637943/what-is-x-ua-compatible-when-it-references-ie-edge-chrome-1
<meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1">
3. A script, which set a cookie with screen resolution and pixel density informations. This allows the framework to send images to the browser adapted to the current environment. Devices with a low resolution will be delivered with automatically downscaled imagesizes. This script have to be included as high as possible and before any other script.
<script>document.cookie='resolution='+Math.max(screen.width,screen.height)+("devicePixelRatio" in window ? ","+devicePixelRatio : ",1")+'; path=/';</script>
4. The base will be set for portable linking ressources. In CodeIgniter you always had to call the function base_url to make your application moveable into subdirectories. With this setting you hopefully do not have to use base_url anymore:
<base href="<?= base_url() ?>" />
5. Setting "viewport" for normalizing and building responsive designs. More informations:
- https://docs.google.com/presentation/d/1rmxwWa9P6_xHqonmh5ONXRS-jPc5XKbnv99Rjkhe04s/present#slide=id.i0
- https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6. Now basic meta information will be included that can be configured:
<title>[CONFIGURED TITLE]</title>
<meta name="description" content="[CONFIGURED DESCRIPTION]">
<meta name="author" content="[CONFIGURED AUTHOR]">
7. Last but not least all the dynamic informations will be included. You can add static content appearing on all pages, add content via code and by enabling components.
Body Section
If IE 7 or older will be used to display your pages a browser upgrade prompt will be shown. This is included in the beginning of <body>.
<!--[if lt IE 8]>
<p style="margin: 0.2em 0;background: #ccc;color: #000;padding: 0.2em 0;">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
How to work with the template
The basic layout of the master template looks roughly like this:
<doctype>
<html>
<head>
[PREDEFINED AND CONFIGURABLE META INFORMATION]
HEAD_INIT: [STATIC, DYNAMIC AND COMPONENTS CONTENT]
HEAD_MAIN: [CUSTOM AND AUTOMATICALLY LOADED STYLES AND SCRIPTS]
HEAD_FINISH: [STATIC, DYNAMIC AND COMPONENTS CONTENT]
</head>
<body>
BODY_INIT: [STATIC, DYNAMIC AND COMPONENTS CONTENT]
BODY_MAIN: [YOUR CONTROLLER OUTPUT]
BODY_FINISH: [STATIC, DYNAMIC AND COMPONENTS CONTENT]
</body>
</html>
There are six areas where code can be injected: head_init, head_main, head_finish, body_init, body_main, body_finish. The area body_main has furthermore a special role. Into this area will be putted the output of the controller itself.
You can manipulate the content in these areas via three options:
- Enable/Disable components
This option will insert code into the areas head_init, head_finish, body_init and body_finish. Components are sets of codesnipets that can be enabled or disabled. Every component keep it's own configuration what code will be inserted in which area. Read more about components here: #Components_Concept
- Add static content
This option will be controlled by the files within the folder codecoupler/views/master. Content defined in these files will be included in every page within the areas head_init, head_finish, body_init and body_finish. It's possible to define if the content will appear before or after content of components. You can read further details abaout the static files here: #Static_Content
- Add dynamic content via code
This option is the most flexible. The library offers methods to insert content at runtime in every area and specify the exact position like before or after content of components or static content. Read more about adding dynamic content here: #Dynamic_Content
Basic Configuration
Basic configurations can be done in codecoupler/config/master.php. The configuration option are:
- master_doctype: Defines the HTML-Documenttype. Can be one of the following: xhtml11, xhtml1-strict, xhtml1-trans, xhtml1-frame, html5, html4-strict, html4-trans, and html4-frame. Values are saved in the doctypes config file (application/config/doctypes.php).
- master_author: Set the author.
- master_template: Static content can be organized in different static templates. Here you set the name of the static template you want to use.
- master_autoload_scripts: Array of scripts that should be loaded by default. The files have to be placed into the folder assets/js, inside your applcazion folder or at the top of your webfolder.
- master_autoload_styles: Array of styles that should be loaded by default. The files have to be placed into the folder assets/css, inside your applcazion folder or at the top of your webfolder.
- master_enabled_components: Array of names of components that should always be enabled. See #Components Concept
Furthermore you can set some advanced options described here: #Redefine default paths
Any language specific configurations can be done by placing a file named master_lang.php into the language folder. Here an expample showing the default values:
$lang['master_charset'] = 'UTF-8';
$lang['master_lang'] = 'en';
$lang['master_title'] = 'CodeCoupler';
$lang['master_description'] = 'This is a CodeCoupler based Website';
The configuration options are:
- master_charset: Set charset of the page.
- master_lang: Set the attrinbute "lang" of <html>.
- master_title: Set the <title> of the page.
- master_description: Set the description of the page.
You can read or manipulate all configuration values dynamically from everywhere in your code by accessing variables the following way:
$this->master->config->X
Replace X with the name of the configuration variablename without the prefix master_. Regardless of whether it's a gloabl or a language speicfic setting. To change the author for example:
$this->master->config->author="The new author";
Components Concept
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.
- You can find an overview of all components, their keys and their configuration options here: Libraries: Master: Components Overview
- If you want to add your own components you should the HowTo here: Libraries: Master: Adding New Components
Enable/Disable by Configuration
Components can be enabled in codecoupler/config/master.php, in the variable master_enabled_components. Every component have it's own full qualified name. For example to enable the bootstrap component you have to write:
$config['master_enabled_components'] = array('frameworks.bootstrap');Enable/Disable and Configure Dynamicaly
Everywhere in your code you can enable and disable components or set a new configuration of them. Use the following functions to handle components:
//Enable component. Use the name of the component as $key:
$this->master->enable_component($key);
//Disable component. Use the name of the component as $key.
$this->master->disable_component($key);
//Disable all components:
$this->master->disable_all_components();
//Returns TRUE if the component is enabled, otherwise FALSE. Use the name of the component as $key:
$this->master->is_component_enabled($key);
//Set a new Configuration for the component. Use the name of the component as $key:
$this->set_component_config($key,$config);Configuration Options of Components
Some of the components have some configuration options. In this case you will find a file in the folder components/config/PATH_TO_COMPONENT/config.php. There you will find an array named config where you can finetune the component. Please read the chapter Libraries: Master: Components Overview for further details of each components and it's configuration options.
You can even go deeper and finetune the setup options of a component. Normally you do not have to modify these setting. But in some situation it could be inevitable. Components can be also configured in components/config/PATH_TO_COMPONENT/setup.php. Every component will be described in one array with the following keys:
- depends: This array tells the framework on what components this one depends. Depending components will be enabled automatically.
- after: This array tells the framework after of what enabled components this one should be included.
Static Content
Static content will be defined in eight files. Every file contains content for a specific area in the master template. You can even define if you want to insert the content before the component-snipets or afterthere.
These eight files have to be in one folder. The bunch of files will be called "static template". The folder name is saved in the configuration variable master_static_template. So it's just easy to create multiple static templates and change them as required in each controller setting $this->master->config->static_template.
All static template folders have to be within the folder codecoupler/views/master. The default static template is called default-template. Therefore the files reside in codecoupler/views/master/default-template
Adding Static Content
To add static content to the master template you have to add it into the eight static template files as follows:
To add static content at the beginning of <head>:
- head_init_beforeComponents.php: Before code of components.
- head_init_afterComponents.php: After code of components.
To add static content at the end of <head>:
- head_finish_beforeComponents.php: Before code of components.
- head_finish_afterComponents.php: After code of components.
To add static content at the beginning of <body>:
- body_init_beforeComponents.php: Before code of components.
- body_init_afterComponents.php: After code of components.
To add static content at the end of <body>:
- body_finish_beforeComponents.php: Before code of components.
- body_finish_afterComponents.php: After code of components.
Adding Dynamic Data to Static Content
You can pass data to the static content, exactly as you pass data to a CodeIgniter-View, by way of an array or an object. Just set the following variable:
$this->master->static_view_vars
Now you can use within the static content variables that correspond to the array keys.
Dynamic Content
To put content at runtime somewhere in the master-template you can use the base method add_content which is the most flexible. But there are several helper functions around this method to make your life easier.
Base Method
You can use the following function to inject code into a specific area within the structure:
$this->master->add_content($position, $content);With $postion you define the area and the exact position therein. The value can be one of the following constants - which are self-explanatory:
MasterPosition::head_init_beforeComponents_beforeStatic
MasterPosition::head_init_beforeComponents_afterStatic
MasterPosition::head_init_afterComponents_beforeStatic
MasterPosition::head_init_afterComponents_afterStatic
MasterPosition::head_main
MasterPosition::head_finish_beforeComponents_beforeStatic
MasterPosition::head_finish_beforeComponents_afterStatic
MasterPosition::head_finish_afterComponents_beforeStatic
MasterPosition::head_finish_afterComponents_afterStatic
MasterPosition::body_init_beforeComponents_beforeStatic
MasterPosition::body_init_beforeComponents_afterStatic
MasterPosition::body_init_afterComponents_beforeStatic
MasterPosition::body_init_afterComponents_afterStatic
MasterPosition::body_main
MasterPosition::body_finish_beforeComponents_beforeStatic
MasterPosition::body_finish_beforeComponents_afterStatic
MasterPosition::body_finish_afterComponents_beforeStatic
MasterPosition::body_finish_afterComponents_afterStaticRemarks:
- You should know, that between the positions head_init_afterComponents_afterStatic, head_main and head_finish_beforeComponents_beforeStatic will be nothing else embeded (no components nor static code). They all will be filled by code. If your controller add onetime a snipet into the head, it is irrelevant what of the three positions is used. The three positions are for the sake of completeness available. The only important thing to know is, that the following helper functions will use only head_main.
- Using the position body_main will put the content before the controller output. You should think carefully about using this position. It is for the sake of completeness available, but the most useful way is to let the controller output fill this position. If you want to force some content to be inserted directly before or after the controller output, you should use body_init_afterComponents_afterStatic' and body_finish_beforeComponents_beforeStatic.
Helper Methods
This methods uses the base method, but makes some recurring coding superfluous.
Add Stylesheet
To add a link to a stylesheet-file into area head_main. The files have to be placed into the folder application/assets/css:
$this->master->add_styleheet($style);Add JavaScript
To add a link to a javascript-file into area head_main. The files have to be placed into the folder application/assets/js:
$this->master->add_script($script);Add Meta Informations
To add a <meta> tag into area head_main:
$this->master->add_meta($name,$content);Adding any Content into head
You can use the following functions to add content into area head_main:
//Add Content into the head_main Area:
$this->master->add_content_head($content);Adding any Content into body
You can use the following functions to add content into area body_main:
//Add Content into the body_main Area - always after the conroller output:
$this->master->add_content_body($content);Advanced Topics
Enabling/Disabling
You can of course disable the templating completely. This is important for example if writing Ajax-Controllers returning only json or xml. Use the following functions:
- $this->master->disable(): Disable the master-templating.
- $this->master->enable(): Enable the master-templating.
- $this->master->is_enabled(): Returns TRUE if master-templating is enabled.
Alternatively you can create a file named .nomaster in the directory of the controller. The master-template will be disabled for all controllers in this directory.
Debugging Features
Depending on the variable "ENVIRONMENT" (defined in index.php in the root) the variable $this->master->_DEBUG will be set to TRUE or FALSE. In development environment it is TRUE, otherwise FALSE. You can set this variable everytime to the value you want.
If the variable $this->master->_DEBUG is TRUE, every single area of the master template output will be surrounded by html-comments. Here an example:
<!-- - - - - -body_main_controller - - - - - -->
<h1>Hello World</h1>
<!-- - - - - - - - - - - - - - - - - - - - - -->
Redefine default paths
Every path and filename used in this library can be configured if desired in the file codecoupler/config/master.advanced.php:
- master_uri_assets: Url to the asset manager controller. This is used by the methods add_styleheet and add_script within the <link> and <script> tags.
- master_path_views: Subpath to folder that contains the views for the structure and the template folders for static content, starting in folder views. See remark below.
- master_path_structure: Filename of view that contains the base structure of the master-template. Do not use the extension .php.
- master_path_head_init_beforeComponents: Filename of view that contains static content of the master-template of a specific part. Do not use the extension .php.
- master_path_head_init_afterComponents: Filename of view that contains static content of the master-template of a specific part. Do not use the extension .php.
- master_path_head_finish_beforeComponents: Filename of view that contains static content of the master-template of a specific part. Do not use the extension .php.
- master_path_head_finish_afterComponents: Filename of view that contains static content of the master-template of a specific part. Do not use the extension .php.
- master_path_body_init_beforeComponents: Filename of view that contains static content of the master-template of a specific part. Do not use the extension .php.
- master_path_body_init_afterComponents: Filename of view that contains static content of the master-template of a specific part. Do not use the extension .php.
- master_path_body_finish_beforeComponents: Filename of view that contains static content of the master-template of a specific part. Do not use the extension .php.
- master_path_body_finish_afterComponents: Filename of view that contains static content of the master-template of a specific part. Do not use the extension .php.
Remark: At subpaths starting in folder views it's not relevant if you mean the folder views inside the folder codecoupler or application. CodeIgniter will search first into the folder codecoupler/views and if not find there the file needed it will look into the folder application/views. By default all codecoupler views are installed within the folder codecoupler/views.
You can read or manipulate all configuration values dynamically from everywhere in your code by accessing variables with the following scheme:
$this->master->config->path_X
Replace path_X with the name of the configuration variablename without the prefix master_.
Extended Usage
In some cases maybe you have to modify the basic structure of the master template. Or you want to define what else then a html-document. In this case you can modify the file codecoupler/views/master/default-structure.php. Within the sourcecode of this file you can read all accessible variables.