CI_Email::send()

send([$auto_clear = TRUE]) Parameters: $auto_clear (bool) – Whether to clear message data automatically Returns: TRUE on success, FALSE on failure Return type: bool The e-mail sending method. Returns boolean TRUE or FALSE based on success or failure, enabling it to be used conditionally: if ( ! $this->email->send()) { // Generate error } This method will automatically clear all parameters if the request was successful. To stop this behaviour pass FALSE: if ($this->

base_url()

base_url($uri = '', $protocol = NULL) Parameters: $uri (string) – URI string $protocol (string) – Protocol, e.g. ‘http’ or ‘https’ Returns: Base URL Return type: string Returns your site base URL, as specified in your config file. Example: echo base_url(); This function returns the same thing as site_url(), without the index_page or url_suffix being appended. Also like site_url(), you can supply segments as a string or an array. Here is a string example: echo base_url("blog/post/1

is_cli()

is_cli() Returns: TRUE if currently running under CLI, FALSE otherwise Return type: bool Returns TRUE if the application is run through the command line and FALSE if not. Note This function checks both if the PHP_SAPI value is ‘cli’ or if the STDIN constant is defined.

CI_Email::set_header()

set_header($header, $value) Parameters: $header (string) – Header name $value (string) – Header value Returns: CI_Email instance (method chaining) Return type: CI_Email Appends additional headers to the e-mail: $this->email->set_header('Header1', 'Value1'); $this->email->set_header('Header2', 'Value2');

CI_DB_query_builder::insert_batch()

insert_batch($table[, $set = NULL[, $escape = NULL[, $batch_size = 100]]]) Parameters: $table (string) – Table name $set (array) – Data to insert $escape (bool) – Whether to escape values and identifiers $batch_size (int) – Count of rows to insert at once Returns: Number of rows inserted or FALSE on failure Return type: mixed Compiles and executes batch INSERT statements. Note When more than $batch_size rows are provided, multiple INSERT queries will be executed, each trying to

CI_FTP::move()

move($old_file, $new_file) Parameters: $old_file (string) – Old file name $new_file (string) – New file name Returns: TRUE on success, FALSE on failure Return type: bool Lets you move a file. Supply the source and destination paths: // Moves blog.html from "joe" to "fred" $this->ftp->move('/public_html/joe/blog.html', '/public_html/fred/blog.html'); Note If the destination file name is different the file will be renamed.

Hooks - Extending the Framework Core

CodeIgniter’s Hooks feature provides a means to tap into and modify the inner workings of the framework without hacking the core files. When CodeIgniter runs it follows a specific execution process, diagramed in the Application Flow page. There may be instances, however, where you’d like to cause some action to take place at a particular stage in the execution process. For example, you might want to run a script right before your controllers get loaded, or right after, or you might want to trig

CI_Email::set_alt_message()

set_alt_message($str) Parameters: $str (string) – Alternative e-mail message body Returns: CI_Email instance (method chaining) Return type: CI_Email Sets the alternative e-mail 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 message with no HTML formatting which is added to the header string for people who do not accept HTML

CI_Email::message()

message($body) Parameters: $body (string) – E-mail message body Returns: CI_Email instance (method chaining) Return type: CI_Email Sets the e-mail message body: $this->email->message('This is my message');

CI_Encrypt::encode_from_legacy()

encode_from_legacy($string[, $legacy_mode = MCRYPT_MODE_ECB[, $key = '']]) Parameters: $string (string) – String to encrypt $legacy_mode (int) – Valid PHP MCrypt cipher constant $key (string) – Encryption key Returns: Newly encrypted string Return type: string Enables you to re-encode data that was originally encrypted with CodeIgniter 1.x to be compatible with the Encrypt library in CodeIgniter 2.x. It is only necessary to use this method if you have encrypted data stored permane