-
Some PHP functions return FALSE on failure, but may also have a valid return value of "" or 0, which would evaluate to FALSE in loose comparisons. Be explicit by comparing the variable type when using these return values in conditionals to ensure the return value is indeed what you expect, and not a value that has an equivalent loose-type evaluation.
-
Use the same stringency in returning and checking your own variables. Use === and !== as necessary.
+
Some PHP functions return FALSE on failure, but may also have a valid return value of "" or 0, which would evaluate to FALSE in loose comparisons. Be explicit by comparing the variable type when using these return values in conditionals to ensure the return value is indeed what you expect, and not a value that has an equivalent loose-type evaluation.
+
Use the same stringency in returning and checking your own variables. Use === and !== as necessary.
INCORRECT:
// If 'foo' is at the beginning of the string, strpos will return a 0,
@@ -329,7 +329,7 @@ if (strpos($str, 'foo') === FALSE)
INCORRECT:
function build_string($str = "")
{
- if ($str == "") // uh-oh! What if FALSE or the integer 0 is passed as an argument?
+ if ($str == "") // uh-oh! What if FALSE or the integer 0 is passed as an argument?
{
}
@@ -344,7 +344,7 @@ function build_string($str = "")
}
}
- See also information regarding typecasting, which can be quite useful. Typecasting has a slightly different effect which may be desirable. When casting a variable as a string, for instance, NULL and boolean FALSE variables become empty strings, 0 (and other numbers) become strings of digits, and boolean TRUE becomes "1":
+ See also information regarding typecasting, which can be quite useful. Typecasting has a slightly different effect which may be desirable. When casting a variable as a string, for instance, NULL and boolean FALSE variables become empty strings, 0 (and other numbers) become strings of digits, and boolean TRUE becomes "1":
$str = (string) $str; // cast $str as a string
@@ -362,7 +362,7 @@ function build_string($str = "")
Whitespace in Files
-
No whitespace can precede the opening PHP tag or follow the closing PHP tag. Output is buffered, so whitespace in your files can cause output to begin before CodeIgniter outputs its content, leading to errors and an inability for CodeIgniter to send proper headers. In the examples below, select the text with your mouse to reveal the incorrect whitespace.
+
No whitespace can precede the opening PHP tag or follow the closing PHP tag. Output is buffered, so whitespace in your files can cause output to begin before CodeIgniter outputs its content, leading to errors and an inability for CodeIgniter to send proper headers. In the examples below, select the text with your mouse to reveal the incorrect whitespace.
INCORRECT:
@@ -381,14 +381,14 @@ function build_string($str = "")
Compatibility
-
Unless specifically mentioned in your add-on's documentation, all code must be compatible with PHP version 5.1+. Additionally, do not use PHP functions that require non-default libraries to be installed unless your code contains an alternative method when the function is not available, or you implicitly document that your add-on requires said PHP libraries.
+
Unless specifically mentioned in your add-on's documentation, all code must be compatible with PHP version 5.1+. Additionally, do not use PHP functions that require non-default libraries to be installed unless your code contains an alternative method when the function is not available, or you implicitly document that your add-on requires said PHP libraries.
Class and File Names using Common Words
-
When your class or filename is a common word, or might quite likely be identically named in another PHP script, provide a unique prefix to help prevent collision. Always realize that your end users may be running other add-ons or third party PHP scripts. Choose a prefix that is unique to your identity as a developer or company.
+
When your class or filename is a common word, or might quite likely be identically named in another PHP script, provide a unique prefix to help prevent collision. Always realize that your end users may be running other add-ons or third party PHP scripts. Choose a prefix that is unique to your identity as a developer or company.
INCORRECT:
class Email pi.email.php
@@ -405,7 +405,7 @@ class Pre_import mod.pre_import.php
Database Table Names
-
Any tables that your add-on might use must use the 'exp_' prefix, followed by a prefix uniquely identifying you as the developer or company, and then a short descriptive table name. You do not need to be concerned about the database prefix being used on the user's installation, as CodeIgniter's database class will automatically convert 'exp_' to what is actually being used.
+
Any tables that your add-on might use must use the 'exp_' prefix, followed by a prefix uniquely identifying you as the developer or company, and then a short descriptive table name. You do not need to be concerned about the database prefix being used on the user's installation, as CodeIgniter's database class will automatically convert 'exp_' to what is actually being used.
INCORRECT:
email_addresses // missing both prefixes
@@ -416,35 +416,35 @@ exp_email_addresses // missing unique prefix
exp_pre_email_addresses
-
NOTE: Be mindful that MySQL has a limit of 64 characters for table names. This should not be an issue as table names that would exceed this would likely have unreasonable names. For instance, the following table name exceeds this limitation by one character. Silly, no? exp_pre_email_addresses_of_registered_users_in_seattle_washington
+
NOTE: Be mindful that MySQL has a limit of 64 characters for table names. This should not be an issue as table names that would exceed this would likely have unreasonable names. For instance, the following table name exceeds this limitation by one character. Silly, no? exp_pre_email_addresses_of_registered_users_in_seattle_washington
One File per Class
-
Use separate files for each class your add-on uses, unless the classes are closely related. An example of CodeIgniter files that contains multiple classes is the Database class file, which contains both the DB class and the DB_Cache class, and the Magpie plugin, which contains both the Magpie and Snoopy classes.
+
Use separate files for each class your add-on uses, unless the classes are closely related. An example of CodeIgniter files that contains multiple classes is the Database class file, which contains both the DB class and the DB_Cache class, and the Magpie plugin, which contains both the Magpie and Snoopy classes.
Whitespace
-
Use tabs for whitespace in your code, not spaces. This may seem like a small thing, but using tabs instead of whitespace allows the developer looking at your code to have indentation at levels that they prefer and customize in whatever application they use. And as a side benefit, it results in (slightly) more compact files, storing one tab character versus, say, four space characters.
+
Use tabs for whitespace in your code, not spaces. This may seem like a small thing, but using tabs instead of whitespace allows the developer looking at your code to have indentation at levels that they prefer and customize in whatever application they use. And as a side benefit, it results in (slightly) more compact files, storing one tab character versus, say, four space characters.
Line Breaks
-
Files must be saved with Unix line breaks. This is more of an issue for developers who work in Windows, but in any case ensure that your text editor is setup to save files with Unix line breaks.
+
Files must be saved with Unix line breaks. This is more of an issue for developers who work in Windows, but in any case ensure that your text editor is setup to save files with Unix line breaks.
Code Indenting
-
Use Allman style indenting. With the exception of Class declarations, braces are always placed on a line by themselves, and indented at the same level as the control statement that "owns" them.
+
Use Allman style indenting. With the exception of Class declarations, braces are always placed on a line by themselves, and indented at the same level as the control statement that "owns" them.
INCORRECT:
function foo($bar) {
@@ -501,7 +501,7 @@ for ($i = 0; $i < 10; $i++)
Bracket and Parenthetic Spacing
-
In general, parenthesis and brackets should not use any additional spaces. The exception is that a space should always follow PHP control structures that accept arguments with parenthesis (declare, do-while, elseif, for, foreach, if, switch, while), to help distinguish them from functions and increase readability.
+
In general, parenthesis and brackets should not use any additional spaces. The exception is that a space should always follow PHP control structures that accept arguments with parenthesis (declare, do-while, elseif, for, foreach, if, switch, while), to help distinguish them from functions and increase readability.
INCORRECT:
$arr[ $foo ] = 'foo';
@@ -558,9 +558,9 @@ _convert_text() // private method
PHP Errors
-
Code must run error free and not rely on warnings and notices to be hidden to meet this requirement. For instance, never access a variable that you did not set yourself (such as $_POST array keys) without first checking to see that it isset().
+
Code must run error free and not rely on warnings and notices to be hidden to meet this requirement. For instance, never access a variable that you did not set yourself (such as $_POST array keys) without first checking to see that it isset().
-
Make sure that while developing your add-on, error reporting is enabled for ALL users, and that display_errors is enabled in the PHP environment. You can check this setting with:
+
Make sure that while developing your add-on, error reporting is enabled for ALL users, and that display_errors is enabled in the PHP environment. You can check this setting with:
if (ini_get('display_errors') == 1)
{
@@ -571,7 +571,7 @@ _convert_text() // private method
ini_set('display_errors', 1);
-
NOTE: Setting the display_errors setting with ini_set() at runtime is not identical to having it enabled in the PHP environment. Namely, it will not have any effect if the script has fatal errors
+
NOTE: Setting the display_errors setting with ini_set() at runtime is not identical to having it enabled in the PHP environment. Namely, it will not have any effect if the script has fatal errors
@@ -609,7 +609,7 @@ $bat = str_replace($foo, $bar, $bag);
Strings
-
Always use single quoted strings unless you need variables parsed, and in cases where you do need variables parsed, use braces to prevent greedy token parsing. You may also use double-quoted strings if the string contains single quotes, so you do not have to use escape characters.
+
Always use single quoted strings unless you need variables parsed, and in cases where you do need variables parsed, use braces to prevent greedy token parsing. You may also use double-quoted strings if the string contains single quotes, so you do not have to use escape characters.
INCORRECT:
"My String" // no variable parsing, so no use for double quotes
diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html
index 421f51301..b975b701f 100644
--- a/user_guide/general/urls.html
+++ b/user_guide/general/urls.html
@@ -58,7 +58,7 @@ URLS
CodeIgniter URLs
-By default, URLs in CodeIgniter are designed to be search-engine and human friendly. Rather than using the standard "query string"
+
By default, URLs in CodeIgniter are designed to be search-engine and human friendly. Rather than using the standard "query string"
approach to URLs that is synonymous with dynamic systems, CodeIgniter uses a segment-based approach:
example.com/news/article/my_article
@@ -78,7 +78,7 @@ approach to URLs that is synonymous with dynamic systems, CodeIgniter uses a
The URI Class and the URL Helper
-contain functions that make it easy to work with your URI data. In addition, your URLs can be remapped using the
+contain functions that make it easy to work with your URI data. In addition, your URLs can be remapped using the
URI Routing feature for more flexibility.
@@ -103,7 +103,7 @@ a request for your index.php file.
Adding a URL Suffix
In your config/config.php file you can specify a suffix that will be added to all URLs generated
-by CodeIgniter. For example, if a URL is this:
+by CodeIgniter. For example, if a URL is this:
example.com/index.php/products/view/shoes
@@ -125,7 +125,7 @@ open your config file you'll see these items:
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
-
If you change "enable_query_strings" to TRUE this feature will become active. Your controllers and functions will then
+
If you change "enable_query_strings" to TRUE this feature will become active. Your controllers and functions will then
be accessible using the "trigger" words you've set to invoke your controllers and methods:
index.php?c=controller&m=method
diff --git a/user_guide/general/views.html b/user_guide/general/views.html
index ad93f4bc7..ece746592 100644
--- a/user_guide/general/views.html
+++ b/user_guide/general/views.html
@@ -61,7 +61,7 @@ Views
In fact, views can flexibly be embedded within other views (within other views, etc., etc.) if you need this type
of hierarchy.
-
Views are never called directly, they must be loaded by a controller. Remember that in an MVC framework, the Controller acts as the
+
Views are never called directly, they must be loaded by a controller. Remember that in an MVC framework, the Controller acts as the
traffic cop, so it is responsible for fetching a particular view. If you have not read the Controllers page
you should do so before continuing.
@@ -90,7 +90,7 @@ you should do so before continuing.
$this->load->view('name');
-
Where name is the name of your view file. Note: The .php file extension does not need to be specified unless you use something other than .php.
+
Where name is the name of your view file. Note: The .php file extension does not need to be specified unless you use something other than .php.
Now, open the controller file you made earlier called blog.php, and replace the echo statement with the view loading function:
@@ -109,19 +109,19 @@ class Blog extends CI_Controller {
-
If you visit your site using the URL you did earlier you should see your new view. The URL was similar to this:
+
If you visit your site using the URL you did earlier you should see your new view. The URL was similar to this:
example.com/index.php/blog/
Loading multiple views
-
CodeIgniter will intelligently handle multiple calls to $this->load->view from within a controller. If more than one call happens they will be appended together. For example, you may wish to have a header view, a menu view, a content view, and a footer view. That might look something like this:
+
CodeIgniter will intelligently handle multiple calls to $this->load->view from within a controller. If more than one call happens they will be appended together. For example, you may wish to have a header view, a menu view, a content view, and a footer view. That might look something like this:
<?php
class Page extends CI_Controller {
function index()
{
- $data['page_title'] = 'Your title';
+ $data['page_title'] = 'Your title';
$this->load->view('header');
$this->load->view('menu');
$this->load->view('content', $data);
@@ -132,8 +132,8 @@ class Page extends CI_Controller {
?>
In the example above, we are using "dynamically added data", which you will see below.
Storing Views within Sub-folders
-
Your view files can also be stored within sub-folders if you prefer that type of organization. When doing so you will need
-to include the folder name loading the view. Example:
+
Your view files can also be stored within sub-folders if you prefer that type of organization. When doing so you will need
+to include the folder name loading the view. Example:
$this->load->view('folder_name/file_name');
@@ -159,7 +159,7 @@ $this->load->view('blogview',
$data);
Note: If you use an object, the class variables will be turned into array elements.
-
Let's try it with your controller file. Open it add this code:
+
Let's try it with your controller file. Open it add this code:
-
Note: You'll notice that in the example above we are using PHP's alternative syntax. If you
+
Note: You'll notice that in the example above we are using PHP's alternative syntax. If you
are not familiar with it you can read about it here.
Returning views as data
There is a third optional parameter lets you change the behavior of the function so that it returns data as a string
-rather than sending it to your browser. This can be useful if you want to process the data in some way. If you
-set the parameter to true (boolean) it will return data. The default behavior is false, which sends it
-to your browser. Remember to assign it to a variable if you want the data returned:
+rather than sending it to your browser. This can be useful if you want to process the data in some way. If you
+set the parameter to
true (boolean) it will return data. The default behavior is
false, which sends it
+to your browser. Remember to assign it to a variable if you want the data returned:
$string = $this->load->view('myfile', '', true);
diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html
index a19621453..88e8384d5 100644
--- a/user_guide/helpers/array_helper.html
+++ b/user_guide/helpers/array_helper.html
@@ -70,8 +70,8 @@ Array Helper
element()
-
Lets you fetch an item from an array. The function tests whether the array index is set and whether it has a value. If
-a value exists it is returned. If a value does not exist it returns FALSE, or whatever you've specified as the default value via the third parameter. Example:
+
Lets you fetch an item from an array. The function tests whether the array index is set and whether it has a value. If
+a value exists it is returned. If a value does not exist it returns FALSE, or whatever you've specified as the default value via the third parameter. Example:
$array = array('color' => 'red', 'shape' => 'round', 'size' => '');
@@ -86,7 +86,7 @@ echo element('size', $array, NULL);
random_element()
-Takes an array as input and returns a random element from it. Usage example:
+Takes an array as input and returns a random element from it. Usage example:
$quotes = array(
"I find that the harder I work, the more luck I seem to have. - Thomas Jefferson",
@@ -102,8 +102,8 @@ echo random_element($quotes);
elements()
-Lets you fetch a number of items from an array. The function tests whether each of the array indices is set. If an index does not exist
-it is set to FALSE, or whatever you've specified as the default value via the third parameter. Example:
+Lets you fetch a number of items from an array. The function tests whether each of the array indices is set. If an index does not exist
+it is set to FALSE, or whatever you've specified as the default value via the third parameter. Example:
$array = array(
@@ -142,7 +142,7 @@ array(
);
-This is useful when sending the $_POST array to one of your Models. This prevents users from
+
This is useful when sending the $_POST array to one of your Models. This prevents users from
sending additional POST data to be entered into your tables:
diff --git a/user_guide/helpers/captcha_helper.html b/user_guide/helpers/captcha_helper.html
index 2fd5a5549..3c6fa1188 100644
--- a/user_guide/helpers/captcha_helper.html
+++ b/user_guide/helpers/captcha_helper.html
@@ -83,7 +83,7 @@ CAPTCHA Helper
<img src="http://example.com/captcha/12345.jpg" width="140" height="50" />
The "time" is the micro timestamp used as the image name without the file
- extension. It will be a number like this: 1139612155.3422
+ extension. It will be a number like this: 1139612155.3422
The "word" is the word that appears in the captcha image, which if not
supplied to the function, will be a random string.
@@ -109,13 +109,13 @@ echo $cap['image'];
The captcha function requires the GD image library.
Only the img_path and img_url are required.
If a "word" is not supplied, the function will generate a random
- ASCII string. You might put together your own word library that
+ ASCII string. You might put together your own word library that
you can draw randomly from.
If you do not specify a path to a TRUE TYPE font, the native ugly GD
font will be used.
The "captcha" folder must be writable (666, or 777)
The "expiration" (in seconds) signifies how long an image will
- remain in the captcha folder before it will be deleted. The default
+ remain in the captcha folder before it will be deleted. The default
is two hours.
@@ -137,7 +137,7 @@ echo $cap['image'];
KEY `word` (`word`)
);
-
Here is an example of usage with a database. On the page where the CAPTCHA will be shown you'll have something like this:
+
Here is an example of usage with a database. On the page where the CAPTCHA will be shown you'll have something like this:
$this->load->helper('captcha');
$vals = array(
diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html
index 34faadbcc..9879653c1 100644
--- a/user_guide/helpers/cookie_helper.html
+++ b/user_guide/helpers/cookie_helper.html
@@ -70,20 +70,20 @@ Cookie Helper
set_cookie()
-This helper function gives you view file friendly syntax to set browser cookies. Refer to the Input class for a description of use, as this function is an alias to $this->input->set_cookie().
+This helper function gives you view file friendly syntax to set browser cookies. Refer to the Input class for a description of use, as this function is an alias to $this->input->set_cookie().
get_cookie()
-This helper function gives you view file friendly syntax to get browser cookies. Refer to the Input class for a description of use, as this function is an alias to $this->input->cookie().
+This helper function gives you view file friendly syntax to get browser cookies. Refer to the Input class for a description of use, as this function is an alias to $this->input->cookie().
delete_cookie()
-Lets you delete a cookie. Unless you've set a custom path or other values, only the name of the cookie is needed:
+Lets you delete a cookie. Unless you've set a custom path or other values, only the name of the cookie is needed:
delete_cookie("name");
-This function is otherwise identical to set_cookie(), except that it does not have the value and expiration parameters. You can submit an array
+
This function is otherwise identical to set_cookie(), except that it does not have the value and expiration parameters. You can submit an array
of values in the first parameter or you can set discrete parameters.
delete_cookie($name, $domain, $path, $prefix)
diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html
index 44096ff46..a2933420c 100644
--- a/user_guide/helpers/date_helper.html
+++ b/user_guide/helpers/date_helper.html
@@ -72,7 +72,7 @@ Date Helper
now()
Returns the current time as a Unix timestamp, referenced either to your server's local time or GMT, based on the "time reference"
-setting in your config file. If you do not intend to set your master time reference to GMT (which you'll typically do if you
+setting in your config file. If you do not intend to set your master time reference to GMT (which you'll typically do if you
run a site that lets each user set their own timezone settings) there is no benefit to using this function over PHP's time() function.
@@ -82,10 +82,10 @@ run a site that lets each user set their own timezone settings) there is no bene
mdate()
This function is identical to PHPs date() function, except that it lets you
-use MySQL style date codes, where each code letter is preceded with a percent sign: %Y %m %d etc.
+use MySQL style date codes, where each code letter is preceded with a percent sign: %Y %m %d etc.
The benefit of doing dates this way is that you don't have to worry about escaping any characters that
-are not date codes, as you would normally have to do with the date() function. Example:
+are not date codes, as you would normally have to do with the date() function. Example:
$datestring = "Year: %Y Month: %m Day: %d - %h:%i %a";
$time = time();
@@ -149,7 +149,7 @@ echo standard_date($format, $time);
DATE_RFC1123 |
RFC 1123 |
- Sun, 14 Aug 2005 16:13:03 UTC |
+ Sun, 14 Aug 2005 16:13:03 UTC |
DATE_RFC2822 |
@@ -170,7 +170,7 @@ echo standard_date($format, $time);
local_to_gmt()
-Takes a Unix timestamp as input and returns it as GMT. Example:
+Takes a Unix timestamp as input and returns it as GMT. Example:
$now = time();
@@ -180,11 +180,11 @@ $gmt = local_to_gmt($now);
gmt_to_local()
Takes a Unix timestamp (referenced to GMT) as input, and converts it to a localized timestamp based on the
-timezone and Daylight Saving time submitted. Example:
+timezone and Daylight Saving time submitted. Example:
$timestamp = '1140153693';
-$timezone = 'UM8';
+$timezone = 'UM8';
$daylight_saving = TRUE;
echo gmt_to_local($timestamp, $timezone, $daylight_saving);
@@ -208,7 +208,7 @@ $unix = mysql_to_unix($mysql);
This can be useful if you need to display a date in a form field for submission.
-The time can be formatted with or without seconds, and it can be set to European or US format. If only
+
The time can be formatted with or without seconds, and it can be set to European or US format. If only
the timestamp is submitted it will return the time without seconds formatted for the U.S. Examples:
$now = time();
@@ -222,9 +222,9 @@ echo unix_to_human($now, TRUE, 'eu'); // Euro time with seconds
human_to_unix()
-The opposite of the above function. Takes a "human" time as input and returns it as Unix. This function is
-useful if you accept "human" formatted dates submitted via a form. Returns FALSE (boolean) if
-the date string passed to it is not formatted as indicated above. Example:
+The opposite of the above function. Takes a "human" time as input and returns it as Unix. This function is
+useful if you accept "human" formatted dates submitted via a form. Returns FALSE (boolean) if
+the date string passed to it is not formatted as indicated above. Example:
$now = time();
@@ -242,9 +242,9 @@ $unix = human_to_unix($human);
1 Year, 10 Months, 2 Weeks, 5 Days, 10 Hours, 16 Minutes
-The first parameter must contain a Unix timestamp. The second parameter must contain a
-timestamp that is greater that the first timestamp. If the second parameter empty, the current time will be used. The most common purpose
-for this function is to show how much time has elapsed from some point in time in the past to now. Example:
+The first parameter must contain a Unix timestamp. The second parameter must contain a
+timestamp that is greater that the first timestamp. If the second parameter empty, the current time will be used. The most common purpose
+for this function is to show how much time has elapsed from some point in time in the past to now. Example:
$post_date = '1079621429';
$now = time();
@@ -256,7 +256,7 @@ echo timespan($post_date, $now);
days_in_month()
-Returns the number of days in a given month/year. Takes leap years into account. Example:
+Returns the number of days in a given month/year. Takes leap years into account. Example:
echo days_in_month(06, 2005);
If the second parameter is empty, the current year will be used.
@@ -304,7 +304,7 @@ echo timespan($post_date, $now);
This menu is useful if you run a membership site in which your users are allowed to set their local timezone value.
-The first parameter lets you set the "selected" state of the menu. For example, to set Pacific time as the default you will do this:
+The first parameter lets you set the "selected" state of the menu. For example, to set Pacific time as the default you will do this:
echo timezone_menu('UM8');
diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html
index 1a2f28d7d..2086fe1f3 100644
--- a/user_guide/helpers/directory_helper.html
+++ b/user_guide/helpers/directory_helper.html
@@ -78,12 +78,12 @@ and builds an array representation of it and all its contained files. Example:
Note: Paths are almost always relative to your main index.php file.
-Sub-folders contained within the directory will be mapped as well. If you wish to control the recursion depth,
+
Sub-folders contained within the directory will be mapped as well. If you wish to control the recursion depth,
you can do so using the second parameter (integer). A depth of 1 will only map the top level directory:
$map = directory_map('./mydirectory/', 1);
-By default, hidden files will not be included in the returned array. To override this behavior,
+
By default, hidden files will not be included in the returned array. To override this behavior,
you may set a third parameter to true (boolean):
$map = directory_map('./mydirectory/', FALSE, TRUE);
diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html
index c37235424..2d06fa25b 100644
--- a/user_guide/helpers/file_helper.html
+++ b/user_guide/helpers/file_helper.html
@@ -69,11 +69,11 @@ File Helper
read_file('path')
-Returns the data contained in the file specified in the path. Example:
+Returns the data contained in the file specified in the path. Example:
$string = read_file('./path/to/file.php');
-The path can be a relative or full server path. Returns FALSE (boolean) on failure.
+The path can be a relative or full server path. Returns FALSE (boolean) on failure.
Note: The path is relative to your main site index.php file, NOT your controller or view files.
CodeIgniter uses a front controller so paths are always relative to the main site index.
@@ -83,7 +83,7 @@ might not work if you are trying to access a file above the calling script.
write_file('path', $data)
-Writes data to the file specified in the path. If the file does not exist the function will create it. Example:
+Writes data to the file specified in the path. If the file does not exist the function will create it. Example:
$data = 'Some file data';
@@ -101,7 +101,7 @@ else
write_file('./path/to/file.php', $data, 'r+');
-The default mode is wb. Please see the PHP user guide for mode options.
+The default mode is wb. Please see the PHP user guide for mode options.
Note: In order for this function to write data to a file its file permissions must be set such that it is writable (666, 777, etc.).
If the file does not already exist, the directory containing it must be writable.
@@ -111,7 +111,7 @@ CodeIgniter uses a front controller so paths are always relative to the main sit
delete_files('path')
-Deletes ALL files contained in the supplied path. Example:
+Deletes ALL files contained in the supplied path. Example:
delete_files('./path/to/directory/');
If the second parameter is set to true, any directories contained within the supplied root path will be deleted as well. Example:
@@ -127,12 +127,12 @@ can optionally be added to the file names by setting the second parameter to TRU
get_dir_file_info('path/to/directory/', $top_level_only = TRUE)
-Reads the specified directory and builds an array containing the filenames, filesize, dates, and permissions. Sub-folders contained within the specified path are only read if forced
+
Reads the specified directory and builds an array containing the filenames, filesize, dates, and permissions. Sub-folders contained within the specified path are only read if forced
by sending the second parameter, $top_level_only to FALSE, as this can be an intensive operation.
get_file_info('path/to/file', $file_information)
-Given a file and path, returns the name, path, size, date modified. Second parameter allows you to explicitly declare what information you want returned; options are: name, server_path, size, date, readable, writable, executable, fileperms. Returns FALSE if the file cannot be found.
+Given a file and path, returns the name, path, size, date modified. Second parameter allows you to explicitly declare what information you want returned; options are: name, server_path, size, date, readable, writable, executable, fileperms. Returns FALSE if the file cannot be found.
Note: The "writable" uses the PHP function is_writable() which is known to have issues on the IIS webserver. Consider using fileperms instead, which returns information from PHP's fileperms() function.
get_mime_by_extension('file')
@@ -142,7 +142,7 @@ can optionally be added to the file names by setting the second parameter to TRU
$file = "somefile.png";
echo $file . ' is has a mime type of ' . get_mime_by_extension($file);
-Note: This is not an accurate way of determining file mime types, and is here strictly as a convenience. It should not be used for security.
+Note: This is not an accurate way of determining file mime types, and is here strictly as a convenience. It should not be used for security.
symbolic_permissions($perms)
diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html
index 87e3c28b0..b4a5730f2 100644
--- a/user_guide/helpers/form_helper.html
+++ b/user_guide/helpers/form_helper.html
@@ -72,7 +72,7 @@ Form Helper
form_open()
-Creates an opening form tag with a base URL built from your config preferences. It will optionally let you
+
Creates an opening form tag with a base URL built from your config preferences. It will optionally let you
add form attributes and hidden input fields, and will always add the attribute accept-charset based on the charset value in your config file.
The main benefit of using this tag rather than hard coding your own HTML is that it permits your site to be more portable
@@ -122,7 +122,7 @@ which is necessary if you would like to use the form to upload files with.
form_hidden()
-Lets you generate hidden input fields. You can either submit a name/value string to create one field:
+Lets you generate hidden input fields. You can either submit a name/value string to create one field:
form_hidden('username', 'johndoe');
@@ -149,7 +149,7 @@ echo form_hidden($data);
form_input()
-Lets you generate a standard text input field. You can minimally pass the field name and value in the first
+
Lets you generate a standard text input field. You can minimally pass the field name and value in the first
and second parameter:
echo form_input('username', 'johndoe');
@@ -196,9 +196,9 @@ example, you will instead specify "rows" and "cols".
form_dropdown()
-Lets you create a standard drop-down field. The first parameter will contain the name of the field,
+
Lets you create a standard drop-down field. The first parameter will contain the name of the field,
the second parameter will contain an associative array of options, and the third parameter will contain the
-value you wish to be selected. You can also pass an array of multiple items through the third parameter, and CodeIgniter will create a multiple select for you. Example:
+value you wish to be selected. You can also pass an array of multiple items through the third parameter, and CodeIgniter will create a multiple select for you. Example:
$options = array(
'small' => 'Small Shirt',
@@ -215,7 +215,7 @@ echo form_dropdown('shirts', $options, 'large');
<select name="shirts">
<option value="small">Small Shirt</option>
-<option value="med">Medium Shirt</option>
+<option value="med">Medium Shirt</option>
<option value="large" selected="selected">Large Shirt</option>
<option value="xlarge">Extra Large Shirt</option>
</select>
@@ -226,7 +226,7 @@ echo form_dropdown('shirts', $options, $shirts_on_sale);
<select name="shirts" multiple="multiple">
<option value="small" selected="selected">Small Shirt</option>
-<option value="med">Medium Shirt</option>
+<option value="med">Medium Shirt</option>
<option value="large" selected="selected">Large Shirt</option>
<option value="xlarge">Extra Large Shirt</option>
</select>
@@ -243,9 +243,9 @@ echo form_dropdown('shirts', $options, 'large', $js);
form_multiselect()
-Lets you create a standard multiselect field. The first parameter will contain the name of the field,
+
Lets you create a standard multiselect field. The first parameter will contain the name of the field,
the second parameter will contain an associative array of options, and the third parameter will contain the
-value or values you wish to be selected. The parameter usage is identical to using form_dropdown() above,
+value or values you wish to be selected. The parameter usage is identical to using form_dropdown() above,
except of course that the name of the field will need to use POST array syntax, e.g. foo[].
@@ -267,7 +267,7 @@ echo form_fieldset_close();
</fieldset>
Similar to other functions, you can submit an associative array in the second parameter if you prefer to set additional attributes.
$attributes = array('id' => 'address_info', 'class' => 'address_info');
- echo form_fieldset('Address Information', $attributes);
+ echo form_fieldset('Address Information', $attributes);
echo "<p>fieldset content here</p>\n";
echo form_fieldset_close();
@@ -277,8 +277,8 @@ echo form_fieldset_close();
<p>form content here</p>
</fieldset>
form_fieldset_close()
-Produces a closing </fieldset> tag. The only advantage to using this function is it permits you to pass data to it
- which will be added below the tag. For example:
+Produces a closing </fieldset> tag. The only advantage to using this function is it permits you to pass data to it
+ which will be added below the tag. For example:
$string = "</div></div>";
echo form_fieldset_close($string);
@@ -309,7 +309,7 @@ echo form_checkbox($data);
// Would produce:
<input type="checkbox" name="newsletter" id="newsletter" value="accept" checked="checked" style="margin:10px" />
-As with other functions, if you would like the tag to contain additional data, like JavaScript, you can pass it as a string in the
+
As with other functions, if you would like the tag to contain additional data, like JavaScript, you can pass it as a string in the
fourth parameter:
$js = 'onClick="some_function()"';
@@ -330,7 +330,7 @@ fourth parameter:
<input type="submit" name="mysubmit" value="Submit Post!" />
Similar to other functions, you can submit an associative array in the first parameter if you prefer to set your own attributes.
- The third parameter lets you add extra data to your form, like JavaScript.
+ The third parameter lets you add extra data to your form, like JavaScript.
form_label()
Lets you generate a <label>. Simple example:
echo form_label('What is your Name', 'username');
@@ -338,13 +338,13 @@ fourth parameter:
// Would produce:
<label for="username">What is your Name</label>
-Similar to other functions, you can submit an associative array in the third parameter if you prefer to set additional attributes.
+Similar to other functions, you can submit an associative array in the third parameter if you prefer to set additional attributes.
$attributes = array(
'class' => 'mycustomclass',
'style' => 'color: #000;',
);
- echo form_label('What is your Name', 'username', $attributes);
-
+ echo form_label('What is your Name', 'username', $attributes);
+
// Would produce:
<label for="username" class="mycustomclass" style="color: #000;">What is your Name</label>
form_reset()
@@ -386,8 +386,8 @@ echo form_button('mybutton', 'Click Me', $js);
form_close()
-Produces a closing </form> tag. The only advantage to using this function is it permits you to pass data to it
-which will be added below the tag. For example:
+Produces a closing </form> tag. The only advantage to using this function is it permits you to pass data to it
+which will be added below the tag. For example:
$string = "</div></div>";
@@ -404,7 +404,7 @@ echo form_close($string);
form_prep()
-Allows you to safely use HTML and characters such as quotes within form elements without breaking out of the form. Consider this example:
+Allows you to safely use HTML and characters such as quotes within form elements without breaking out of the form. Consider this example:
$string = 'Here is a string containing "quoted" text.';
@@ -431,7 +431,7 @@ The second (optional) parameter allows you to set a default value for the form.
set_select()
-If you use a <select> menu, this function permits you to display the menu item that was selected. The first parameter
+
If you use a <select> menu, this function permits you to display the menu item that was selected. The first parameter
must contain the name of the select menu, the second parameter must contain the value of
each item, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE).
@@ -439,16 +439,16 @@ each item, and the third (optional) parameter lets you set an item as the defaul
<select name="myselect">
-<option value="one" <?php echo set_select('myselect', 'one', TRUE); ?> >One</option>
-<option value="two" <?php echo set_select('myselect', 'two'); ?> >Two</option>
-<option value="three" <?php echo set_select('myselect', 'three'); ?> >Three</option>
+<option value="one" <?php echo set_select('myselect', 'one', TRUE); ?> >One</option>
+<option value="two" <?php echo set_select('myselect', 'two'); ?> >Two</option>
+<option value="three" <?php echo set_select('myselect', 'three'); ?> >Three</option>
</select>
set_checkbox()
-Permits you to display a checkbox in the state it was submitted. The first parameter
+
Permits you to display a checkbox in the state it was submitted. The first parameter
must contain the name of the checkbox, the second parameter must contain its value, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE). Example:
<input type="checkbox" name="mycheck" value="1" <?php echo set_checkbox('mycheck', '1'); ?> />
@@ -459,8 +459,8 @@ must contain the name of the checkbox, the second parameter must contain its val
Permits you to display radio buttons in the state they were submitted. This function is identical to the set_checkbox() function above.
-<input type="radio" name="myradio" value="1" <?php echo set_radio('myradio', '1', TRUE); ?> />
-<input type="radio" name="myradio" value="2" <?php echo set_radio('myradio', '2'); ?> />
+<input type="radio" name="myradio" value="1" <?php echo set_radio('myradio', '1', TRUE); ?> />
+<input type="radio" name="myradio" value="2" <?php echo set_radio('myradio', '2'); ?> />
diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html
index 308013d51..665081fb6 100644
--- a/user_guide/helpers/html_helper.html
+++ b/user_guide/helpers/html_helper.html
@@ -84,10 +84,10 @@ HTML Helper
The above would produce: <br /><br /><br />
heading()
-Lets you create HTML <h1> tags. The first parameter will contain the data, the
-second the size of the heading. Example:
+Lets you create HTML <h1> tags. The first parameter will contain the data, the
+second the size of the heading. Example:
echo heading('Welcome!', 3);
-The above would produce: <h3>Welcome!</h3>
+The above would produce: <h3>Welcome!</h3>
Additionally, in order to add attributes to the heading tag such as HTML classes, ids or inline styles, a third parameter is available.
echo heading('Welcome!', 3, 'class="pink"')
@@ -95,7 +95,7 @@ second the size of the heading. Example:
img()
-Lets you create HTML <img /> tags. The first parameter contains the image source. Example:
+Lets you create HTML <img /> tags. The first parameter contains the image source. Example:
echo img('images/picture.jpg');
// gives <img src="http://site.com/images/picture.jpg" />
There is an optional second parameter that is a TRUE/FALSE value that specifics if the src should have the page specified by $config['index_page'] added to the address it creates. Presumably, this would be if you were using a media controller.
@@ -116,7 +116,7 @@ second the size of the heading. Example:
// <img src="http://site.com/index.php/images/picture.jpg" alt="Me, demonstrating how to eat 4 slices of pizza at one time" class="post_images" width="200" height="200" title="That was quite a night" rel="lightbox" />
link_tag()
-Lets you create HTML <link /> tags. This is useful for stylesheet links, as well as other links. The parameters are href, with optional rel, type, title, media and index_page. index_page is a TRUE/FALSE value that specifics if the href should have the page specified by $config['index_page'] added to the address it creates.
+Lets you create HTML <link /> tags. This is useful for stylesheet links, as well as other links. The parameters are href, with optional rel, type, title, media and index_page. index_page is a TRUE/FALSE value that specifics if the href should have the page specified by $config['index_page'] added to the address it creates.
echo link_tag('css/mystyles.css');
// gives <link href="http://site.com/css/mystyles.css" rel="stylesheet" type="text/css" />
Further examples:
@@ -271,20 +271,20 @@ echo ul($list, $attributes);
meta()
-Helps you generate meta tags. You can pass strings to the function, or simple arrays, or multidimensional ones. Examples:
+Helps you generate meta tags. You can pass strings to the function, or simple arrays, or multidimensional ones. Examples:
echo meta('description', 'My Great site');
-// Generates: <meta name="description" content="My Great Site" />
+// Generates: <meta name="description" content="My Great Site" />
-echo meta('Content-type', 'text/html; charset=utf-8', 'equiv'); // Note the third parameter. Can be "equiv" or "name"
-// Generates: <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+echo meta('Content-type', 'text/html; charset=utf-8', 'equiv'); // Note the third parameter. Can be "equiv" or "name"
+// Generates: <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
echo meta(array('name' => 'robots', 'content' => 'no-cache'));
-// Generates: <meta name="robots" content="no-cache" />
+// Generates: <meta name="robots" content="no-cache" />
@@ -298,7 +298,7 @@ $meta = array(
echo meta($meta);
-// Generates:
+// Generates:
// <meta name="robots" content="no-cache" />
// <meta name="description" content="My Great Site" />
// <meta name="keywords" content="love, passion, intrigue, deception" />
@@ -319,7 +319,7 @@ echo doctype('html4-trans');
// <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-The following is a list of doctype choices. These are configurable, and pulled from application/config/doctypes.php
+The following is a list of doctype choices. These are configurable, and pulled from application/config/doctypes.php
diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html
index 221c05907..087675454 100644
--- a/user_guide/helpers/inflector_helper.html
+++ b/user_guide/helpers/inflector_helper.html
@@ -71,7 +71,7 @@ Inflector Helper
singular()
-Changes a plural word to singular. Example:
+Changes a plural word to singular. Example:
$word = "dogs";
@@ -81,7 +81,7 @@ echo singular($word); // Returns "dog"
plural()
-Changes a singular word to plural. Example:
+Changes a singular word to plural. Example:
$word = "dog";
@@ -94,7 +94,7 @@ echo plural($word); // Returns "dogs"
echo plural($word, TRUE); // Returns "passes"
camelize()
-Changes a string of words separated by spaces or underscores to camel case. Example:
+Changes a string of words separated by spaces or underscores to camel case. Example:
$word = "my_dog_spot";
@@ -104,7 +104,7 @@ echo camelize($word); // Returns "myDogSpot"
underscore()
-Takes multiple words separated by spaces and underscores them. Example:
+Takes multiple words separated by spaces and underscores them. Example:
$word = "my dog spot";
@@ -114,7 +114,7 @@ echo underscore($word); // Returns "my_dog_spot"
humanize()
-Takes multiple words separated by underscores and adds spaces between them. Each word is capitalized. Example:
+Takes multiple words separated by underscores and adds spaces between them. Each word is capitalized. Example:
$word = "my_dog_spot";
diff --git a/user_guide/helpers/language_helper.html b/user_guide/helpers/language_helper.html
index 3b3b87da9..e10733baf 100644
--- a/user_guide/helpers/language_helper.html
+++ b/user_guide/helpers/language_helper.html
@@ -73,7 +73,7 @@ Language Helper
This function returns a line of text from a loaded language file with simplified syntax
that may be more desirable for view files than calling $this->lang->line().
- The optional second parameter will also output a form label for you. Example:
+ The optional second parameter will also output a form label for you. Example:
echo lang('language_key', 'form_item_id');
// becomes <label for="form_item_id">language_key</label>
diff --git a/user_guide/helpers/number_helper.html b/user_guide/helpers/number_helper.html
index 51a4521a6..a04f37c86 100644
--- a/user_guide/helpers/number_helper.html
+++ b/user_guide/helpers/number_helper.html
@@ -71,7 +71,7 @@ Number Helper
byte_format()
-Formats a numbers as bytes, based on size, and adds the appropriate suffix. Examples:
+Formats a numbers as bytes, based on size, and adds the appropriate suffix. Examples:
echo byte_format(456); // Returns 456 Bytes
diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html
index e0cace325..49e0365d1 100644
--- a/user_guide/helpers/security_helper.html
+++ b/user_guide/helpers/security_helper.html
@@ -71,19 +71,19 @@ Security Helper
xss_clean()
-Provides Cross Site Script Hack filtering. This function is an alias to the one in the
-Input class. More info can be found there.
+Provides Cross Site Script Hack filtering. This function is an alias to the one in the
+Input class. More info can be found there.
sanitize_filename()
-Provides protection against directory traversal. This function is an alias to the one in the
-Security class. More info can be found there.
+Provides protection against directory traversal. This function is an alias to the one in the
+Security class. More info can be found there.
do_hash()
-Permits you to create SHA1 or MD5 one way hashes suitable for encrypting passwords. Will create SHA1 by default. Examples:
+Permits you to create SHA1 or MD5 one way hashes suitable for encrypting passwords. Will create SHA1 by default. Examples:
$str = do_hash($str); // SHA1
@@ -91,13 +91,13 @@ $str = do_hash($str); // SHA1
$str = do_hash($str, 'md5'); // MD5
-Note: This function was formerly named dohash(), which has been deprecated in favour of do_hash().
+Note: This function was formerly named dohash(), which has been deprecated in favour of do_hash().
strip_image_tags()
-This is a security function that will strip image tags from a string. It leaves the image URL as plain text.
+This is a security function that will strip image tags from a string. It leaves the image URL as plain text.
$string = strip_image_tags($string);
diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html
index 408df17c9..4668f106e 100644
--- a/user_guide/helpers/smiley_helper.html
+++ b/user_guide/helpers/smiley_helper.html
@@ -83,7 +83,7 @@ Your users can click a desired smiley and with the help of some JavaScript it wi
requires that you first download and install the smiley images, then create a controller and the View as described.
Important: Before you begin, please download the smiley images and put them in
-a publicly accessible place on your server. This helper also assumes you have the smiley replacement array located at
+a publicly accessible place on your server. This helper also assumes you have the smiley replacement array located at
application/config/smileys.php
@@ -166,7 +166,7 @@ you can give your smiley links a generic name that will be tied to a specific id
get_clickable_smileys()
-Returns an array containing your smiley images wrapped in a clickable link. You must supply the URL to your smiley folder
+
Returns an array containing your smiley images wrapped in a clickable link. You must supply the URL to your smiley folder
and a field id or field alias.
$image_array = get_smiley_links("http://example.com/images/smileys/", "comment");
@@ -187,10 +187,10 @@ This function is designed to be placed into the <head> area of your web pa
parse_smileys()
Takes a string of text as input and replaces any contained plain text smileys into the image
-equivalent. The first parameter must contain your string, the second must contain the URL to your smiley folder:
+equivalent. The first parameter must contain your string, the second must contain the URL to your smiley folder:
-$str = 'Here are some simileys: :-) ;-)';
+$str = 'Here are some simileys: :-) ;-)';
$str = parse_smileys($str, "http://example.com/images/smileys/");
diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html
index 169ee4ebb..6fc2cf5f7 100644
--- a/user_guide/helpers/string_helper.html
+++ b/user_guide/helpers/string_helper.html
@@ -70,9 +70,9 @@ String Helper
random_string()
-Generates a random string based on the type and length you specify. Useful for creating passwords or generating random hashes.
+Generates a random string based on the type and length you specify. Useful for creating passwords or generating random hashes.
-The first parameter specifies the type of string, the second parameter specifies the length. The following choices are available:
+The first parameter specifies the type of string, the second parameter specifies the length. The following choices are available:
alpha, alunum, numeric, nozero, unique, md5, encrypt and sha1
@@ -92,7 +92,7 @@ String Helper
alternator()
-Allows two or more items to be alternated between, when cycling through a loop. Example:
+Allows two or more items to be alternated between, when cycling through a loop. Example:
for ($i = 0; $i < 10; $i++)
{
diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html
index f71d87840..3c83f3d42 100644
--- a/user_guide/helpers/text_helper.html
+++ b/user_guide/helpers/text_helper.html
@@ -71,22 +71,22 @@ Text Helper
word_limiter()
-Truncates a string to the number of words specified. Example:
+Truncates a string to the number of words specified. Example:
$string = "Here is a nice text string consisting of eleven words.";
$string = word_limiter($string, 4);
-// Returns: Here is a nice…
+// Returns: Here is a nice…
-The third parameter is an optional suffix added to the string. By default it adds an ellipsis.
+The third parameter is an optional suffix added to the string. By default it adds an ellipsis.
character_limiter()
-Truncates a string to the number of characters specified. It maintains the integrity
+
Truncates a string to the number of characters specified. It maintains the integrity
of words so the character count may be slightly more or less then what you specify. Example:
@@ -94,7 +94,7 @@ $string = "Here is a nice text string consisting of eleven words.";
$string = character_limiter($string, 20);
-// Returns: Here is a nice text string…
+// Returns: Here is a nice text string…
The third parameter is an optional suffix added to the string, if undeclared this helper uses an ellipsis.
@@ -125,9 +125,9 @@ part it should correctly identify characters outside the normal range (like acce
word_censor()
-Enables you to censor words within a text string. The first parameter will contain the original string. The
-second will contain an array of words which you disallow. The third (optional) parameter can contain a replacement value
-for the words. If not specified they are replaced with pound signs: ####. Example:
+Enables you to censor words within a text string. The first parameter will contain the original string. The
+second will contain an array of words which you disallow. The third (optional) parameter can contain a replacement value
+for the words. If not specified they are replaced with pound signs: ####. Example:
$disallowed = array('darn', 'shucks', 'golly', 'phooey');
@@ -137,7 +137,7 @@ $string = word_censor($string, $disallowed, 'Beep!');
highlight_code()
-Colorizes a string of code (PHP, HTML, etc.). Example:
+Colorizes a string of code (PHP, HTML, etc.). Example:
$string = highlight_code($string);
@@ -146,9 +146,9 @@ $string = word_censor($string, $disallowed, 'Beep!');
highlight_phrase()
-Will highlight a phrase within a text string. The first parameter will contain the original string, the second will
-contain the phrase you wish to highlight. The third and fourth parameters will contain the opening/closing HTML tags
-you would like the phrase wrapped in. Example:
+Will highlight a phrase within a text string. The first parameter will contain the original string, the second will
+contain the phrase you wish to highlight. The third and fourth parameters will contain the opening/closing HTML tags
+you would like the phrase wrapped in. Example:
$string = "Here is a nice text string about nothing in particular.";
@@ -164,7 +164,7 @@ $string = highlight_phrase($string, "nice text", '<span style="color:#990000"
word_wrap()
-Wraps text at the specified character count while maintaining complete words. Example:
+Wraps text at the specified character count while maintaining complete words. Example:
$string = "Here is a simple string of text that will help us demonstrate this function.";
@@ -180,8 +180,8 @@ function
ellipsize()
This function will strip tags from a string, split it at a defined maximum length, and insert an ellipsis.
-The first parameter is the string to ellipsize, the second is the number of characters in the final string. The third parameter is where in the string the ellipsis should appear from 0 - 1, left to right. For example. a value of 1 will place the ellipsis at the right of the string, .5 in the middle, and 0 at the left.
-An optional forth parameter is the kind of ellipsis. By default, … will be inserted.
+The first parameter is the string to ellipsize, the second is the number of characters in the final string. The third parameter is where in the string the ellipsis should appear from 0 - 1, left to right. For example. a value of 1 will place the ellipsis at the right of the string, .5 in the middle, and 0 at the left.
+An optional forth parameter is the kind of ellipsis. By default, … will be inserted.
$str = 'this_string_is_entirely_too_long_and_might_break_my_design.jpg';
diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html
index 00686a340..e75528fbb 100644
--- a/user_guide/helpers/typography_helper.html
+++ b/user_guide/helpers/typography_helper.html
@@ -71,7 +71,7 @@ Typography Helper
auto_typography()
-Formats text so that it is semantically and typographically correct HTML. Please see the Typography Class for more info.
+Formats text so that it is semantically and typographically correct HTML. Please see the Typography Class for more info.
Usage example:
diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html
index d20f1b1e2..0bcf1e7ae 100644
--- a/user_guide/helpers/url_helper.html
+++ b/user_guide/helpers/url_helper.html
@@ -69,13 +69,13 @@ URL Helper
site_url()
-Returns your site URL, as specified in your config file. The index.php file (or whatever you have set as your
+
Returns your site URL, as specified in your config file. The index.php file (or whatever you have set as your
site index_page in your config file) will be added to the URL, as will any URI segments you pass to the function.
You are encouraged to use this function any time you need to generate a local URL so that your pages become more portable
in the event your URL changes.
-Segments can be optionally passed to the function as a string or an array. Here is a string example:
+Segments can be optionally passed to the function as a string or an array. Here is a string example:
echo site_url("news/local/123");
@@ -90,7 +90,7 @@ echo site_url($segments);
base_url()
-Returns your site base URL, as specified in your config file. Example:
+Returns your site base URL, as specified in your config file. Example:
echo base_url();
@@ -99,7 +99,7 @@ echo site_url($segments);
uri_string()
-Returns the URI segments of any page that contains this function. For example, if your URL was this:
+Returns the URI segments of any page that contains this function. For example, if your URL was this:
http://some-site.com/blog/comments/123
The function would return:
@@ -107,7 +107,7 @@ echo site_url($segments);
index_page()
-Returns your site "index" page, as specified in your config file. Example:
+Returns your site "index" page, as specified in your config file. Example:
echo index_page();
@@ -122,15 +122,15 @@ echo site_url($segments);
anchor(uri segments, text, attributes)
-The first parameter can contain any segments you wish appended to the URL. As with the site_url() function above,
+
The first parameter can contain any segments you wish appended to the URL. As with the site_url() function above,
segments can be a string or an array.
-Note: If you are building links that are internal to your application do not include the base URL (http://...). This
+
Note: If you are building links that are internal to your application do not include the base URL (http://...). This
will be added automatically from the information specified in your config file. Include only the URI segments you wish appended to the URL.
-The second segment is the text you would like the link to say. If you leave it blank, the URL will be used.
+The second segment is the text you would like the link to say. If you leave it blank, the URL will be used.
-The third parameter can contain a list of attributes you would like added to the link. The attributes can be a simple string or an associative array.
+The third parameter can contain a list of attributes you would like added to the link. The attributes can be a simple string or an associative array.
Here are some examples:
@@ -148,7 +148,7 @@ will be added automatically from the information specified in your config file.
Nearly identical to the anchor() function except that it opens the URL in a new window.
You can specify JavaScript window attributes in the third parameter to control how the window is opened. If
-the third parameter is not set it will simply open a new window with your own browser settings. Here is an example
+the third parameter is not set it will simply open a new window with your own browser settings. Here is an example
with attributes:
@@ -173,7 +173,7 @@ If you want the function to use all of its defaults simply pass an empty array i
mailto()
-Creates a standard HTML email link. Usage example:
+Creates a standard HTML email link. Usage example:
echo mailto('me@my-site.com', 'Click Here to Contact Me');
@@ -188,12 +188,12 @@ written with JavaScript to help prevent the email address from being harvested b
auto_link()
-Automatically turns URLs and email addresses contained in a string into links. Example:
+Automatically turns URLs and email addresses contained in a string into links. Example:
$string = auto_link($string);
-The second parameter determines whether URLs and emails are converted or just one or the other. Default behavior is both
-if the parameter is not specified. Email links are encoded as safe_mailto() as shown above.
+The second parameter determines whether URLs and emails are converted or just one or the other. Default behavior is both
+if the parameter is not specified. Email links are encoded as safe_mailto() as shown above.
Converts only URLs:
$string = auto_link($string, 'url');
@@ -201,42 +201,42 @@ if the parameter is not specified. Email links are encoded as safe_mailto() as
Converts only Email addresses:
$string = auto_link($string, 'email');
-The third parameter determines whether links are shown in a new window. The value can be TRUE or FALSE (boolean):
+The third parameter determines whether links are shown in a new window. The value can be TRUE or FALSE (boolean):
$string = auto_link($string, 'both', TRUE);
url_title()
Takes a string as input and creates a human-friendly URL string. This is useful if, for example, you have a blog
-in which you'd like to use the title of your entries in the URL. Example:
+in which you'd like to use the title of your entries in the URL. Example:
$title = "What's wrong with CSS?";
$url_title = url_title($title);
-// Produces: Whats-wrong-with-CSS
+// Produces: Whats-wrong-with-CSS
-The second parameter determines the word delimiter. By default dashes are used. Options are: dash, or underscore:
+The second parameter determines the word delimiter. By default dashes are used. Options are: dash, or underscore:
$title = "What's wrong with CSS?";
$url_title = url_title($title, 'underscore');
-// Produces: Whats_wrong_with_CSS
+// Produces: Whats_wrong_with_CSS
-The third parameter determines whether or not lowercase characters are forced. By default they are not. Options are boolean TRUE/FALSE:
+The third parameter determines whether or not lowercase characters are forced. By default they are not. Options are boolean TRUE/FALSE:
$title = "What's wrong with CSS?";
$url_title = url_title($title, 'underscore', TRUE);
-// Produces: whats_wrong_with_css
+// Produces: whats_wrong_with_css
prep_url()
-This function will add http:// in the event that a scheme is missing from a URL. Pass the URL string to the function like this:
+This function will add http:// in the event that a scheme is missing from a URL. Pass the URL string to the function like this:
$url = "example.com";
$url = prep_url($url);
@@ -250,7 +250,7 @@ $url = prep_url($url);
to the controller you want to direct to will create the link. The function will build the URL based on your config file values.
The optional second parameter allows you to choose between the "location"
-method (default) or the "refresh" method. Location is faster, but on Windows servers it can sometimes be a problem. The optional third parameter allows you to send a specific HTTP Response Code - this could be used for example to create 301 redirects for search engine purposes. The default Response Code is 302. The third parameter is only available with 'location' redirects, and not 'refresh'. Examples:
+method (default) or the "refresh" method. Location is faster, but on Windows servers it can sometimes be a problem. The optional third parameter allows you to send a specific HTTP Response Code - this could be used for example to create 301 redirects for search engine purposes. The default Response Code is 302. The third parameter is only available with 'location' redirects, and not 'refresh'. Examples:
if ($logged_in == FALSE)
{
@@ -262,7 +262,7 @@ redirect('/article/13', 'location', 301);
Note: In order for this function to work it must be used before anything is outputted
to the browser since it utilizes server headers.
-Note: For very fine grained control over headers, you should use the Output Library's set_header() function.
+Note: For very fine grained control over headers, you should use the Output Library's set_header() function.
diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html
index ded9aaa35..b3d408c7d 100644
--- a/user_guide/helpers/xml_helper.html
+++ b/user_guide/helpers/xml_helper.html
@@ -78,7 +78,7 @@ Less then and greater than characters: < >
Single and double quotes: ' "
Dashes: -
-This function ignores ampersands if they are part of existing character entities. Example:
+This function ignores ampersands if they are part of existing character entities. Example:
$string = xml_convert($string);
diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html
index 87da5189f..f62aadb5e 100644
--- a/user_guide/installation/index.html
+++ b/user_guide/installation/index.html
@@ -61,24 +61,24 @@ Installation Instructions
- Unzip the package.
-- Upload the CodeIgniter folders and files to your server. Normally the index.php file will be at your root.
-- Open the application/config/config.php file with a text editor and set your base URL. If you intend to use encryption or sessions, set your encryption key.
+- Upload the CodeIgniter folders and files to your server. Normally the index.php file will be at your root.
+- Open the application/config/config.php file with a text editor and set your base URL. If you intend to use encryption or sessions, set your encryption key.
- If you intend to use a database, open the application/config/database.php file with a text editor and set your database settings.
If you wish to increase security by hiding the location of your CodeIgniter files you can rename the system and application folders
-to something more private. If you do rename them, you must open your main index.php file and set the $system_folder and $application_folder
+to something more private. If you do rename them, you must open your main index.php file and set the $system_folder and $application_folder
variables at the top of the file with the new name you've chosen.
-For the best security, both the system and any application folders should be placed above web root so that they are not directly accessible via a browser. By default, .htaccess files are included in each folder to help prevent direct access, but it is best to remove them from public access entirely in case the web server configuration changes or doesn't abide by the .htaccess.
+For the best security, both the system and any application folders should be placed above web root so that they are not directly accessible via a browser. By default, .htaccess files are included in each folder to help prevent direct access, but it is best to remove them from public access entirely in case the web server configuration changes or doesn't abide by the .htaccess.
After moving them, open your main index.php file and set the $system_folder and $application_folder variables, preferably with a full path, e.g. '/www/MyUser/system'.
- One additional measure to take in production environments is to disable
- PHP error reporting and any other development-only functionality. In CodeIgniter,
- this can be done by setting the ENVIRONMENT constant, which is
- more fully described on the security page.
+ One additional measure to take in production environments is to disable
+ PHP error reporting and any other development-only functionality. In CodeIgniter,
+ this can be done by setting the ENVIRONMENT constant, which is
+ more fully described on the security page.
That's it!
diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html
index 2a50b8dbf..f99fc0a32 100644
--- a/user_guide/installation/troubleshooting.html
+++ b/user_guide/installation/troubleshooting.html
@@ -61,8 +61,8 @@ Trouble Shooting
does not support the PATH_INFO variable needed to serve search-engine friendly URLs.
As a first step, open your application/config/config.php file and look for the URI Protocol
-information. It will recommend that you try a couple alternate settings. If it still doesn't work after you've tried this you'll need
-to force CodeIgniter to add a question mark to your URLs. To do this open your application/config/config.php file and change this:
+information. It will recommend that you try a couple alternate settings. If it still doesn't work after you've tried this you'll need
+to force CodeIgniter to add a question mark to your URLs. To do this open your application/config/config.php file and change this:
$config['index_page'] = "index.php";
diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html
index f7ffac74e..e6bb9480e 100644
--- a/user_guide/installation/upgrade_130.html
+++ b/user_guide/installation/upgrade_130.html
@@ -57,7 +57,7 @@ Upgrading from 1.2 to 1.3
Upgrading from 1.2 to 1.3
-Note: The instructions on this page assume you are running version 1.2. If you
+
Note: The instructions on this page assume you are running version 1.2. If you
have not upgraded to that version please do so first.
@@ -72,8 +72,8 @@ with a static one.
Note: If you have any custom developed files in these folders please make copies of them first.
-- application/models/ (new for 1.3)
-- codeigniter (new for 1.3)
+- application/models/ (new for 1.3)
+- codeigniter (new for 1.3)
- drivers
- helpers
- init
@@ -109,7 +109,7 @@ replace this folder:
Step 3: Update your index.php file
-Please open your main index.php file (located at your root). At the very bottom of the file, change this:
+Please open your main index.php file (located at your root). At the very bottom of the file, change this:
require_once BASEPATH.'libraries/Front_controller'.EXT;
diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html
index 7541a83ec..a7025f2a7 100644
--- a/user_guide/installation/upgrade_131.html
+++ b/user_guide/installation/upgrade_131.html
@@ -57,7 +57,7 @@ Upgrading from 1.3 to 1.3.1
Upgrading from 1.3 to 1.3.1
-Note: The instructions on this page assume you are running version 1.3. If you
+
Note: The instructions on this page assume you are running version 1.3. If you
have not upgraded to that version please do so first.
Before performing an update you should take your site offline by replacing the index.php file with a static one.
diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html
index 4fcbb46b9..3b71594dc 100644
--- a/user_guide/installation/upgrade_132.html
+++ b/user_guide/installation/upgrade_132.html
@@ -57,7 +57,7 @@ Upgrading from 1.3.1 to 1.3.2
Upgrading from 1.3.1 to 1.3.2
-Note: The instructions on this page assume you are running version 1.3.1. If you
+
Note: The instructions on this page assume you are running version 1.3.1. If you
have not upgraded to that version please do so first.
Before performing an update you should take your site offline by replacing the index.php file with a static one.
diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html
index c63465955..a81f67bf5 100644
--- a/user_guide/installation/upgrade_133.html
+++ b/user_guide/installation/upgrade_133.html
@@ -57,7 +57,7 @@ Upgrading from 1.3.2 to 1.3.3
Upgrading from 1.3.2 to 1.3.3
-Note: The instructions on this page assume you are running version 1.3.2. If you
+
Note: The instructions on this page assume you are running version 1.3.2. If you
have not upgraded to that version please do so first.
Before performing an update you should take your site offline by replacing the index.php file with a static one.
@@ -83,9 +83,9 @@ have not upgraded to that version please do so first.
If you are NOT using CodeIgniter's Models feature disregard this step.
-As of version 1.3.3, CodeIgniter does not connect automatically to your database when a model is loaded. This
-allows you greater flexibility in determining which databases you would like used with your models. If your application is not connecting
-to your database prior to a model being loaded you will have to update your code. There are several options for connecting,
+
As of version 1.3.3, CodeIgniter does not connect automatically to your database when a model is loaded. This
+allows you greater flexibility in determining which databases you would like used with your models. If your application is not connecting
+to your database prior to a model being loaded you will have to update your code. There are several options for connecting,
as described here.
diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html
index 2049628a6..234e2f5b3 100644
--- a/user_guide/installation/upgrade_140.html
+++ b/user_guide/installation/upgrade_140.html
@@ -57,7 +57,7 @@ Upgrading from 1.3.3 to 1.4.0
Upgrading from 1.3.3 to 1.4.0
-Note: The instructions on this page assume you are running version 1.3.3. If you
+
Note: The instructions on this page assume you are running version 1.3.3. If you
have not upgraded to that version please do so first.
Before performing an update you should take your site offline by replacing the index.php file with a static one.
@@ -95,7 +95,7 @@ have not upgraded to that version please do so first.
|--------------------------------------------------------------------------
|
| If you would like to use the "hooks" feature you must enable it by
-| setting this variable to TRUE (boolean). See the user guide for details.
+| setting this variable to TRUE (boolean). See the user guide for details.
|
*/
$config['enable_hooks'] = FALSE;
@@ -111,7 +111,7 @@ $config['enable_hooks'] = FALSE;
| get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
-| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
+| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
|
| Leave blank to allow all characters -- but only if you are insane.
|
diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html
index c19143c64..79e51e4ab 100644
--- a/user_guide/installation/upgrade_141.html
+++ b/user_guide/installation/upgrade_141.html
@@ -56,7 +56,7 @@ Upgrading from 1.4.0 to 1.4.1
Upgrading from 1.4.0 to 1.4.1
-Note: The instructions on this page assume you are running version 1.4.0. If you
+
Note: The instructions on this page assume you are running version 1.4.0. If you
have not upgraded to that version please do so first.
Before performing an update you should take your site offline by replacing the index.php file with a static one.
@@ -88,16 +88,16 @@ have not upgraded to that version please do so first.
| Output Compression
|--------------------------------------------------------------------------
|
-| Enables Gzip output compression for faster page loads. When enabled,
+| Enables Gzip output compression for faster page loads. When enabled,
| the output class will test whether your server supports Gzip.
| Even if it does, however, not all browsers support compression
| so enable only if you are reasonably sure your visitors can handle it.
|
-| VERY IMPORTANT: If you are getting a blank page when compression is enabled it
+| VERY IMPORTANT: If you are getting a blank page when compression is enabled it
| means you are prematurely outputting something to your browser. It could
-| even be a line of whitespace at the end of one of your scripts. For
+| even be a line of whitespace at the end of one of your scripts. For
| compression to work, nothing can be sent before the output buffer is called
-| by the output class. Do not "echo" any values with compression enabled.
+| by the output class. Do not "echo" any values with compression enabled.
|
*/
$config['compress_output'] = FALSE;
diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html
index 342d486df..9cd0089c0 100644
--- a/user_guide/installation/upgrade_150.html
+++ b/user_guide/installation/upgrade_150.html
@@ -57,7 +57,7 @@ Upgrading from 1.4.1 to 1.5.0
Upgrading from 1.4.1 to 1.5.0
-Note: The instructions on this page assume you are running version 1.4.1. If you
+
Note: The instructions on this page assume you are running version 1.4.1. If you
have not upgraded to that version please do so first.
Before performing an update you should take your site offline by replacing the index.php file with a static one.
@@ -105,7 +105,7 @@ $db['default']['cachedir'] = '';
|--------------------------------------------------------------------------
|
| This item allows you to set the filename/classname prefix when extending
-| native libraries. For more information please see the user guide:
+| native libraries. For more information please see the user guide:
|
| http://codeigniter.com/user_guide/general/core_classes.html
| http://codeigniter.com/user_guide/general/creating_libraries.html
@@ -120,7 +120,7 @@ $config['subclass_prefix'] = 'MY_';
|
| If your PHP installation does not have short tag support enabled CI
| can rewrite the tags on-the-fly, enabling you to utilize that syntax
-| in your view files. Options are TRUE or FALSE (boolean)
+| in your view files. Options are TRUE or FALSE (boolean)
|
*/
$config['rewrite_short_tags'] = FALSE;
@@ -136,7 +136,7 @@ $config['rewrite_short_tags'] = FALSE;
|--------------------------------------------------------------------------
|
| If you would like errors or debug messages logged set this variable to
-| TRUE (boolean). Note: You must set the file permissions on the "logs" folder
+| TRUE (boolean). Note: You must set the file permissions on the "logs" folder
| such that it is writable.
|
*/
diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html
index f601a252e..136e3090b 100644
--- a/user_guide/installation/upgrade_152.html
+++ b/user_guide/installation/upgrade_152.html
@@ -57,7 +57,7 @@ Upgrading from 1.5.0 to 1.5.2
Upgrading from 1.5.0 to 1.5.2
-Note: The instructions on this page assume you are running version 1.5.0 or 1.5.1. If you
+
Note: The instructions on this page assume you are running version 1.5.0 or 1.5.1. If you
have not upgraded to that version please do so first.
Before performing an update you should take your site offline by replacing the index.php file with a static one.
diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html
index d06f58ec9..2adeff379 100644
--- a/user_guide/installation/upgrade_160.html
+++ b/user_guide/installation/upgrade_160.html
@@ -84,16 +84,16 @@ Upgrading from 1.5.4 to 1.6.0
Add the following to application/config/autoload.php
/*
| -------------------------------------------------------------------
- | Auto-load Model files
+ | Auto-load Model files
| -------------------------------------------------------------------
| Prototype:
|
- | $autoload['model'] = array('my_model');
+ | $autoload['model'] = array('my_model');
|
*/
$autoload['model'] = array();
-Step 4: Add to your database.php
+Step 4: Add to your database.php
Make the following changes to your application/config/database.php file:
Add the following variable above the database configuration options, with $active_group
$active_record = TRUE;
diff --git a/user_guide/installation/upgrade_170.html b/user_guide/installation/upgrade_170.html
index 01597a416..6fd92f52a 100644
--- a/user_guide/installation/upgrade_170.html
+++ b/user_guide/installation/upgrade_170.html
@@ -88,14 +88,14 @@ Here is an example of what this column might look like for MySQL:
ALTER TABLE `ci_sessions` ADD `user_data` text NOT NULL
-You'll find more information regarding the new Session functionality in the Session class page.
+You'll find more information regarding the new Session functionality in the Session class page.
Step 3: Update your Validation Syntax
-This is an optional, but recommended step, for people currently using the Validation class. CI 1.7 introduces a new Form Validation class, which
-deprecates the old Validation library. We have left the old one in place so that existing applications that use it will not break, but you are encouraged to
-migrate to the new version as soon as possible. Please read the user guide carefully as the new library works a little differently, and has several new features.
+This is an optional, but recommended step, for people currently using the Validation class. CI 1.7 introduces a new Form Validation class, which
+deprecates the old Validation library. We have left the old one in place so that existing applications that use it will not break, but you are encouraged to
+migrate to the new version as soon as possible. Please read the user guide carefully as the new library works a little differently, and has several new features.
diff --git a/user_guide/installation/upgrade_200.html b/user_guide/installation/upgrade_200.html
index 0b24079ef..cd39d924d 100644
--- a/user_guide/installation/upgrade_200.html
+++ b/user_guide/installation/upgrade_200.html
@@ -69,8 +69,8 @@ Upgrading from 1.7.2 to 2.0.0
Step 2: Adjust get_dir_file_info() where necessary
-Version 2.0.0 brings a non-backwards compatible change to get_dir_file_info() in the File Helper. Non-backwards compatible changes are extremely rare
- in CodeIgniter, but this one we feel was warranted due to how easy it was to create serious server performance issues. If you need
+
Version 2.0.0 brings a non-backwards compatible change to get_dir_file_info() in the File Helper. Non-backwards compatible changes are extremely rare
+ in CodeIgniter, but this one we feel was warranted due to how easy it was to create serious server performance issues. If you need
recursiveness where you are using this helper function, change such instances, setting the second parameter, $top_level_only to FALSE:
get_dir_file_info('/path/to/directory', FALSE);
@@ -79,7 +79,7 @@ Upgrading from 1.7.2 to 2.0.0
Step 3: Convert your Plugins to Helpers
-2.0.0 gets rid of the "Plugin" system as their functionality was identical to Helpers, but non-extensible. You will need to rename your plugin files from filename_pi.php to filename_helper.php, move them to your helpers folder, and change all instances of:
+
2.0.0 gets rid of the "Plugin" system as their functionality was identical to Helpers, but non-extensible. You will need to rename your plugin files from filename_pi.php to filename_helper.php, move them to your helpers folder, and change all instances of:
$this->load->plugin('foo');
@@ -94,7 +94,7 @@ to
Note: If your application does not use the Encryption library, does not store Encrypted data permanently, or is on an environment that does not support Mcrypt, you may skip this step.
The Encryption library has had a number of improvements, some for encryption strength and some for performance, that has an unavoidable consequence of
- making it no longer possible to decode encrypted data produced by the original version of this library. To help with the transition, a new method has
+ making it no longer possible to decode encrypted data produced by the original version of this library. To help with the transition, a new method has
been added, encode_from_legacy() that will decode the data with the original algorithm and return a re-encoded string using the improved methods.
This will enable you to easily replace stale encrypted data with fresh in your applications, either on the fly or en masse.
@@ -104,7 +104,7 @@ to
The compatibility helper has been removed from the CodeIgniter core. All methods in it should be natively available in supported PHP versions.
Step 6: Update Class extension
-All core classes are now prefixed with CI_. Update Models and Controllers to extend CI_Model and CI_Controller, respectively.
+All core classes are now prefixed with CI_. Update Models and Controllers to extend CI_Model and CI_Controller, respectively.
Step 7: Update Parent Constructor calls
All native CodeIgniter classes now use the PHP 5 __construct() convention. Please update extended libraries to call parent::__construct().
diff --git a/user_guide/installation/upgrade_202.html b/user_guide/installation/upgrade_202.html
index d457d8bbb..93c537227 100644
--- a/user_guide/installation/upgrade_202.html
+++ b/user_guide/installation/upgrade_202.html
@@ -76,7 +76,7 @@ Upgrading from 2.0.1 to 2.0.2
If you are overriding or extending the Security library, you will need to move it to application/core.
-csrf_token_name and csrf_hash have changed to protected class properties. Please use security->get_csrf_hash() and security->get_csrf_token_name() to access those values.
+csrf_token_name and csrf_hash have changed to protected class properties. Please use security->get_csrf_hash() and security->get_csrf_token_name() to access those values.
diff --git a/user_guide/installation/upgrade_203.html b/user_guide/installation/upgrade_203.html
index 7dbc907ea..d1c9a940f 100644
--- a/user_guide/installation/upgrade_203.html
+++ b/user_guide/installation/upgrade_203.html
@@ -69,7 +69,7 @@ Upgrading from 2.0.2 to 2.0.3
Step 2: Update CodeIgniter files
Replace the files and directories in your "system" folder with the new versions:
-
+
Step 3: Update your main index.php file
If you are running a stock index.php file simply replace your version with the new one.
@@ -81,7 +81,7 @@ Upgrading from 2.0.2 to 2.0.3
This config file has been updated to contain more user agent types, please copy it to application/config/user_agents.php.
Step 5: Change references of the EXT constant to ".php"
-Note: The EXT Constant has been marked as deprecated, but has not been removed from the application. You are encouraged to make the changes sooner rather than later.
+Note: The EXT Constant has been marked as deprecated, but has not been removed from the application. You are encouraged to make the changes sooner rather than later.
Step 6: Remove APPPATH.'third_party' from autoload.php
@@ -101,10 +101,10 @@ Upgrading from 2.0.2 to 2.0.3
CREATE INDEX last_activity_idx ON ci_sessions(last_activity);
ALTER TABLE ci_sessions MODIFY user_agent VARCHAR(120);
-
-
-
-
+
+
+
+
diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html
index add7228c8..d2fc20d18 100644
--- a/user_guide/installation/upgrade_b11.html
+++ b/user_guide/installation/upgrade_b11.html
@@ -61,7 +61,7 @@ Upgrading from Beta 1.0 to Beta 1.1
Step 1: Replace your index file
-Replace your main index.php file with the new index.php file. Note: If you have renamed your "system" folder you will need to edit this info in the new file.
+Replace your main index.php file with the new index.php file. Note: If you have renamed your "system" folder you will need to edit this info in the new file.
Step 2: Relocate your config folder
@@ -91,7 +91,7 @@ the following item to your version: language/english/calendar_lang.phpStep 5: Edit your config file
-The original application/config/config.php file has a typo in it Open the file and look for the items related to cookies:
+The original application/config/config.php file has a typo in it Open the file and look for the items related to cookies:
$conf['cookie_prefix'] = "";
$conf['cookie_domain'] = "";
@@ -112,7 +112,7 @@ $config['cookie_path'] = "/";
|------------------------------------------------
|
| This item determines which server global
-| should be used to retrieve the URI string. The
+| should be used to retrieve the URI string. The
| default setting of "auto" works for most servers.
| If your links do not seem to work, try one of
| the other delicious flavors:
diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html
index c29acb7b2..4dadf6b83 100644
--- a/user_guide/libraries/benchmark.html
+++ b/user_guide/libraries/benchmark.html
@@ -83,7 +83,7 @@ timing of the entire system execution to be shown.
Using the Benchmark Class
-The Benchmark class can be used within your controllers, views, or your models. The process for usage is this:
+The Benchmark class can be used within your controllers, views, or your models. The process for usage is this:
- Mark a start point
@@ -101,7 +101,7 @@ $this->benchmark->mark('code_end');
echo $this->benchmark->elapsed_time('code_start', 'code_end');
-Note: The words "code_start" and "code_end" are arbitrary. They are simply words used to set two markers. You can
+
Note: The words "code_start" and "code_end" are arbitrary. They are simply words used to set two markers. You can
use any words you want, and you can set multiple sets of markers. Consider this example:
$this->benchmark->mark('dog');
@@ -154,8 +154,8 @@ is sent to the browser, simply place this in one of your view templates:
<?php echo $this->benchmark->elapsed_time();?>
You'll notice that it's the same function used in the examples above to calculate the time between two point, except you are
-not using any parameters. When the parameters are absent, CodeIgniter does not stop the benchmark until right before the final
-output is sent to the browser. It doesn't matter where you use the function call, the timer will continue to run until the very end.
+not using any parameters. When the parameters are absent, CodeIgniter does not stop the benchmark until right before the final
+output is sent to the browser. It doesn't matter where you use the function call, the timer will continue to run until the very end.
An alternate way to show your elapsed time in your view files is to use this pseudo-variable, if you prefer not to use the pure PHP:
{elapsed_time}
diff --git a/user_guide/libraries/caching.html b/user_guide/libraries/caching.html
index 190232e4b..3fa9fa6a4 100644
--- a/user_guide/libraries/caching.html
+++ b/user_guide/libraries/caching.html
@@ -58,7 +58,7 @@ Caching Driver
Caching Driver
-CodeIgniter features wrappers around some of the most popular forms of fast and dynamic caching. All but file-based caching require specific server requirements, and a Fatal Exception will be thrown if server requirements are not met.
+CodeIgniter features wrappers around some of the most popular forms of fast and dynamic caching. All but file-based caching require specific server requirements, and a Fatal Exception will be thrown if server requirements are not met.
Table of Contents
@@ -97,7 +97,7 @@ echo $foo;
is_supported(driver['string'])
-This function is automatically called when accessing drivers via $this->cache->get(). However, if the individual drivers are used, make sure to call this function to ensure the driver is supported in the hosting environment.
+This function is automatically called when accessing drivers via $this->cache->get(). However, if the individual drivers are used, make sure to call this function to ensure the driver is supported in the hosting environment.
if ($this->cache->apc->is_supported())
@@ -111,23 +111,23 @@ if ($this->cache->apc->is_supported())
get(id['string'])
-This function will attempt to fetch an item from the cache store. If the item does not exist, the function will return FALSE.
+This function will attempt to fetch an item from the cache store. If the item does not exist, the function will return FALSE.
$foo = $this->cache->get('my_cached_item');
save(id['string'], data['mixed'], ttl['int'])
-This function will save an item to the cache store. If saving fails, the function will return FALSE.
+This function will save an item to the cache store. If saving fails, the function will return FALSE.
The optional third parameter (Time To Live) defaults to 60 seconds.
$this->cache->save('cache_item_id', 'data_to_cache');
delete(id['string'])
-This function will delete a specific item from the cache store. If item deletion fails, the function will return FALSE.
+This function will delete a specific item from the cache store. If item deletion fails, the function will return FALSE.
$this->cache->delete('cache_item_id');
clean()
-This function will 'clean' the entire cache. If the deletion of the cache files fails, the function will return FALSE.
+This function will 'clean' the entire cache. If the deletion of the cache files fails, the function will return FALSE.
$this->cache->clean();
@@ -154,7 +154,7 @@ if ($this->cache->apc->is_supported())
File-based Caching
-Unlike caching from the Output Class, the driver file-based caching allows for pieces of view files to be cached. Use this with care, and make sure to benchmark your application, as a point can come where disk I/O will negate positive gains by caching.
+Unlike caching from the Output Class, the driver file-based caching allows for pieces of view files to be cached. Use this with care, and make sure to benchmark your application, as a point can come where disk I/O will negate positive gains by caching.
All of the functions listed above can be accessed without passing a specific adapter to the driver loader as follows:
$this->load->driver('cache');
@@ -172,7 +172,7 @@ if ($this->cache->apc->is_supported())
Dummy Cache
-This is a caching backend that will always 'miss.' It stores no data, but lets you keep your caching code in place in environments that don't support your chosen cache.
+This is a caching backend that will always 'miss.' It stores no data, but lets you keep your caching code in place in environments that don't support your chosen cache.
diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html
index e1af71cc9..06dfec71e 100644
--- a/user_guide/libraries/calendar.html
+++ b/user_guide/libraries/calendar.html
@@ -86,13 +86,13 @@ To show a calendar for a specific month and year you will pass this information
echo $this->calendar->generate(2006, 6);
-The above code will generate a calendar showing the month of June in 2006. The first parameter specifies the year, the second parameter specifies the month.
+The above code will generate a calendar showing the month of June in 2006. The first parameter specifies the year, the second parameter specifies the month.
Passing Data to your Calendar Cells
To add data to your calendar cells involves creating an associative array in which the keys correspond to the days
-you wish to populate and the array value contains the data. The array is passed to the third parameter of the calendar
-generating function. Consider this example:
+you wish to populate and the array value contains the data. The array is passed to the third parameter of the calendar
+generating function. Consider this example:
$this->load->library('calendar');
@@ -114,7 +114,7 @@ how data passed to your cells is handled so you can pass different types of info
Setting Display Preferences
-There are seven preferences you can set to control various aspects of the calendar. Preferences are set by passing an
+
There are seven preferences you can set to control various aspects of the calendar. Preferences are set by passing an
array of preferences in the second parameter of the loading function. Here is an example:
@@ -129,7 +129,7 @@ $this->load->library('calendar', $prefs);
echo $this->calendar->generate();
-The above code would start the calendar on saturday, use the "long" month heading, and the "short" day names. More information
+
The above code would start the calendar on saturday, use the "long" month heading, and the "short" day names. More information
regarding preferences below.
@@ -180,7 +180,7 @@ echo $this->calendar->generate($this->uri->segment(3), $this->ur
- You must set the "show_next_prev" to TRUE.
- You must supply the URL to the controller containing your calendar in the "next_prev_url" preference.
-- You must supply the "year" and "month" to the calendar generating function via the URI segments where they appear (Note: The calendar class automatically adds the year/month to the base URL you provide.).
+- You must supply the "year" and "month" to the calendar generating function via the URI segments where they appear (Note: The calendar class automatically adds the year/month to the base URL you provide.).
diff --git a/user_guide/libraries/cart.html b/user_guide/libraries/cart.html
index f084d5dcf..433bd5089 100644
--- a/user_guide/libraries/cart.html
+++ b/user_guide/libraries/cart.html
@@ -61,13 +61,13 @@ Shopping Cart Class
The Cart Class permits items to be added to a session that stays active while a user is browsing your site.
These items can be retrieved and displayed in a standard "shopping cart" format, allowing the user to update the quantity or remove items from the cart.
-Please note that the Cart Class ONLY provides the core "cart" functionality. It does not provide shipping, credit card authorization, or other processing components.
+Please note that the Cart Class ONLY provides the core "cart" functionality. It does not provide shipping, credit card authorization, or other processing components.
Initializing the Shopping Cart Class
Important: The Cart class utilizes CodeIgniter's
-Session Class to save the cart information to a database, so before using the Cart class you must set up a database table
+Session Class to save the cart information to a database, so before using the Cart class you must set up a database table
as indicated in the Session Documentation , and set the session preferences in your application/config/config.php file to utilize a database.
To initialize the Shopping Cart Class in your controller constructor, use the $this->load->library function:
@@ -106,19 +106,19 @@ It is intended to be used in cases where your product has options associated wit
- qty - The quantity being purchased.
- price - The price of the item.
- name - The name of the item.
-
- options - Any additional attributes that are needed to identify the product. These must be passed via an array.
+
- options - Any additional attributes that are needed to identify the product. These must be passed via an array.
-In addition to the five indexes above, there are two reserved words: rowid and subtotal. These are used internally by the Cart class, so
+
In addition to the five indexes above, there are two reserved words: rowid and subtotal. These are used internally by the Cart class, so
please do NOT use those words as index names when inserting data into the cart.
-Your array may contain additional data. Anything you include in your array will be stored in the session. However, it is best to standardize your data among
+
Your array may contain additional data. Anything you include in your array will be stored in the session. However, it is best to standardize your data among
all your products in order to make displaying the information in a table easier.
Adding Multiple Items to The Cart
-By using a multi-dimensional array, as shown below, it is possible to add multiple products to the cart in one action. This is useful in cases where you wish to allow
+
By using a multi-dimensional array, as shown below, it is possible to add multiple products to the cart in one action. This is useful in cases where you wish to allow
people to select from among several items on the same page.
@@ -170,10 +170,10 @@ $this->cart->insert($data);
<table cellpadding="6" cellspacing="1" style="width:100%" border="0">
<tr>
- <th>QTY</th>
- <th>Item Description</th>
- <th style="text-align:right">Item Price</th>
- <th style="text-align:right">Sub-Total</th>
+ <th>QTY</th>
+ <th>Item Description</th>
+ <th style="text-align:right">Item Price</th>
+ <th style="text-align:right">Sub-Total</th>
</tr>
<?php $i = 1; ?>
@@ -183,8 +183,8 @@ $this->cart->insert($data);
<?php echo form_hidden($i.'[rowid]', $items['rowid']); ?>
<tr>
- <td><?php echo form_input(array('name' => $i.'[qty]', 'value' => $items['qty'], 'maxlength' => '3', 'size' => '5')); ?></td>
- <td>
+ <td><?php echo form_input(array('name' => $i.'[qty]', 'value' => $items['qty'], 'maxlength' => '3', 'size' => '5')); ?></td>
+ <td>
<?php echo $items['name']; ?>
<?php if ($this->cart->has_options($items['rowid']) == TRUE): ?>
@@ -199,9 +199,9 @@ $this->cart->insert($data);
<?php endif; ?>
- </td>
- <td style="text-align:right"><?php echo $this->cart->format_number($items['price']); ?></td>
- <td style="text-align:right">$<?php echo $this->cart->format_number($items['subtotal']); ?></td>
+ </td>
+ <td style="text-align:right"><?php echo $this->cart->format_number($items['price']); ?></td>
+ <td style="text-align:right">$<?php echo $this->cart->format_number($items['subtotal']); ?></td>
</tr>
<?php $i++; ?>
@@ -209,9 +209,9 @@ $this->cart->insert($data);
<?php endforeach; ?>
<tr>
- <td colspan="2"> </td>
- <td class="right"><strong>Total</strong></td>
- <td class="right">$<?php echo $this->cart->format_number($this->cart->total()); ?></td>
+ <td colspan="2"> </td>
+ <td class="right"><strong>Total</strong></td>
+ <td class="right">$<?php echo $this->cart->format_number($this->cart->total()); ?></td>
</tr>
</table>
@@ -265,11 +265,11 @@ $this->cart->update($data);
-What is a Row ID? The row ID is a unique identifier that is generated by the cart code when an item is added to the cart. The reason a
+
What is a Row ID? The row ID is a unique identifier that is generated by the cart code when an item is added to the cart. The reason a
unique ID is created is so that identical products with different options can be managed by the cart.
-For example, let's say someone buys two identical t-shirts (same product ID), but in different sizes. The product ID (and other attributes) will be
-identical for both sizes because it's the same shirt. The only difference will be the size. The cart must therefore have a means of identifying this
+
For example, let's say someone buys two identical t-shirts (same product ID), but in different sizes. The product ID (and other attributes) will be
+identical for both sizes because it's the same shirt. The only difference will be the size. The cart must therefore have a means of identifying this
difference so that the two sizes of shirts can be managed independently. It does so by creating a unique "row ID" based on the product ID and any options associated with it.
In nearly all cases, updating the cart will be something the user does via the "view cart" page, so as a developer, it is unlikely that you will ever have to concern yourself
@@ -311,7 +311,7 @@ function when the update form is submitted. Please examine the construction of t
$this->cart->has_options(rowid);
-Returns TRUE (boolean) if a particular row in the cart contains options. This function is designed to be used in a loop with $this->cart->contents(), since you must pass the rowid to this function, as shown in the Displaying the Cart example above.
+Returns TRUE (boolean) if a particular row in the cart contains options. This function is designed to be used in a loop with $this->cart->contents(), since you must pass the rowid to this function, as shown in the Displaying the Cart example above.
$this->cart->product_options(rowid);
@@ -322,7 +322,7 @@ function when the update form is submitted. Please examine the construction of t
$this->cart->destroy();
-Permits you to destroy the cart. This function will likely be called when you are finished processing the customer's order.
+Permits you to destroy the cart. This function will likely be called when you are finished processing the customer's order.
diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html
index 2433ec4ad..c0192ca0a 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:
- - Create the directory application/config/production/
- - Copy your existing config.php into the above directory
- - Edit application/config/production/config.php so it contains your production settings
+ - Create the directory application/config/production/
+ - Copy your existing config.php into the above directory
+ - 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:
-
+
- Default CodeIgniter configuration files
- Your own custom configuration files
diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html
index 5a8814d59..61e139187 100644
--- a/user_guide/libraries/email.html
+++ b/user_guide/libraries/email.html
@@ -78,7 +78,7 @@ Email Class
Sending email is not only simple, but you can configure it on the fly or set your preferences in a config file.
-Here is a basic example demonstrating how you might send email. Note: This example assumes you are sending the email from one of your
+
Here is a basic example demonstrating how you might send email. Note: This example assumes you are sending the email from one of your
controllers.
$this->load->library('email');
@@ -103,7 +103,7 @@ echo $this->email->print_debugger();
There are 17 different preferences available to tailor how your email messages are sent. You can either set them manually
as described here, or automatically via preferences stored in your config file, described below:
-Preferences are set by passing an array of preference values to the email initialize function. Here is an example of how you might set some preferences:
+Preferences are set by passing an array of preference values to the email initialize function. Here is an example of how you might set some preferences:
$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
@@ -117,7 +117,7 @@ $this->email->initialize($config);
>Setting Email Preferences in a Config File
If you prefer not to set preferences using the above method, you can instead put them into a config file.
-Simply create a new file called the email.php, add the $config
+Simply create a new file called the email.php, add the $config
array in that file. Then save the file at config/email.php and it will be used automatically. You
will NOT need to use the $this->email->initialize() function if you save your preferences in a config file.
@@ -156,13 +156,13 @@ will NOT need to use the $this->email->initialize() function if you s
wrapchars | 76 | | Character count to wrap at. |
-mailtype | text | text or html | Type of mail. If you send HTML email you must send it as a complete web page. Make sure you don't have any relative links or relative image paths otherwise they will not work. |
+mailtype | text | text or html | Type of mail. If you send HTML email you must send it as a complete web page. Make sure you don't have any relative links or relative image paths otherwise they will not work. |
charset | utf-8 | | Character set (utf-8, iso-8859-1, etc.). |
-validate | FALSE | TRUE or FALSE (boolean) | Whether to validate the email address. |
+validate | FALSE | TRUE or FALSE (boolean) | Whether to validate the email address. |
-priority | 3 | 1, 2, 3, 4, 5 | Email Priority. 1 = highest. 5 = lowest. 3 = normal. |
+priority | 3 | 1, 2, 3, 4, 5 | Email Priority. 1 = highest. 5 = lowest. 3 = normal. |
crlf |
@@ -188,12 +188,12 @@ will NOT need to use the $this->email->initialize() function if you s
$this->email->from('you@example.com', 'Your Name');
$this->email->reply_to()
-Sets the reply-to address. If the information is not provided the information in the "from" function is used. Example:
+Sets the reply-to address. If the information is not provided the information in the "from" function is used. Example:
$this->email->reply_to('you@example.com', 'Your Name');
$this->email->to()
-Sets the email address(s) of the recipient(s). Can be a single email, a comma-delimited list or an array:
+Sets the email address(s) of the recipient(s). Can be a single email, a comma-delimited list or an array:
$this->email->to('someone@example.com');
$this->email->to('one@example.com, two@example.com, three@example.com');
@@ -221,14 +221,14 @@ $this->email->to($list);
Sets the alternative email message body:
$this->email->set_alt_message('This is the alternative message');
-This is an optional message string which can be used if you send HTML formatted email. It lets you specify an alternative
+
This is an optional message string which can be used if you send HTML formatted email. It lets you specify an alternative
message with no HTML formatting which is added to the header string for people who do not accept HTML email.
If you do not set your own message CodeIgniter will extract the message from your HTML email and strip the tags.
$this->email->clear()
-Initializes all the email variables to an empty state. This function is intended for use if you run the email sending function
+
Initializes all the email variables to an empty state. This function is intended for use if you run the email sending function
in a loop, permitting the data to be reset between cycles.
foreach ($list as $name => $address)
{
@@ -268,13 +268,13 @@ $this->email->send();
$this->email->print_debugger()
-Returns a string containing any server messages, the email headers, and the email messsage. Useful for debugging.
+Returns a string containing any server messages, the email headers, and the email messsage. Useful for debugging.
Overriding Word Wrapping
If you have word wrapping enabled (recommended to comply with RFC 822) and you have a very long link in your email it can
-get wrapped too, causing it to become un-clickable by the person receiving it. CodeIgniter lets you manually override
+get wrapped too, causing it to become un-clickable by the person receiving it. CodeIgniter lets you manually override
word wrapping within part of your message like this:
The text of your email that
diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html
index 60099312c..96ad54bc0 100644
--- a/user_guide/libraries/encryption.html
+++ b/user_guide/libraries/encryption.html
@@ -58,9 +58,9 @@ Encryption Class
Encryption Class
-The Encryption Class provides two-way data encryption. It uses a scheme that either compiles
+
The Encryption Class provides two-way data encryption. It uses a scheme that either compiles
the message using a randomly hashed bitwise XOR encoding scheme, or is encrypted using
-the Mcrypt library. If Mcrypt is not available on your server the encoded message will
+the Mcrypt library. If Mcrypt is not available on your server the encoded message will
still provide a reasonable degree of security for encrypted sessions or other such "light" purposes.
If Mcrypt is available, you'll be provided with a high degree of security appropriate for storage.
@@ -72,7 +72,7 @@ In fact, the key you chose will provide the only means to decod
so not only must you choose the key carefully, you must never change it if you intend use it for persistent data.
It goes without saying that you should guard your key carefully.
-Should someone gain access to your key, the data will be easily decoded. If your server is not totally under your control
+Should someone gain access to your key, the data will be easily decoded. If your server is not totally under your control
it's impossible to ensure key security so you may want to think carefully before using it for anything
that requires high security, like storing credit card numbers.
@@ -91,9 +91,9 @@ storage mechanism and pass the key dynamically when encoding/decoding.
Message Length
It's important for you to know that the encoded messages the encryption function generates will be approximately 2.6 times longer than the original
-message. For example, if you encrypt the string "my super secret data", which is 21 characters in length, you'll end up
+message. For example, if you encrypt the string "my super secret data", which is 21 characters in length, you'll end up
with an encoded string that is roughly 55 characters (we say "roughly" because the encoded string length increments in
-64 bit clusters, so it's not exactly linear). Keep this information in mind when selecting your data storage mechanism. Cookies,
+64 bit clusters, so it's not exactly linear). Keep this information in mind when selecting your data storage mechanism. Cookies,
for example, can only hold 4K of information.
@@ -124,7 +124,7 @@ $encrypted_string = $this->encrypt->encode($msg, $key);
$this->encrypt->decode()
-Decrypts an encoded string. Example:
+Decrypts an encoded string. Example:
$encrypted_string = 'APANtByIGI1BpVXZTJgcsAG8GZl8pdwwa84';
@@ -142,9 +142,9 @@ $encrypted_string = $this->encrypt->decode($msg, $key);
$this->encrypt->set_cipher();
-Permits you to set an Mcrypt cipher. By default it uses MCRYPT_RIJNDAEL_256. Example:
+Permits you to set an Mcrypt cipher. By default it uses MCRYPT_RIJNDAEL_256. Example:
$this->encrypt->set_cipher(MCRYPT_BLOWFISH);
-Please visit php.net for a list of available ciphers.
+Please visit php.net for a list of available ciphers.
If you'd like to manually test whether your server supports Mcrypt you can use:
echo ( ! function_exists('mcrypt_encrypt')) ? 'Nope' : 'Yup';
@@ -152,13 +152,13 @@ $encrypted_string = $this->encrypt->decode($msg, $key);
$this->encrypt->set_mode();
-Permits you to set an Mcrypt mode. By default it uses MCRYPT_MODE_CBC. Example:
+Permits you to set an Mcrypt mode. By default it uses MCRYPT_MODE_CBC. Example:
$this->encrypt->set_mode(MCRYPT_MODE_CFB);
-Please visit php.net for a list of available modes.
+Please visit php.net for a list of available modes.
$this->encrypt->sha1();
-SHA1 encoding function. Provide a string and it will return a 160 bit one way hash. Note: SHA1, just like MD5 is non-decodable. Example:
+SHA1 encoding function. Provide a string and it will return a 160 bit one way hash. Note: SHA1, just like MD5 is non-decodable. Example:
$hash = $this->encrypt->sha1('Some string');
Many PHP installations have SHA1 support by default so if all you need is to encode a hash it's simpler to use the native
@@ -169,12 +169,12 @@ function:
If your server does not support SHA1 you can use the provided function.
$this->encrypt->encode_from_legacy($orig_data, $legacy_mode = MCRYPT_MODE_ECB, $key = '');
-Enables you to re-encode data that was originally encrypted with CodeIgniter 1.x to be compatible with the Encryption library in CodeIgniter 2.x. It is only
- necessary to use this method if you have encrypted data stored permanently such as in a file or database and are on a server that supports Mcrypt. "Light" use encryption
- such as encrypted session data or transitory encrypted flashdata require no intervention on your part. However, existing encrypted Sessions will be
+
Enables you to re-encode data that was originally encrypted with CodeIgniter 1.x to be compatible with the Encryption library in CodeIgniter 2.x. It is only
+ necessary to use this method if you have encrypted data stored permanently such as in a file or database and are on a server that supports Mcrypt. "Light" use encryption
+ such as encrypted session data or transitory encrypted flashdata require no intervention on your part. However, existing encrypted Sessions will be
destroyed since data encrypted prior to 2.x will not be decoded.
-Why only a method to re-encode the data instead of maintaining legacy methods for both encoding and decoding? The algorithms in
+
Why only a method to re-encode the data instead of maintaining legacy methods for both encoding and decoding? The algorithms in
the Encryption library have improved in CodeIgniter 2.x both for performance and security, and we do not wish to encourage continued use of the older methods.
You can of course extend the Encryption library if you wish and replace the new methods with the old and retain seamless compatibility with CodeIgniter 1.x
encrypted data, but this a decision that a developer should make cautiously and deliberately, if at all.
@@ -195,13 +195,13 @@ function:
$legacy_mode |
MCRYPT_MODE_ECB |
- The Mcrypt mode that was used to generate the original encrypted data. CodeIgniter 1.x's default was MCRYPT_MODE_ECB, and it will
+ | The Mcrypt mode that was used to generate the original encrypted data. CodeIgniter 1.x's default was MCRYPT_MODE_ECB, and it will
assume that to be the case unless overridden by this parameter. |
$key |
n/a |
- The encryption key. This it typically specified in your config file as outlined above. |
+ The encryption key. This it typically specified in your config file as outlined above. |
diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html
index e4e842e5f..a248267ae 100644
--- a/user_guide/libraries/file_uploading.html
+++ b/user_guide/libraries/file_uploading.html
@@ -58,7 +58,7 @@ File Uploading Class
File Uploading Class
-CodeIgniter's File Uploading Class permits files to be uploaded. You can set various
+
CodeIgniter's File Uploading Class permits files to be uploaded. You can set various
preferences, restricting the type and size of the files.
@@ -80,7 +80,7 @@ preferences, restricting the type and size of the files.
-Using a text editor, create a form called upload_form.php. In it, place this code and save it to your applications/views/
+
Using a text editor, create a form called upload_form.php. In it, place this code and save it to your applications/views/
folder:
@@ -106,8 +106,8 @@ folder:
</body>
</html>
-You'll notice we are using a form helper to create the opening form tag. File uploads require a multipart form, so the helper
-creates the proper syntax for you. You'll also notice we have an $error variable. This is so we can show error messages in the event
+
You'll notice we are using a form helper to create the opening form tag. File uploads require a multipart form, so the helper
+creates the proper syntax for you. You'll also notice we have an $error variable. This is so we can show error messages in the event
the user does something wrong.
@@ -138,7 +138,7 @@ In it, place this code and save it to your applications/views/ fold
The Controller
-Using a text editor, create a controller called upload.php. In it, place this code and save it to your applications/controllers/
+
Using a text editor, create a controller called upload.php. In it, place this code and save it to your applications/controllers/
folder:
@@ -162,8 +162,8 @@ class Upload extends CI_Controller {
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '100';
- $config['max_width'] = '1024';
- $config['max_height'] = '768';
+ $config['max_width'] = '1024';
+ $config['max_height'] = '768';
$this->load->library('upload', $config);
@@ -186,7 +186,7 @@ class Upload extends CI_Controller {
The Upload Folder
-You'll need a destination folder for your uploaded images. Create a folder at the root of your CodeIgniter installation called
+
You'll need a destination folder for your uploaded images. Create a folder at the root of your CodeIgniter installation called
uploads and set its file permissions to 777.
@@ -215,26 +215,26 @@ controller is correct it should work.
Setting Preferences
-Similar to other libraries, you'll control what is allowed to be upload based on your preferences. In the controller you
+
Similar to other libraries, you'll control what is allowed to be upload based on your preferences. In the controller you
built above you set the following preferences:
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '100';
-$config['max_width'] = '1024';
-$config['max_height'] = '768';
+$config['max_width'] = '1024';
+$config['max_height'] = '768';
$this->load->library('upload', $config);
-// Alternately you can set preferences by calling the initialize function. Useful if you auto-load the class:
+// Alternately you can set preferences by calling the initialize function. Useful if you auto-load the class:
$this->upload->initialize($config);
-The above preferences should be fairly self-explanatory. Below is a table describing all available preferences.
+The above preferences should be fairly self-explanatory. Below is a table describing all available preferences.
Preferences
-The following preferences are available. The default value indicates what will be used if you do not specify that preference.
+The following preferences are available. The default value indicates what will be used if you do not specify that preference.
@@ -248,14 +248,14 @@ $this->upload->initialize($config);
upload_path |
None |
None |
-The path to the folder where the upload should be placed. The folder must be writable and the path can be absolute or relative. |
+The path to the folder where the upload should be placed. The folder must be writable and the path can be absolute or relative. |
allowed_types |
None |
None |
-The mime types corresponding to the types of files you allow to be uploaded. Usually the file extension can be used as the mime type. Separate multiple types with a pipe. |
+The mime types corresponding to the types of files you allow to be uploaded. Usually the file extension can be used as the mime type. Separate multiple types with a pipe. |
@@ -264,7 +264,7 @@ $this->upload->initialize($config);
None |
Desired file name |
- If set CodeIgniter will rename the uploaded file to this name. The extension provided in the file name must also be an allowed file type.
+ If set CodeIgniter will rename the uploaded file to this name. The extension provided in the file name must also be an allowed file type.
|
@@ -280,28 +280,28 @@ $this->upload->initialize($config);
max_size |
0 |
None |
-The maximum size (in kilobytes) that the file can be. Set to zero for no limit. Note: Most PHP installations have their own limit, as specified in the php.ini file. Usually 2 MB (or 2048 KB) by default. |
+The maximum size (in kilobytes) that the file can be. Set to zero for no limit. Note: Most PHP installations have their own limit, as specified in the php.ini file. Usually 2 MB (or 2048 KB) by default. |
max_width |
0 |
None |
-The maximum width (in pixels) that the file can be. Set to zero for no limit. |
+The maximum width (in pixels) that the file can be. Set to zero for no limit. |
max_height |
0 |
None |
-The maximum height (in pixels) that the file can be. Set to zero for no limit. |
+The maximum height (in pixels) that the file can be. Set to zero for no limit. |
max_filename |
0 |
None |
-The maximum length that a file name can be. Set to zero for no limit. |
+The maximum length that a file name can be. Set to zero for no limit. |
@@ -323,7 +323,7 @@ $this->upload->initialize($config);
Setting preferences in a config file
If you prefer not to set preferences using the above method, you can instead put them into a config file.
-Simply create a new file called the upload.php, add the $config
+Simply create a new file called the upload.php, add the $config
array in that file. Then save the file in: config/upload.php and it will be used automatically. You
will NOT need to use the $this->upload->initialize function if you save your preferences in a config file.
@@ -335,7 +335,7 @@ will NOT need to use the $this->upload->initialize function if you sa
$this->upload->do_upload()
-Performs the upload based on the preferences you've set. Note: By default the upload routine expects the file to come from a form field
+
Performs the upload based on the preferences you've set. Note: By default the upload routine expects the file to come from a form field
called userfile, and the form must be a "multipart type:
<form method="post" action="some_action" enctype="multipart/form-data" />
@@ -349,11 +349,11 @@ $this->upload->do_upload($field_name)
$this->upload->display_errors()
-Retrieves any error messages if the do_upload() function returned false. The function does not echo automatically, it
+
Retrieves any error messages if the do_upload() function returned false. The function does not echo automatically, it
returns the data so you can assign it however you need.
Formatting Errors
-By default the above function wraps any errors within <p> tags. You can set your own delimiters like this:
+By default the above function wraps any errors within <p> tags. You can set your own delimiters like this:
$this->upload->display_errors('<p>', '</p>');
@@ -403,7 +403,7 @@ Here is the array prototype:
The file name without the extension |
orig_name |
-The original file name. This is only useful if you use the encrypted name option. |
+The original file name. This is only useful if you use the encrypted name option. |
client_name |
The file name as supplied by the client user agent, prior to any file name preparation or incrementing. |
@@ -415,7 +415,7 @@ Here is the array prototype:
The file size in kilobytes |
is_image |
-Whether the file is an image or not. 1 = image. 0 = not. |
+Whether the file is an image or not. 1 = image. 0 = not. |
image_width |
Image width. |
@@ -424,10 +424,10 @@ Here is the array prototype:
Image height |
image_type |
-Image type. Typically the file extension without the period. |
+Image type. Typically the file extension without the period. |
image_size_str |
-A string containing the width and height. Useful to put into an image tag. |
+A string containing the width and height. Useful to put into an image tag. |
diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html
index 8fdcd1446..54908d41d 100644
--- a/user_guide/libraries/form_validation.html
+++ b/user_guide/libraries/form_validation.html
@@ -113,10 +113,10 @@ along with an error message describing the problem.
- Check for required data.
- Verify that the data is of the correct type, and meets the correct criteria. For example, if a username is submitted
-it must be validated to contain only permitted characters. It must be of a minimum length,
+it must be validated to contain only permitted characters. It must be of a minimum length,
and not exceed a maximum length. The username can't be someone else's existing username, or perhaps even a reserved word. Etc.
- Sanitize the data for security.
-- Pre-format the data if needed (Does the data need to be trimmed? HTML encoded? Etc.)
+- Pre-format the data if needed (Does the data need to be trimmed? HTML encoded? Etc.)
- Prep the data for insertion in the database.
@@ -150,7 +150,7 @@ Form validation, while simple to create, is generally very messy and tedious to
The Form
-Using a text editor, create a form called myform.php. In it, place this code and save it to your applications/views/
+
Using a text editor, create a form called myform.php. In it, place this code and save it to your applications/views/
folder:
@@ -191,7 +191,7 @@ folder:
The Success Page
-Using a text editor, create a form called formsuccess.php. In it, place this code and save it to your applications/views/
+
Using a text editor, create a form called formsuccess.php. In it, place this code and save it to your applications/views/
folder:
@@ -215,7 +215,7 @@ folder:
The Controller
-Using a text editor, create a controller called form.php. In it, place this code and save it to your applications/controllers/
+
Using a text editor, create a controller called form.php. In it, place this code and save it to your applications/controllers/
folder:
@@ -248,10 +248,10 @@ class Form extends CI_Controller {
example.com/index.php/form/
-If you submit the form you should simply see the form reload. That's because you haven't set up any validation
+If you submit the form you should simply see the form reload. That's because you haven't set up any validation
rules yet.
-Since you haven't told the Form Validation class to validate anything yet, it returns FALSE (boolean false) by default. The run()
+Since you haven't told the Form Validation class to validate anything yet, it returns FALSE (boolean false) by default. The run()
function only returns TRUE if it has successfully applied your rules without any of them failing.
@@ -263,8 +263,8 @@ function only returns TRUE if it has successfully applied your rules
- It uses a form helper to create the form opening.
-Technically, this isn't necessary. You could create the form using standard HTML. However, the benefit of using the helper
-is that it generates the action URL for you, based on the URL in your config file. This makes your application more portable in the event your URLs change.
+Technically, this isn't necessary. You could create the form using standard HTML. However, the benefit of using the helper
+is that it generates the action URL for you, based on the URL in your config file. This makes your application more portable in the event your URLs change.
- At the top of the form you'll notice the following function call:
<?php echo validation_errors(); ?>
@@ -341,7 +341,7 @@ class Form extends CI_Controller {
If you submit the form with all the fields populated you'll see your success page.
Note: The form fields are not yet being re-populated with the data when
-there is an error. We'll get to that shortly.
+there is an error. We'll get to that shortly.
@@ -387,7 +387,7 @@ $this->form_validation->set_rules($config);
Cascading Rules
-CodeIgniter lets you pipe multiple rules together. Let's try it. Change your rules in the third parameter of rule setting function, like this:
+CodeIgniter lets you pipe multiple rules together. Let's try it. Change your rules in the third parameter of rule setting function, like this:
$this->form_validation->set_rules('username', 'Username', 'required|min_length[5]|max_length[12]');
@@ -427,7 +427,7 @@ $this->form_validation->set_rules('email', 'Email', 'trim|required|va
the "xss_clean" function, which removes malicious data.
Any native PHP function that accepts one parameter can be used as a rule, like htmlspecialchars,
-trim, MD5, etc.
+trim, MD5, etc.
Note: You will generally want to use the prepping functions after
the validation rules so if there is an error, the original data will be shown in the form.
@@ -438,7 +438,7 @@ the validation rules so if there is an error, the original data will be shown in
Re-populating the form
-Thus far we have only been dealing with errors. It's time to repopulate the form field with the submitted data. CodeIgniter offers several helper functions
+
Thus far we have only been dealing with errors. It's time to repopulate the form field with the submitted data. CodeIgniter offers several helper functions
that permit you to do this. The one you will use most commonly is:
set_value('field name')
@@ -481,13 +481,13 @@ that permit you to do this. The one you will use most commonly is:
-Now reload your page and submit the form so that it triggers an error. Your form fields should now be re-populated
+Now reload your page and submit the form so that it triggers an error. Your form fields should now be re-populated
Note: The Function Reference section below contains functions that
permit you to re-populate <select> menus, radio buttons, and checkboxes.
-Important Note: If you use an array as the name of a form field, you must supply it as an array to the function. Example:
+Important Note: If you use an array as the name of a form field, you must supply it as an array to the function. Example:
<input type="text" name="colors[]" value="<?php echo set_value('colors[]'); ?>" size="50" />
@@ -500,16 +500,16 @@ permit you to re-populate <select> menus, radio buttons, and checkboxes.
Callbacks: Your own Validation Functions
-The validation system supports callbacks to your own validation functions. This permits you to extend the validation class
-to meet your needs. For example, if you need to run a database query to see if the user is choosing a unique username, you can
-create a callback function that does that. Let's create a example of this.
+The validation system supports callbacks to your own validation functions. This permits you to extend the validation class
+to meet your needs. For example, if you need to run a database query to see if the user is choosing a unique username, you can
+create a callback function that does that. Let's create a example of this.
In your controller, change the "username" rule to this:
$this->form_validation->set_rules('username', 'Username', 'callback_username_check');
-Then add a new function called username_check to your controller. Here's how your controller should now look:
+Then add a new function called username_check to your controller. Here's how your controller should now look:
-Reload your form and submit it with the word "test" as the username. You can see that the form field data was passed to your
+Reload your form and submit it with the word "test" as the username. You can see that the form field data was passed to your
callback function for you to process.
To invoke a callback just put the function name in a rule, with "callback_" as the rule prefix.
-You can also process the form data that is passed to your callback and return it. If your callback returns anything other than a boolean TRUE/FALSE
+
You can also process the form data that is passed to your callback and return it. If your callback returns anything other than a boolean TRUE/FALSE
it is assumed that the data is your newly processed form data.
@@ -568,7 +568,7 @@ it is assumed that the data is your newly processed form data.
Setting Error Messages
-All of the native error messages are located in the following language file: language/english/form_validation_lang.php
+All of the native error messages are located in the following language file: language/english/form_validation_lang.php
To set your own custom message you can either edit that file, or use the following function:
@@ -582,7 +582,7 @@ it is assumed that the data is your newly processed form data.
$this->form_validation->set_message('username_check')
-You can also override any error message found in the language file. For example, to change the message for the "required" rule you will do this:
+You can also override any error message found in the language file. For example, to change the message for the "required" rule you will do this:
$this->form_validation->set_message('required', 'Your custom message here');
@@ -669,9 +669,9 @@ individually.
<input type="text" name="email" value="<?php echo set_value('email'); ?>" size="50" />
-If there are no errors, nothing will be shown. If there is an error, the message will appear.
+If there are no errors, nothing will be shown. If there is an error, the message will appear.
-Important Note: If you use an array as the name of a form field, you must supply it as an array to the function. Example:
+Important Note: If you use an array as the name of a form field, you must supply it as an array to the function. Example:
<?php echo form_error('options[size]'); ?>
<input type="text" name="options[size]" value="<?php echo set_value("options[size]"); ?>" size="50" />
@@ -688,8 +688,8 @@ individually.
Saving Sets of Validation Rules to a Config File
-A nice feature of the Form Validation class is that it permits you to store all your validation rules for your entire application in a config file. You
-can organize these rules into "groups". These groups can either be loaded automatically when a matching controller/function is called, or
+
A nice feature of the Form Validation class is that it permits you to store all your validation rules for your entire application in a config file. You
+can organize these rules into "groups". These groups can either be loaded automatically when a matching controller/function is called, or
you can manually call each set as needed.
How to save your rules
@@ -728,8 +728,8 @@ $config = array(
Creating Sets of Rules
-In order to organize your rules into "sets" requires that you place them into "sub arrays". Consider the following example, showing two sets of rules.
-We've arbitrarily called these two rules "signup" and "email". You can name your rules anything you want:
+In order to organize your rules into "sets" requires that you place them into "sub arrays". Consider the following example, showing two sets of rules.
+We've arbitrarily called these two rules "signup" and "email". You can name your rules anything you want:
$config = array(
@@ -783,7 +783,7 @@ We've arbitrarily called these two rules "signup" and "email". You can name you
Calling a Specific Rule Group
-In order to call a specific group you will pass its name to the run() function. For example, to call the signup rule you will do this:
+In order to call a specific group you will pass its name to the run() function. For example, to call the signup rule you will do this:
if ($this->form_validation->run('signup') == FALSE)
@@ -800,8 +800,8 @@ else
Associating a Controller Function with a Rule Group
-An alternate (and more automatic) method of calling a rule group is to name it according to the controller class/function you intend to use it with. For example, let's say you
-have a controller named Member and a function named signup. Here's what your class might look like:
+An alternate (and more automatic) method of calling a rule group is to name it according to the controller class/function you intend to use it with. For example, let's say you
+have a controller named Member and a function named signup. Here's what your class might look like:
<?php
@@ -860,7 +860,7 @@ class Member extends CI_Controller {
Using Arrays as Field Names
-The Form Validation class supports the use of arrays as field names. Consider this example:
+The Form Validation class supports the use of arrays as field names. Consider this example:
<input type="text" name="options[]" value="" size="50" />
@@ -1147,13 +1147,13 @@ like trim, htmlspecialchars, urldecode, etc.$this->form_validation->run();
-Runs the validation routines. Returns boolean TRUE on success and FALSE on failure. You can optionally pass the name of the validation
+
Runs the validation routines. Returns boolean TRUE on success and FALSE on failure. You can optionally pass the name of the validation
group via the function, as described in: Saving Groups of Validation Rules to a Config File.
$this->form_validation->set_message();
-Permits you to set custom error messages. See Setting Error Messages above.
+Permits you to set custom error messages. See Setting Error Messages above.
@@ -1161,25 +1161,25 @@ group via the function, as described in: Saving Groups
Helper Reference
-The following helper functions are available for use in the view files containing your forms. Note that these are procedural functions, so they
+
The following helper functions are available for use in the view files containing your forms. Note that these are procedural functions, so they
do not require you to prepend them with $this->form_validation.
form_error()
-Shows an individual error message associated with the field name supplied to the function. Example:
+Shows an individual error message associated with the field name supplied to the function. Example:
<?php echo form_error('username'); ?>
-The error delimiters can be optionally specified. See the Changing the Error Delimiters section above.
+The error delimiters can be optionally specified. See the Changing the Error Delimiters section above.
validation_errors()
-Shows all error messages as a string: Example:
+Shows all error messages as a string: Example:
<?php echo validation_errors(); ?>
-The error delimiters can be optionally specified. See the Changing the Error Delimiters section above.
+The error delimiters can be optionally specified. See the Changing the Error Delimiters section above.
@@ -1194,7 +1194,7 @@ The second (optional) parameter allows you to set a default value for the form.
set_select()
-If you use a <select> menu, this function permits you to display the menu item that was selected. The first parameter
+
If you use a <select> menu, this function permits you to display the menu item that was selected. The first parameter
must contain the name of the select menu, the second parameter must contain the value of
each item, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE).
@@ -1202,16 +1202,16 @@ each item, and the third (optional) parameter lets you set an item as the defaul
<select name="myselect">
-<option value="one" <?php echo set_select('myselect', 'one', TRUE); ?> >One</option>
-<option value="two" <?php echo set_select('myselect', 'two'); ?> >Two</option>
-<option value="three" <?php echo set_select('myselect', 'three'); ?> >Three</option>
+<option value="one" <?php echo set_select('myselect', 'one', TRUE); ?> >One</option>
+<option value="two" <?php echo set_select('myselect', 'two'); ?> >Two</option>
+<option value="three" <?php echo set_select('myselect', 'three'); ?> >Three</option>
</select>
set_checkbox()
-Permits you to display a checkbox in the state it was submitted. The first parameter
+
Permits you to display a checkbox in the state it was submitted. The first parameter
must contain the name of the checkbox, the second parameter must contain its value, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE). Example:
<input type="checkbox" name="mycheck[]" value="1" <?php echo set_checkbox('mycheck[]', '1'); ?> />
@@ -1222,8 +1222,8 @@ must contain the name of the checkbox, the second parameter must contain its val
Permits you to display radio buttons in the state they were submitted. This function is identical to the set_checkbox() function above.
-<input type="radio" name="myradio" value="1" <?php echo set_radio('myradio', '1', TRUE); ?> />
-<input type="radio" name="myradio" value="2" <?php echo set_radio('myradio', '2'); ?> />
+<input type="radio" name="myradio" value="1" <?php echo set_radio('myradio', '1', TRUE); ?> />
+<input type="radio" name="myradio" value="2" <?php echo set_radio('myradio', '2'); ?> />
diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html
index 43b949a50..c318bc15a 100644
--- a/user_guide/libraries/ftp.html
+++ b/user_guide/libraries/ftp.html
@@ -59,7 +59,7 @@ FTP Class
FTP Class
CodeIgniter's FTP Class permits files to be transfered to a remote server. Remote files can also be moved, renamed,
-and deleted. The FTP class also includes a "mirroring" function that permits an entire local directory to be recreated remotely via FTP.
+and deleted. The FTP class also includes a "mirroring" function that permits an entire local directory to be recreated remotely via FTP.
Note: SFTP and SSL FTP protocols are not supported, only standard FTP.
@@ -74,7 +74,7 @@ and deleted. The FTP class also includes a "mirroring" function that permits an
Usage Examples
In this example a connection is opened to the FTP server, and a local file is read and uploaded in ASCII mode. The
-file permissions are set to 755. Note: Setting permissions requires PHP 5.
+file permissions are set to 755. Note: Setting permissions requires PHP 5.
$this->load->library('ftp');
@@ -157,26 +157,26 @@ $this->ftp->connect($config);
Setting FTP Preferences in a Config File
If you prefer you can store your FTP preferences in a config file.
-Simply create a new file called the ftp.php, add the $config
+Simply create a new file called the ftp.php, add the $config
array in that file. Then save the file at config/ftp.php and it will be used automatically.
Available connection options:
-- hostname - the FTP hostname. Usually something like: ftp.example.com
+- hostname - the FTP hostname. Usually something like: ftp.example.com
- username - the FTP username.
- password - the FTP password.
- port - The port number. Set to 21 by default.
- debug - TRUE/FALSE (boolean). Whether to enable debugging to display error messages.
-- passive - TRUE/FALSE (boolean). Whether to use passive mode. Passive is set automatically by default.
+- passive - TRUE/FALSE (boolean). Whether to use passive mode. Passive is set automatically by default.
$this->ftp->upload()
-Uploads a file to your server. You must supply the local path and the remote path, and you can optionally set the mode and permissions.
+
Uploads a file to your server. You must supply the local path and the remote path, and you can optionally set the mode and permissions.
Example:
@@ -190,7 +190,7 @@ Example:
$this->ftp->download()
-Downloads a file from your server. You must supply the remote path and the local path, and you can optionally set the mode.
+
Downloads a file from your server. You must supply the remote path and the local path, and you can optionally set the mode.
Example:
$this->ftp->download('/public_html/myfile.html', '/local/path/to/myfile.html', 'ascii');
@@ -202,7 +202,7 @@ Example:
$this->ftp->rename()
-Permits you to rename a file. Supply the source file name/path and the new file name/path.
+Permits you to rename a file. Supply the source file name/path and the new file name/path.
// Renames green.html to blue.html
@@ -210,7 +210,7 @@ $this->ftp->rename('/public_html/foo/green.html', '/public_html/foo/blue.html');
$this->ftp->move()
-Lets you move a file. Supply the source and destination paths:
+Lets you move a file. Supply the source and destination paths:
// Moves blog.html from "joe" to "fred"
@@ -221,7 +221,7 @@ $this->ftp->move('/public_html/joe/blog.html', '/public_html/fred/blog.html');
$this->ftp->delete_file()
-Lets you delete a file. Supply the source path with the file name.
+Lets you delete a file. Supply the source path with the file name.
$this->ftp->delete_file('/public_html/joe/blog.html');
@@ -229,10 +229,10 @@ $this->ftp->delete_file('/public_html/joe/blog.html');
$this->ftp->delete_dir()
-Lets you delete a directory and everything it contains. Supply the source path to the directory with a trailing slash.
+Lets you delete a directory and everything it contains. Supply the source path to the directory with a trailing slash.
-Important Be VERY careful with this function. It will recursively delete
-everything within the supplied path, including sub-folders and all files. Make absolutely sure your path is correct.
+
Important Be VERY careful with this function. It will recursively delete
+everything within the supplied path, including sub-folders and all files. Make absolutely sure your path is correct.
Try using the list_files() function first to verify that your path is correct.
@@ -242,7 +242,7 @@ $this->ftp->delete_dir('/public_html/path/to/folder/');
$this->ftp->list_files()
-Permits you to retrieve a list of files on your server returned as an array. You must supply
+
Permits you to retrieve a list of files on your server returned as an array. You must supply
the path to the desired directory.
@@ -255,7 +255,7 @@ print_r($list);
$this->ftp->mirror()
Recursively reads a local folder and everything it contains (including sub-folders) and creates a
-mirror via FTP based on it. Whatever the directory structure of the original file path will be recreated on the server.
+mirror via FTP based on it. Whatever the directory structure of the original file path will be recreated on the server.
You must supply a source path and a destination path:
@@ -266,7 +266,7 @@ $this->ftp->mirror('/path/to/myfolder/', '/public_html/myfolder/');
$this->ftp->mkdir()
-Lets you create a directory on your server. Supply the path ending in the folder name you wish to create, with a trailing slash.
+
Lets you create a directory on your server. Supply the path ending in the folder name you wish to create, with a trailing slash.
Permissions can be set by passed an octal value in the second parameter (if you are running PHP 5).
@@ -277,7 +277,7 @@ $this->ftp->mkdir('/public_html/foo/bar/', DIR_WRITE_MODE);
$this->ftp->chmod()
-Permits you to set file permissions. Supply the path to the file or folder you wish to alter permissions on:
+Permits you to set file permissions. Supply the path to the file or folder you wish to alter permissions on:
// Chmod "bar" to 777
@@ -288,7 +288,7 @@ $this->ftp->chmod('/public_html/foo/bar/', DIR_WRITE_MODE);
$this->ftp->close();
-Closes the connection to your server. It's recommended that you use this when you are finished uploading.
+Closes the connection to your server. It's recommended that you use this when you are finished uploading.
diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html
index dbf07768e..e6d38fc96 100644
--- a/user_guide/libraries/image_lib.html
+++ b/user_guide/libraries/image_lib.html
@@ -68,11 +68,11 @@ Image Manipulation Class
Image Watermarking
-All three major image libraries are supported: GD/GD2, NetPBM, and ImageMagick
+All three major image libraries are supported: GD/GD2, NetPBM, and ImageMagick
Note: Watermarking is only available using the GD/GD2 library.
In addition, even though other libraries are supported, GD is required in
-order for the script to calculate the image properties. The image processing, however, will be performed with the
+order for the script to calculate the image properties. The image processing, however, will be performed with the
library you specify.
@@ -82,14 +82,14 @@ library you specify.
using the $this->load->library function:
$this->load->library('image_lib');
-Once the library is loaded it will be ready for use. The image library object you will use to call all functions is: $this->image_lib
+Once the library is loaded it will be ready for use. The image library object you will use to call all functions is: $this->image_lib
Processing an Image
Regardless of the type of processing you would like to perform (resizing, cropping, rotation, or watermarking), the general process is
identical. You will set some preferences corresponding to the action you intend to perform, then
-call one of four available processing functions. For example, to create an image thumbnail you'll do this:
+call one of four available processing functions. For example, to create an image thumbnail you'll do this:
$config['image_library'] = 'gd2';
$config['source_image'] = '/path/to/image/mypic.jpg';
@@ -106,7 +106,7 @@ $this->image_lib->resize();
The above code tells the image_resize function to look for an image called mypic.jpg
located in the source_image folder, then create a thumbnail that is 75 X 50 pixels using the GD2 image_library.
Since the maintain_ratio option is enabled, the thumb will be as close to the target width and
-height as possible while preserving the original aspect ratio. The thumbnail will be called mypic_thumb.jpg
+height as possible while preserving the original aspect ratio. The thumbnail will be called mypic_thumb.jpg
Note: In order for the image class to be allowed to do any processing, the
@@ -126,7 +126,7 @@ folder containing the image files must have write permissions.
$this->image_lib->clear()
-These functions return boolean TRUE upon success and FALSE for failure. If they fail you can retrieve the
+
These functions return boolean TRUE upon success and FALSE for failure. If they fail you can retrieve the
error message using this function:
echo $this->image_lib->display_errors();
@@ -138,7 +138,7 @@ error message using this function:
echo $this->image_lib->display_errors();
}
-Note: You can optionally specify the HTML formatting to be applied to the errors, by submitting the opening/closing
+
Note: You can optionally specify the HTML formatting to be applied to the errors, by submitting the opening/closing
tags in the function, like this:
$this->image_lib->display_errors('<p>', '</p>');
@@ -146,11 +146,11 @@ tags in the function, like this:
Preferences
-The preferences described below allow you to tailor the image processing to suit your needs.
+The preferences described below allow you to tailor the image processing to suit your needs.
Note that not all preferences are available for every
-function. For example, the x/y axis preferences are only available for image cropping. Likewise, the width and height
-preferences have no effect on cropping. The "availability" column indicates which functions support a given preference.
+function. For example, the x/y axis preferences are only available for image cropping. Likewise, the width and height
+preferences have no effect on cropping. The "availability" column indicates which functions support a given preference.
Availability Legend:
@@ -187,7 +187,7 @@ preferences have no effect on cropping. The "availability" column indicates whi
library_path |
None |
None |
-Sets the server path to your ImageMagick or NetPBM library. If you use either of those libraries you must supply the path. |
+Sets the server path to your ImageMagick or NetPBM library. If you use either of those libraries you must supply the path. |
R, C, X |
@@ -195,7 +195,7 @@ preferences have no effect on cropping. The "availability" column indicates whi
source_image |
None |
None |
-Sets the source image name/path. The path must be a relative or absolute server path, not a URL. |
+Sets the source image name/path. The path must be a relative or absolute server path, not a URL. |
R, C, S, W |