CI_DB_forge::add_key()

add_key($key[, $primary = FALSE]) Parameters: $key (array) – Name of a key field $primary (bool) – Set to TRUE if it should be a primary key or a regular one Returns: CI_DB_forge instance (method chaining) Return type: CI_DB_forge Adds a key to the set that will be used to create a table. Usage: See Adding Keys.

CI_Calendar::get_total_days()

get_total_days($month, $year) Parameters: $month (int) – Month $year (int) – Year Returns: Count of days in the specified month Return type: int Total days in a given month: echo $this->calendar->get_total_days(2, 2012); // 29 Note This method is an alias for Date Helper function days_in_month().

CI_DB_utility

class CI_DB_utility backup([$params = array()]) Parameters: $params (array) – An associative array of options Returns: raw/(g)zipped SQL query string Return type: string Perform a database backup, per user preferences. database_exists($database_name) Parameters: $database_name (string) – Database name Returns: TRUE if the database exists, FALSE otherwise Return type: bool Check for the existence of a database. list_databases() Returns: Array of database names fou

CI_User_agent::is_browser()

is_browser([$key = NULL]) Parameters: $key (string) – Optional browser name Returns: TRUE if the user agent is a (specified) browser, FALSE if not Return type: bool Returns TRUE/FALSE (boolean) if the user agent is a known web browser. if ($this->agent->is_browser('Safari')) { echo 'You are using Safari.'; } elseif ($this->agent->is_browser()) { echo 'You are using a browser.'; } Note The string “Safari” in this example is an array key in the list of br

CodeIgniter Features

Features in and of themselves are a very poor way to judge an application since they tell you nothing about the user experience, or how intuitively or intelligently it is designed. Features don’t reveal anything about the quality of the code, or the performance, or the attention to detail, or security practices. The only way to really judge an app is to try it and get to know the code. Installing CodeIgniter is child’s play so we encourage you to do just that. In the mean time here’s a list of

CI_Cart::insert()

insert([$items = array()]) Parameters: $items (array) – Items to insert into the cart Returns: TRUE on success, FALSE on failure Return type: bool Insert items into the cart and save it to the session table. Returns TRUE on success and FALSE on failure.

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_Input::server()

server($index[, $xss_clean = NULL]) Parameters: $index (mixed) – Value name $xss_clean (bool) – Whether to apply XSS filtering Returns: $_SERVER item value if found, NULL if not Return type: mixed This method is identical to the post(), get() and cookie() methods, only it fetches server data ($_SERVER): $this->input->server('some_data'); To return an array of multiple $_SERVER values, pass all the required keys as an array. $this->input->server(array('SERVER_PROTOCOL',

CI_DB_forge::drop_database()

drop_database($db_name) Parameters: $db_name (string) – Name of the database to drop Returns: TRUE on success, FALSE on failure Return type: bool Drops a database. Usage: See Creating and Dropping Databases.

auto_typography()

auto_typography($str[, $reduce_linebreaks = FALSE]) Parameters: $str (string) – Input string $reduce_linebreaks (bool) – Whether to reduce multiple instances of double newlines to two Returns: HTML-formatted typography-safe string Return type: string Formats text so that it is semantically and typographically correct HTML. This function is an alias for CI_Typography::auto_typography(). For more info, please see the Typography Library documentation. Usage example: $string = auto_typ