From 93c09877da81323e083322126d9d02b97a9583d1 Mon Sep 17 00:00:00 2001 From: Ahmad Anbar Date: Sat, 31 May 2014 18:52:13 +0300 Subject: Added _display documentation. --- user_guide_src/source/libraries/output.rst | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/libraries/output.rst b/user_guide_src/source/libraries/output.rst index e49ea5366..c3f948805 100644 --- a/user_guide_src/source/libraries/output.rst +++ b/user_guide_src/source/libraries/output.rst @@ -205,4 +205,32 @@ Class Reference Caches the current page for the specified amount of seconds. - For more information, please see the :doc:`caching documentation <../general/caching>`. \ No newline at end of file + For more information, please see the :doc:`caching documentation <../general/caching>`. + + .. method:: _display([$output='']) + + :param string $output: Output data override + :returns: void + :rtype: void + + sends finalized output data to the browser along with any server headers and profile data. It also stops benchmark + timers so the page rendering speed and memory usage can be shown. + + :: + + $this->output->_display(); + + .. note:: This method is called automatically at the end of script execution, you won't need to call it manually unless + you are aborting script execution using ``exit()`` or ``die()`` in your code. + + :: + $response = array('status' => 'OK'); + + $this->output + ->set_status_header(200) + ->set_content_type('application/json', 'utf-8') + ->set_output(json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)) + ->_display(); + exit(); + + .. note:: Calling this method manually without aborting script execution will result in a duplicated output. \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 054bbe8f16f14cd817d4a7e3b6b440ddc2be8245 Mon Sep 17 00:00:00 2001 From: Ahmad Anbar Date: Sun, 1 Jun 2014 12:20:08 +0300 Subject: Fixed code style. --- user_guide_src/source/libraries/output.rst | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/libraries/output.rst b/user_guide_src/source/libraries/output.rst index c3f948805..5c82e455a 100644 --- a/user_guide_src/source/libraries/output.rst +++ b/user_guide_src/source/libraries/output.rst @@ -207,30 +207,26 @@ Class Reference For more information, please see the :doc:`caching documentation <../general/caching>`. - .. method:: _display([$output='']) + .. method:: _display([$output = '']) :param string $output: Output data override :returns: void :rtype: void - sends finalized output data to the browser along with any server headers and profile data. It also stops benchmark - timers so the page rendering speed and memory usage can be shown. - - :: - - $this->output->_display(); + Sends finalized output data to the browser along with any server headers. It also stops benchmark + timers. .. note:: This method is called automatically at the end of script execution, you won't need to call it manually unless you are aborting script execution using ``exit()`` or ``die()`` in your code. - :: + Example:: $response = array('status' => 'OK'); $this->output - ->set_status_header(200) - ->set_content_type('application/json', 'utf-8') - ->set_output(json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)) - ->_display(); - exit(); + ->set_status_header(200) + ->set_content_type('application/json', 'utf-8') + ->set_output(json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)) + ->_display(); + exit; - .. note:: Calling this method manually without aborting script execution will result in a duplicated output. \ No newline at end of file + .. note:: Calling this method manually without aborting script execution will result in duplicated output. \ No newline at end of file -- cgit v1.2.3-24-g4f1b From e06c5c4f04583eddf35aa8549ca16ed11e2503bf Mon Sep 17 00:00:00 2001 From: Ahmad Anbar Date: Sun, 1 Jun 2014 12:22:12 +0300 Subject: reduced line length. --- user_guide_src/source/libraries/output.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/libraries/output.rst b/user_guide_src/source/libraries/output.rst index 5c82e455a..218ec5896 100644 --- a/user_guide_src/source/libraries/output.rst +++ b/user_guide_src/source/libraries/output.rst @@ -216,8 +216,8 @@ Class Reference Sends finalized output data to the browser along with any server headers. It also stops benchmark timers. - .. note:: This method is called automatically at the end of script execution, you won't need to call it manually unless - you are aborting script execution using ``exit()`` or ``die()`` in your code. + .. note:: This method is called automatically at the end of script execution, you won't need to + call it manually unless you are aborting script execution using ``exit()`` or ``die()`` in your code. Example:: $response = array('status' => 'OK'); -- cgit v1.2.3-24-g4f1b