From b8c283a695c8074a57d8c3dfa00934312638931d Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 19 Jul 2013 16:02:53 -0700 Subject: Dropping unecessary php: directive to function definitions in user guide --- user_guide_src/source/helpers/download_helper.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src/source/helpers/download_helper.rst') diff --git a/user_guide_src/source/helpers/download_helper.rst b/user_guide_src/source/helpers/download_helper.rst index 860c568b9..fd95f4f34 100644 --- a/user_guide_src/source/helpers/download_helper.rst +++ b/user_guide_src/source/helpers/download_helper.rst @@ -18,7 +18,7 @@ The following functions are available: force_download() ================ -.. php:function:: force_download($filename = '', $data = '', $set_mime = FALSE) +.. function:: force_download($filename = '', $data = '', $set_mime = FALSE) :param string $filename: Filename :param mixed $data: File contents -- cgit v1.2.3-24-g4f1b From 7e69feae3f805eafe5f8c4966c1e1b2af79ddbb8 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Sun, 21 Jul 2013 10:57:25 -0700 Subject: Update Download helper docs --- user_guide_src/source/helpers/download_helper.rst | 48 +++++++++++++---------- 1 file changed, 27 insertions(+), 21 deletions(-) (limited to 'user_guide_src/source/helpers/download_helper.rst') diff --git a/user_guide_src/source/helpers/download_helper.rst b/user_guide_src/source/helpers/download_helper.rst index fd95f4f34..17b68f454 100644 --- a/user_guide_src/source/helpers/download_helper.rst +++ b/user_guide_src/source/helpers/download_helper.rst @@ -4,7 +4,12 @@ Download Helper The Download Helper lets you download data to your desktop. -.. contents:: Page Contents +.. contents:: + :local: + +.. raw:: html + +
Loading this Helper =================== @@ -13,38 +18,39 @@ This helper is loaded using the following code:: $this->load->helper('download'); +Available Functions +=================== + The following functions are available: -force_download() -================ -.. function:: force_download($filename = '', $data = '', $set_mime = FALSE) +.. function:: force_download([$filename = ''[, $data = ''[, $set_mime = FALSE]]]) :param string $filename: Filename :param mixed $data: File contents :param bool $set_mime: Whether to try to send the actual MIME type :returns: void -Generates server headers which force data to be downloaded to your -desktop. Useful with file downloads. The first parameter is the **name -you want the downloaded file to be named**, the second parameter is the -file data. + Generates server headers which force data to be downloaded to your + desktop. Useful with file downloads. The first parameter is the **name + you want the downloaded file to be named**, the second parameter is the + file data. -If you set the second parameter to NULL and ``$filename`` is an existing, readable -file path, then its content will be read instead. + If you set the second parameter to NULL and ``$filename`` is an existing, readable + file path, then its content will be read instead. -If you set the third parameter to boolean TRUE, then the actual file MIME type -(based on the filename extension) will be sent, so that if your browser has a -handler for that type - it can use it. + If you set the third parameter to boolean TRUE, then the actual file MIME type + (based on the filename extension) will be sent, so that if your browser has a + handler for that type - it can use it. -Example:: + Example:: - $data = 'Here is some text!'; - $name = 'mytext.txt'; - force_download($name, $data); + $data = 'Here is some text!'; + $name = 'mytext.txt'; + force_download($name, $data); -If you want to download an existing file from your server you'll need to -do the following:: + If you want to download an existing file from your server you'll need to + do the following:: - // Contents of photo.jpg will be automatically read - force_download('/path/to/photo.jpg', NULL); \ No newline at end of file + // Contents of photo.jpg will be automatically read + force_download('/path/to/photo.jpg', NULL); \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 3de130c2da3b93a3404f264e92d7b65354de3548 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 7 Feb 2014 23:31:49 +0200 Subject: [ci skip] Add return types to helper docs (+ some other formatting) --- user_guide_src/source/helpers/download_helper.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src/source/helpers/download_helper.rst') diff --git a/user_guide_src/source/helpers/download_helper.rst b/user_guide_src/source/helpers/download_helper.rst index 17b68f454..f374d491f 100644 --- a/user_guide_src/source/helpers/download_helper.rst +++ b/user_guide_src/source/helpers/download_helper.rst @@ -29,7 +29,7 @@ The following functions are available: :param string $filename: Filename :param mixed $data: File contents :param bool $set_mime: Whether to try to send the actual MIME type - :returns: void + :rtype: void Generates server headers which force data to be downloaded to your desktop. Useful with file downloads. The first parameter is the **name -- cgit v1.2.3-24-g4f1b