diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-06-11 10:44:52 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-06-11 10:44:52 +0200 |
commit | 6b5ee00bb10dc073c3d70aa7b218efa9265933c5 (patch) | |
tree | a12fb3fcbdb92dd94264f671dac953c128b478e2 /system | |
parent | 4db16326a0418776f10802ecdcccb385ff67e363 (diff) | |
parent | 0ee287ea08de5f3098a27230dcd8ca242b2eb793 (diff) |
Merge pull request #1454 from IT-Can/upload-index-1453
Upload library: data() index support
Diffstat (limited to 'system')
-rw-r--r-- | system/libraries/Upload.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 1f6aeeb6b..c96daaf15 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -347,11 +347,12 @@ class CI_Upload { * Returns an associative array containing all of the information * related to the upload, allowing the developer easy access in one array. * - * @return array + * @param string + * @return mixed */ - public function data() + public function data($index = NULL) { - return array( + $data = array( 'file_name' => $this->file_name, 'file_type' => $this->file_type, 'file_path' => $this->upload_path, @@ -367,6 +368,13 @@ class CI_Upload { 'image_type' => $this->image_type, 'image_size_str' => $this->image_size_str, ); + + if ( ! empty($index)) + { + return isset($data[$index]) ? $data[$index] : NULL; + } + + return $data; } // -------------------------------------------------------------------- |