CodeIgniter Overview

The following pages describe the broad concepts behind CodeIgniter: Getting Started CodeIgniter at a Glance Supported Features Application Flow Chart Model-View-Controller Architectural Goals

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

CodeIgniter at a Glance

CodeIgniter is an Application Framework CodeIgniter is a toolkit for people who build web applications using PHP. Its goal is to enable you to develop projects much faster than you could if you were writing code from scratch, by providing a rich set of libraries for commonly needed tasks, as well as a simple interface and logical structure to access these libraries. CodeIgniter lets you creatively focus on your project by minimizing the amount of code needed for a given task. CodeIgniter is Fre

CI_Zip::read_file()

read_file($path[, $archive_filepath = FALSE]) Parameters: $path (string) – Path to file $archive_filepath (mixed) – New file name/path (string) or (boolean) whether to maintain the original filepath Returns: TRUE on success, FALSE on failure Return type: bool Permits you to compress a file that already exists somewhere on your server. Supply a file path and the zip class will read it and add it to the archive: $path = '/path/to/photo.jpg'; $this->zip->read_file($path); // D

CI_Zip::read_dir()

read_dir($path[, $preserve_filepath = TRUE[, $root_path = NULL]]) Parameters: $path (string) – Path to directory $preserve_filepath (bool) – Whether to maintain the original path $root_path (string) – Part of the path to exclude from the archive directory Returns: TRUE on success, FALSE on failure Return type: bool Permits you to compress a directory (and its contents) that already exists somewhere on your server. Supply a path to the directory and the zip class will recursively r

CI_Zip::get_zip()

get_zip() Returns: Zip file content Return type: string Returns the Zip-compressed file data. Generally you will not need this method unless you want to do something unique with the data. Example: $name = 'my_bio.txt'; $data = 'I was born in an elevator...'; $this->zip->add_data($name, $data); $zip_file = $this->zip->get_zip();

CI_Zip::download()

download($filename = 'backup.zip') Parameters: $filename (string) – Archive file name Return type: void Causes the Zip file to be downloaded from your server. You must pass the name you would like the zip file called. Example: $this->zip->download('latest_stuff.zip'); // File will be named "latest_stuff.zip" Note Do not display any data in the controller in which you call this method since it sends various server headers that cause the download to happen and the file to be tre

CI_Zip::clear_data()

clear_data() Return type: void The Zip class caches your zip data so that it doesn’t need to recompile the Zip archive for each method you use above. If, however, you need to create multiple Zip archives, each with different data, you can clear the cache between calls. Example: $name = 'my_bio.txt'; $data = 'I was born in an elevator...'; $this->zip->add_data($name, $data); $zip_file = $this->zip->get_zip(); $this->zip->clear_data(); $name = 'photo.jpg'; $this->zip-

CI_Zip::archive()

archive($filepath) Parameters: $filepath (string) – Path to target zip archive Returns: TRUE on success, FALSE on failure Return type: bool Writes the Zip-encoded file to a directory on your server. Submit a valid server path ending in the file name. Make sure the directory is writable (755 is usually OK). Example: $this->zip->archive('/path/to/folder/myarchive.zip'); // Creates a file named myarchive.zip

CI_Zip::add_dir()

add_dir($directory) Parameters: $directory (mixed) – Directory name string or an array of multiple directories Return type: void Permits you to add a directory. Usually this method is unnecessary since you can place your data into directories when using $this->zip->add_data(), but if you would like to create an empty directory you can do so: $this->zip->add_dir('myfolder'); // Creates a directory called "myfolder"