CI_Loader::file()

file($path[, $return = FALSE]) Parameters: $path (string) – File path $return (bool) – Whether to return the loaded file Returns: File contents if $return is set to TRUE, otherwise CI_Loader instance (method chaining) Return type: mixed This is a generic file loading method. Supply the filepath and name in the first parameter and it will open and read the file. By default the data is sent to your browser, just like a View file, but if you set the second parameter to boolean TRUE it

CI_DB_driver::trans_status()

trans_status() Returns: TRUE if the transaction succeeded, FALSE if it failed Return type: bool Lets you retrieve the transaction status flag to determine if it has failed.

CI_Security::get_random_bytes()

get_random_bytes($length) Parameters: $length (int) – Output length Returns: A binary stream of random bytes or FALSE on failure Return type: string A convenience method for getting proper random bytes via mcrypt_create_iv(), /dev/urandom or openssl_random_pseudo_bytes() (in that order), if one of them is available. Used for generating CSRF and XSS tokens. Note The output is NOT guaranteed to be cryptographically secure, just the best attempt at that.

CI_DB_query_builder::like()

like($field[, $match = ''[, $side = 'both'[, $escape = NULL]]]) Parameters: $field (string) – Field name $match (string) – Text portion to match $side (string) – Which side of the expression to put the ‘%’ wildcard on $escape (bool) – Whether to escape values and identifiers Returns: CI_DB_query_builder instance (method chaining) Return type: CI_DB_query_builder Adds a LIKE clause to a query, separating multiple calls with AND.

form_upload()

form_upload([$data = ''[, $value = ''[, $extra = '']]]) Parameters: $data (array) – Field attributes data $value (string) – Field value $extra (mixed) – Extra attributes to be added to the tag either as an array or a literal string Returns: An HTML file upload input field tag Return type: string This function is identical in all respects to the form_input() function above except that it uses the “file” input type, allowing it to be used to upload files.

get_mimes()

get_mimes() Returns: An associative array of file types Return type: array This function returns a reference to the MIMEs array from application/config/mimes.php.

CI_DB_driver::db_connect()

db_connect($persistent = TRUE) Parameters: $persistent (bool) – Whether to establish a persistent connection or a regular one Returns: Database connection resource/object or FALSE on failure Return type: mixed Establish a connection with the database. Note The returned value depends on the underlying driver in use. For example, a mysqli instance will be returned with the ‘mysqli’ driver.

set_realpath()

set_realpath($path[, $check_existance = FALSE]) Parameters: $path (string) – Path $check_existance (bool) – Whether to check if the path actually exists Returns: An absolute path Return type: string This function will return a server path without symbolic links or relative directory structures. An optional second argument will cause an error to be triggered if the path cannot be resolved. Examples: $file = '/etc/php5/apache2/php.ini'; echo set_realpath($file); // Prints '/etc/php5/

CI_Benchmark::memory_usage()

memory_usage() Returns: Memory usage info Return type: string Simply returns the {memory_usage} marker. This permits it to be put it anywhere in a template without the memory being calculated until the end. The Output Class will swap the real value for this variable.

current_url()

current_url() Returns: The current URL Return type: string Returns the full URL (including segments) of the page being currently viewed. Note Calling this function is the same as doing this: | | site_url(uri_string());