validation_errors()

validation_errors([$prefix = ''[, $suffix = '']]) Parameters: $prefix (string) – Error opening tag $suffix (string) – Error closing tag Returns: HTML-formatted form validation error message(s) Return type: string Similarly to the form_error() function, returns all validation error messages produced by the Form Validation Library, with optional opening and closing tags around each of the messages. Example: echo validation_errors('<span class="error">', '</span>'); /*

URI Routing

Typically there is a one-to-one relationship between a URL string and its corresponding controller class/method. The segments in a URI normally follow this pattern: example.com/class/function/id/ In some instances, however, you may want to remap this relationship so that a different class/method can be called instead of the one corresponding to the URL. For example, let’s say you want your URLs to have this prototype: example.com/product/1/ example.com/product/2/ example.com/product/3/ example

uri_string()

uri_string() Returns: An URI string Return type: string 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: blog/comments/123 This function is an alias for CI_Config::uri_string(). For more info, please see the Config Library documentation.

Using CodeIgniter Drivers

Drivers are a special type of Library that has a parent class and any number of potential child classes. Child classes have access to the parent class, but not their siblings. Drivers provide an elegant syntax in your controllers for libraries that benefit from or require being broken down into discrete classes. Drivers are found in the system/libraries/ directory, in their own sub-directory which is identically named to the parent library class. Also inside that directory is a subdirectory nam

url_title()

url_title($str, $separator = '-', $lowercase = FALSE) Parameters: $str (string) – Input string $separator (string) – Word separator $lowercase (bool) – Whether to transform the output string to lower-case Returns: URL-formatted string Return type: string 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: $title = "What's wrong with CSS?"; $url_tit

Upgrading From a Previous Version

Please read the upgrade notes corresponding to the version you are upgrading from. Upgrading from 3.0.6 to 3.1.0 Upgrading from 3.0.5 to 3.0.6 Upgrading from 3.0.4 to 3.0.5 Upgrading from 3.0.3 to 3.0.4 Upgrading from 3.0.2 to 3.0.3 Upgrading from 3.0.1 to 3.0.2 Upgrading from 3.0.0 to 3.0.1 Upgrading from 2.2.x to 3.0.x Upgrading from 2.2.2 to 2.2.3 Upgrading from 2.2.1 to 2.2.2 Upgrading from 2.2.0 to 2.2.1 Upgrading from 2.1.4 to 2.2.x Upgrading from 2.1.3 to 2.1.4

unix_to_human()

unix_to_human([$time = ''[, $seconds = FALSE[, $fmt = 'us']]]) Parameters: $time (int) – UNIX timestamp $seconds (bool) – Whether to show seconds $fmt (string) – format (us or euro) Returns: Formatted date Return type: string Takes a UNIX timestamp as input and returns it in a human readable format with this prototype: YYYY-MM-DD HH:MM:SS AM/PM 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 i

underscore()

underscore($str) Parameters: $str (string) – Input string Returns: String containing underscores instead of spaces Return type: string Takes multiple words separated by spaces and underscores them. Example: echo underscore('my dog spot'); // Prints 'my_dog_spot'

ul()

ul($list[, $attributes = '']) Parameters: $list (array) – List entries $attributes (array) – HTML attributes Returns: HTML-formatted unordered list Return type: string Permits you to generate unordered HTML lists from simple or multi-dimensional arrays. Example: $list = array( 'red', 'blue', 'green', 'yellow' ); $attributes = array( 'class' => 'boldlist', 'id' => 'mylist' ); echo ul($list, $attributes); The above code will

Transactions

CodeIgniter’s database abstraction allows you to use transactions with databases that support transaction-safe table types. In MySQL, you’ll need to be running InnoDB or BDB table types rather than the more common MyISAM. Most other database platforms support transactions natively. If you are not familiar with transactions we recommend you find a good online resource to learn about them for your particular database. The information below assumes you have a basic understanding of transactions. C