summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/libraries
diff options
context:
space:
mode:
authorAhmad Anbar <aanbar@gmail.com>2014-05-31 17:52:13 +0200
committerAhmad Anbar <aanbar@gmail.com>2014-05-31 17:52:13 +0200
commit93c09877da81323e083322126d9d02b97a9583d1 (patch)
treea16ee75a3d568f8fbf508b1836c71824c5109344 /user_guide_src/source/libraries
parent8be0e65ed4c1c4f122a11077ef2a9f91a1d15f98 (diff)
Added _display documentation.
Diffstat (limited to 'user_guide_src/source/libraries')
-rw-r--r--user_guide_src/source/libraries/output.rst30
1 files changed, 29 insertions, 1 deletions
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