We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5946f37 commit f907b58Copy full SHA for f907b58
1 file changed
docs/development/legacy/libraries/output.md
@@ -158,3 +158,21 @@ Example:
158
exit;
159
160
NOTE: **Note:** Calling this method manually without aborting script execution will result in duplicated output.
161
+
162
+### `send_ajax_response($msg, [$error = false])`
163
164
+| Parameter | Type | Description |
165
+| --------- | -------- | -------------------- |
166
+| \$msg | `Array` | Object to be sent to the client. |
167
+| \$error | `Bool` | TRUE to set header status to `500` |
168
+| Returns | `Void` | void |
169
170
+Calling this method encode the given `$msg` parameter and will set the header `Content-Type: application/json`.
171
172
+Example:
173
174
+ $output = array(
175
+ 'this' => 'that',
176
+ 'foo' => 'bar'
177
+ );
178
+ ee()->output->send_ajax_response($output);
0 commit comments