summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'user_guide_src/source/libraries')
-rw-r--r--user_guide_src/source/libraries/email.rst12
-rw-r--r--user_guide_src/source/libraries/form_validation.rst1
-rw-r--r--user_guide_src/source/libraries/language.rst40
-rw-r--r--user_guide_src/source/libraries/output.rst30
-rw-r--r--user_guide_src/source/libraries/sessions.rst5
5 files changed, 55 insertions, 33 deletions
diff --git a/user_guide_src/source/libraries/email.rst b/user_guide_src/source/libraries/email.rst
index da3bf2616..8643444f8 100644
--- a/user_guide_src/source/libraries/email.rst
+++ b/user_guide_src/source/libraries/email.rst
@@ -268,11 +268,21 @@ parameter as mime-type::
$this->email->attach($buffer, 'attachment', 'report.pdf', 'application/pdf');
$this->email->print_debugger()
--------------------------------
+------------------------------
Returns a string containing any server messages, the email headers, and
the email messsage. Useful for debugging.
+You can optionally specify which parts of the message should be printed.
+Valid options are: **headers**, **subject**, **body**.
+
+Example::
+
+ // Will only print the email headers, excluding the message subject and body
+ $this->email->print_debugger(array('headers'));
+
+.. note:: By default, all of the raw data will be printed.
+
Overriding Word Wrapping
========================
diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst
index b1f466f4c..7478ca0ef 100644
--- a/user_guide_src/source/libraries/form_validation.rst
+++ b/user_guide_src/source/libraries/form_validation.rst
@@ -894,6 +894,7 @@ Rule Parameter Description
0, 1, 2, 3, etc.
**is_natural_no_zero** No Returns FALSE if the form element contains anything other than a natural
number, but not zero: 1, 2, 3, etc.
+**valid_url** No Returns FALSE if the form element does not contain a valid URL.
**valid_email** No Returns FALSE if the form element does not contain a valid email address.
**valid_emails** No Returns FALSE if any value provided in a comma separated list is not a valid email.
**valid_ip** No Returns FALSE if the supplied IP is not valid.
diff --git a/user_guide_src/source/libraries/language.rst b/user_guide_src/source/libraries/language.rst
index 772f70d0b..d288cd65e 100644
--- a/user_guide_src/source/libraries/language.rst
+++ b/user_guide_src/source/libraries/language.rst
@@ -10,12 +10,11 @@ containing sets of language files. You can create your own language
files as needed in order to display error and other messages in other
languages.
-Language files are typically stored in your system/language directory.
-Alternately you can create a folder called language inside your
-application folder and store them there. CodeIgniter will look first in
-your application/language directory. If the directory does not exist or
-the specified language is not located there CI will instead look in your
-global system/language folder.
+Language files are typically stored in your **system/language/** directory.
+Alternately you can create a directory called language inside your
+application folder and store them there. CodeIgniter will always load the
+one in **system/language/** first and will then look for an override in
+your **application/language/** directory.
.. note:: Each language should be stored in its own folder. For example,
the English files are located at: system/language/english
@@ -23,14 +22,14 @@ global system/language folder.
Creating Language Files
=======================
-Language files must be named with _lang.php as the file extension. For
+Language files must be named with **_lang.php** as the file extension. For
example, let's say you want to create a file containing error messages.
You might name it: error_lang.php
Within the file you will assign each line of text to an array called
-$lang with this prototype::
+``$lang`` with this prototype::
- $lang['language_key'] = "The actual message to be shown";
+ $lang['language_key'] = 'The actual message to be shown';
.. note:: It's a good practice to use a common prefix for all messages
in a given file to avoid collisions with similarly named items in other
@@ -39,9 +38,9 @@ $lang with this prototype::
::
- $lang['error_email_missing'] = "You must submit an email address";
- $lang['error_url_missing'] = "You must submit a URL";
- $lang['error_username_missing'] = "You must submit a username";
+ $lang['error_email_missing'] = 'You must submit an email address';
+ $lang['error_url_missing'] = 'You must submit a URL';
+ $lang['error_username_missing'] = 'You must submit a username';
Loading A Language File
=======================
@@ -54,7 +53,7 @@ first. Loading a language file is done with the following code::
Where filename is the name of the file you wish to load (without the
file extension), and language is the language set containing it (ie,
english). If the second parameter is missing, the default language set
-in your *application/config/config.php* file will be used.
+in your **application/config/config.php** file will be used.
.. note:: The *language* parameter can only consist of letters.
@@ -80,17 +79,14 @@ Using language lines as form labels
-----------------------------------
This feature has been deprecated from the language library and moved to
-the lang() function of the :doc:`Language
-helper <../helpers/language_helper>`.
+the :php:func:`lang()` function of the :doc:`Language Helper
+<../helpers/language_helper>`.
Auto-loading Languages
======================
If you find that you need a particular language globally throughout your
-application, you can tell CodeIgniter to
-:doc:`auto-load <../general/autoloader>` it during system
-initialization. This is done by opening the
-application/config/autoload.php file and adding the language(s) to the
-autoload array.
-
-
+application, you can tell CodeIgniter to :doc:`auto-load
+<../general/autoloader>` it during system initialization. This is done
+by opening the **application/config/autoload.php** file and adding the
+language(s) to the autoload array. \ No newline at end of file
diff --git a/user_guide_src/source/libraries/output.rst b/user_guide_src/source/libraries/output.rst
index 82b1a56a5..a3d67b847 100644
--- a/user_guide_src/source/libraries/output.rst
+++ b/user_guide_src/source/libraries/output.rst
@@ -53,17 +53,37 @@ You can also set the character set of the document, by passing a second argument
$this->output->set_content_type('css', 'utf-8');
-$this->output->get_content_type();
-==========================================
+$this->output->get_content_type()
+=================================
-Returns the Content-Type HTTP header that's currently in use.
+Returns the Content-Type HTTP header that's currently in use,
+excluding the character set value.
$mime = $this->output->get_content_type();
.. note:: If not set, the default return value is 'text/html'.
-$this->output->get_output();
-=============================
+$this->output->get_header()
+===========================
+
+Gets the requested HTTP header value, if set.
+
+If the header is not set, NULL will be returned.
+If an empty value is passed to the method, it will return FALSE.
+
+Example::
+
+ $this->output->set_content_type('text/plain', 'UTF-8');
+ echo $this->output->get_header('content-type');
+ // Outputs: text/plain; charset=utf-8
+
+.. note:: The header name is compared in a case-insensitive manner.
+
+.. note:: Raw headers sent via PHP's native ``header()`` function are
+ also detected.
+
+$this->output->get_output()
+===========================
Permits you to manually retrieve any output that has been sent for
storage in the output class. Usage example::
diff --git a/user_guide_src/source/libraries/sessions.rst b/user_guide_src/source/libraries/sessions.rst
index aecad3164..36c7c1d32 100644
--- a/user_guide_src/source/libraries/sessions.rst
+++ b/user_guide_src/source/libraries/sessions.rst
@@ -28,10 +28,6 @@ use the $this->load->driver function::
Once loaded, the Sessions library object will be available using:
$this->session
-.. note:: For backward compatibility, the Session class may stil be loaded
- using the $this->load->library function, but converting your applications
- to use $this->load->driver is strongly recommended.
-
How do Sessions work?
=====================
@@ -487,4 +483,3 @@ without making it the initially loaded driver, set 'sess_valid_drivers' in
your config.php file to an array including your driver name::
$config['sess_valid_drivers'] = array('sess_driver');
-