File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
docs/development/legacy/libraries Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -158,3 +158,21 @@ Example:
158158 exit;
159159
160160NOTE: ** 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);
You can’t perform that action at this time.
0 commit comments