From 76696d76e137e98f0597547b71b40a991d8b025b Mon Sep 17 00:00:00 2001 From: "anaxamaxan@blackdog.local" Date: Wed, 2 Feb 2011 23:09:54 -0800 Subject: Added docs for config->base_url() changes. --- user_guide/libraries/config.html | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'user_guide/libraries/config.html') diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 98b6052a9..103161f5d 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -175,6 +175,11 @@ define('ENVIRONMENT', 'development');

$this->config->site_url();

This function retrieves the URL to your site, along with the "index" value you've specified in the config file.

+

$this->config->base_url();

+

This function retrieves the URL to your site, plus an optional path such as to a stylesheet or image.

+ +

The two functions above are normally accessed via the corresponding functions in the URL Helper.

+

$this->config->system_url();

This function retrieves the URL to your system folder.

-- cgit v1.2.3-24-g4f1b From 4b9c62980599228f070b401c7673dce8085b0c61 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 1 Jul 2011 17:40:48 -0500 Subject: backed out 648b42a75739, which was a NON-trivial whitespace commit. It broke the Typography class's string replacements, for instance --- user_guide/libraries/config.html | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'user_guide/libraries/config.html') diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index c0192ca0a..2433ec4ad 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -58,7 +58,7 @@ Config Class

Config Class

-

The Config class provides a means to retrieve configuration preferences. These preferences can +

The Config class provides a means to retrieve configuration preferences. These preferences can come from the default config file (application/config/config.php) or from your own custom config files.

Note: This class is initialized automatically by the system so there is no need to do it manually.

@@ -66,7 +66,7 @@ come from the default config file (application/config/config.php) o

Anatomy of a Config File

-

By default, CodeIgniter has one primary config file, located at application/config/config.php. If you open the file using +

By default, CodeIgniter has one primary config file, located at application/config/config.php. If you open the file using your text editor you'll see that config items are stored in an array called $config.

You can add your own config items to @@ -74,7 +74,7 @@ this file, or if you prefer to keep your configuration items separate (assuming simply create your own file and save it in config folder.

Note: If you do create your own config files use the same format as the primary one, storing your items in -an array called $config. CodeIgniter will intelligently manage these files so there will be no conflict even though +an array called $config. CodeIgniter will intelligently manage these files so there will be no conflict even though the array has the same name (assuming an array index is not named the same as another).

Loading a Config File

@@ -92,12 +92,12 @@ so you will only need to load a config file if you have created your own.

Where filename is the name of your config file, without the .php file extension.

-

If you need to load multiple config files normally they will be merged into one master config array. Name collisions can occur, however, if -you have identically named array indexes in different config files. To avoid collisions you can set the second parameter to TRUE +

If you need to load multiple config files normally they will be merged into one master config array. Name collisions can occur, however, if +you have identically named array indexes in different config files. To avoid collisions you can set the second parameter to TRUE and each config file will be stored in an array index corresponding to the name of the config file. Example:

-// Stored in an array with this prototype: $this->config['blog_settings'] = $config
+// Stored in an array with this prototype: $this->config['blog_settings'] = $config
$this->config->load('blog_settings', TRUE);

Please see the section entitled Fetching Config Items below to learn how to retrieve config items set this way.

@@ -109,7 +109,7 @@ $this->config->load('blog_settings', TRUE);
  • Auto-loading -

    If you find that you need a particular config file globally, you can have it loaded automatically by the system. To do this, +

    If you find that you need a particular config file globally, you can have it loaded automatically by the system. To do this, open the autoload.php file, located at application/config/autoload.php, and add your config file as indicated in the file.

  • @@ -129,7 +129,7 @@ indicated in the file.

    The function returns FALSE (boolean) if the item you are trying to fetch does not exist.

    If you are using the second parameter of the $this->config->load function in order to assign your config items to a specific index -you can retrieve it by specifying the index name in the second parameter of the $this->config->item() function. Example:

    +you can retrieve it by specifying the index name in the second parameter of the $this->config->item() function. Example:

    // Loads a config file named blog_settings.php and assigns it to an index named "blog_settings"
    @@ -154,32 +154,32 @@ $site_name = $blog_config['site_name'];

    Environments

    - You may load different configuration files depending on the current environment. - The ENVIRONMENT constant is defined in index.php, and is described - in detail in the Handling Environments - section. + You may load different configuration files depending on the current environment. + The ENVIRONMENT constant is defined in index.php, and is described + in detail in the Handling Environments + section.

    - To create an environment-specific configuration file, - create or copy a configuration file in application/config/{ENVIRONMENT}/{FILENAME}.php + To create an environment-specific configuration file, + create or copy a configuration file in application/config/{ENVIRONMENT}/{FILENAME}.php

    For example, to create a production-only config.php, you would:

      -
    1. Create the directory application/config/production/
    2. -
    3. Copy your existing config.php into the above directory
    4. -
    5. Edit application/config/production/config.php so it contains your production settings
    6. +
    7. Create the directory application/config/production/
    8. +
    9. Copy your existing config.php into the above directory
    10. +
    11. Edit application/config/production/config.php so it contains your production settings

    - When you set the ENVIRONMENT constant to 'production', the settings - for your new production-only config.php will be loaded. + When you set the ENVIRONMENT constant to 'production', the settings + for your new production-only config.php will be loaded.

    You can place the following configuration files in environment-specific folders:

    - +