CI_URI::segment()

segment($n[, $no_result = NULL]) Parameters: $n (int) – Segment index number $no_result (mixed) – What to return if the searched segment is not found Returns: Segment value or $no_result value if not found Return type: mixed Permits you to retrieve a specific segment. Where n is the segment number you wish to retrieve. Segments are numbered from left to right. For example, if your full URL is this: http://example.com/index.php/news/local/metro/crime_is_up The segment numbers would

CI_URI::ruri_string()

ruri_string() Returns: Routed URI string Return type: string This method is identical to uri_string(), except that it returns the re-routed URI in the event you are using CodeIgniter’s URI Routing feature.

CI_URI

class CI_URI segment($n[, $no_result = NULL]) Parameters: $n (int) – Segment index number $no_result (mixed) – What to return if the searched segment is not found Returns: Segment value or $no_result value if not found Return type: mixed Permits you to retrieve a specific segment. Where n is the segment number you wish to retrieve. Segments are numbered from left to right. For example, if your full URL is this: http://example.com/index.php/news/local/metro/crime_is_up The segment

CI_Upload::initialize()

initialize([array $config = array()[, $reset = TRUE]]) Parameters: $config (array) – Preferences $reset (bool) – Whether to reset preferences (that are not provided in $config) to their defaults Returns: CI_Upload instance (method chaining) Return type: CI_Upload

CI_Upload

class CI_Upload initialize([array $config = array()[, $reset = TRUE]]) Parameters: $config (array) – Preferences $reset (bool) – Whether to reset preferences (that are not provided in $config) to their defaults Returns: CI_Upload instance (method chaining) Return type: CI_Upload do_upload([$field = 'userfile']) Parameters: $field (string) – Name of the form field Returns: TRUE on success, FALSE on failure Return type: bool Performs the upload based on the preferences

CI_Upload::display_errors()

display_errors([$open = ' '[, $close = ' ']]) Parameters: $open (string) – Opening markup $close (string) – Closing markup Returns: Formatted error message(s) Return type: string Retrieves any error messages if the do_upload() method returned false. The method does not echo automatically, it returns the data so you can assign it however you need. Formatting Errors By default the above method wraps any errors within <p> tags. You can set your own delimiters like this: $this-&g

CI_Upload::do_upload()

do_upload([$field = 'userfile']) Parameters: $field (string) – Name of the form field Returns: TRUE on success, FALSE on failure Return type: bool 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 of type “multipart”. <form method="post" action="some_action" enctype="multipart/form-data" /> If you would like to set your own field name simply pass its va

CI_Upload::data()

data([$index = NULL]) Parameters: $data (string) – Element to return instead of the full array Returns: Information about the uploaded file Return type: mixed This is a helper method that returns an array containing all of the data related to the file you uploaded. Here is the array prototype: Array ( [file_name] => mypic.jpg [file_type] => image/jpeg [file_path] => /path/to/your/upload/ [full_path] => /path/to/your/upload/

CI_Unit_test::use_strict()

use_strict([$state = TRUE]) Parameters: $state (bool) – Strict state flag Return type: void Enables/disables strict type comparison in tests.

CI_Unit_test::run()

run($test[, $expected = TRUE[, $test_name = 'undefined'[, $notes = '']]]) Parameters: $test (mixed) – Test data $expected (mixed) – Expected result $test_name (string) – Test name $notes (string) – Any notes to be attached to the test Returns: Test report Return type: string Runs unit tests.