summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradmin <devnull@localhost>2006-10-01 21:26:15 +0200
committeradmin <devnull@localhost>2006-10-01 21:26:15 +0200
commit73fbde21123ed1c34517b4e24fc36a1ed47a96b0 (patch)
treeabe4afff6901e033a7b3380b413f276fb17554c4
parent33dd95d7cb8ac2f6b8da447966a750bdb064fc48 (diff)
-rw-r--r--user_guide/libraries/zip.html14
1 files changed, 12 insertions, 2 deletions
diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html
index 3c3e44b83..1994e3462 100644
--- a/user_guide/libraries/zip.html
+++ b/user_guide/libraries/zip.html
@@ -71,7 +71,7 @@ Zip Encoding Class
<code>$this->load->library('zip');</code>
<p>Once loaded, the Parser library object will be available using: <dfn>$this->zip</dfn></p>
-<h2>Usage Example</h2>
+<h2>Usage Examples</h2>
<p>Simple example demonstrating how to compress a file and download it to your desktop.</p>
@@ -104,9 +104,19 @@ $this->zip->add_data($name, $data);<br />
$this->zip->download('my_backup.zip'); // Parameter contains name of the downloaded file
</code>
+<p>You can also pass your file data as an array:</p>
-
+<code>
+$data = array(<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'myfolder/mydata1.txt' => 'A Data String!',<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'myfolder/mydata2.txt' => 'Another Data String!'<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
+<br />
+$this->zip->add_data($data);<br />
+<br />
+$this->zip->download('my_backup.zip'); // Parameter contains name of the downloaded file
+</code>