summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/libraries/output.rst
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-10-05 23:04:19 +0200
committerAndrey Andreev <narf@devilix.net>2014-10-05 23:04:19 +0200
commit4a485a73d64a8bebc7625aabc5fdc361d5e7dc56 (patch)
treecb18690c4de1c6ca008227260f9dd0cd2b9279d2 /user_guide_src/source/libraries/output.rst
parent39ec29585b7cdca7edc1a0757c913a13a2ee4f85 (diff)
parentd444d445ed0458a352ecb9ff79ffd158677ee805 (diff)
Merge branch 'develop' into feature/session
Diffstat (limited to 'user_guide_src/source/libraries/output.rst')
-rw-r--r--user_guide_src/source/libraries/output.rst26
1 files changed, 25 insertions, 1 deletions
diff --git a/user_guide_src/source/libraries/output.rst b/user_guide_src/source/libraries/output.rst
index e49ea5366..218ec5896 100644
--- a/user_guide_src/source/libraries/output.rst
+++ b/user_guide_src/source/libraries/output.rst
@@ -205,4 +205,28 @@ 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. 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;
+
+ .. note:: Calling this method manually without aborting script execution will result in duplicated output. \ No newline at end of file