CI_Unit_test::set_template()

set_template($template) Parameters: $template (string) – Test result template Return type: void Sets the template for displaying tests results.

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'

CI_DB_query_builder::group_start()

group_start() Returns: CI_DB_query_builder instance (method chaining) Return type: CI_DB_query_builder Starts a group expression, using ANDs for the conditions inside it.

CI_Security::get_csrf_token_name()

get_csrf_token_name() Returns: CSRF token name Return type: string Returns the CSRF token name (the $config['csrf_token_name'] value).

CI_Cart

class CI_Cart $product_id_rules = '.a-z0-9_-' These are the regular expression rules that we use to validate the product ID - alpha-numeric, dashes, underscores, or periods by default $product_name_rules = 'w -.:' These are the regular expression rules that we use to validate the product ID and product name - alpha-numeric, dashes, underscores, colons or periods by default $product_name_safe = TRUE Whether or not to only allow safe product names. Default TRUE. insert([$ite

Running via the CLI

As well as calling an applications Controllers via the URL in a browser they can also be loaded via the command-line interface (CLI). Page Contents Running via the CLIWhat is the CLI? Why run via the command-line? Let’s try it: Hello World! That’s it! What is the CLI? The command-line interface is a text-based method of interacting with computers. For more information, check the Wikipedia article. Why run via the command-line? There are many reasons for running CodeIgniter from the command-

CI_Zip

class CI_Zip $compression_level = 2 The compression level to use. It can range from 0 to 9, with 9 being the highest and 0 effectively disabling compression: $this->zip->compression_level = 0; add_data($filepath[, $data = NULL]) Parameters: $filepath (mixed) – A single file path or an array of file => data pairs $data (array) – File contents (ignored if $filepath is an array) Return type: void Adds data to the Zip archive. Can work both in single and multiple files m

CI_Calendar

class CI_Calendar initialize([$config = array()]) Parameters: $config (array) – Configuration parameters Returns: CI_Calendar instance (method chaining) Return type: CI_Calendar Initializes the Calendaring preferences. Accepts an associative array as input, containing display preferences. generate([$year = ''[, $month = ''[, $data = array()]]]) Parameters: $year (int) – Year $month (int) – Month $data (array) – Data to be shown in the calendar cells Returns: HTML-format

Database Configuration

CodeIgniter has a config file that lets you store your database connection values (username, password, database name, etc.). The config file is located at application/config/database.php. You can also set database connection values for specific environments by placing database.php in the respective environment config folder. The config settings are stored in a multi-dimensional array with this prototype: $db['default'] = array( 'dsn' => '', 'hostname' => 'localhost',

CI_DB_driver::update_string()

update_string($table, $data, $where) Parameters: $table (string) – The target table $data (array) – An associative array of key/value pairs $where (mixed) – The WHERE statement conditions Returns: The SQL UPDATE statement, as a string Return type: string Generate an UPDATE statement string.