core/model/modx/modresponse.class.php
MODX Revolution
Copyright 2006-2012 by MODX, LLC. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Package
- modx
\modResponse
Encapsulates a MODX response to a web request.
Includes functions to manipluate header data, such as status codes, as well as manipulating the response body.
Properties

\modContentType
$contentType= 'null'
The current content type on the resource
nullDetails- Type
- \modContentType
Methods

__construct(
\modX $modx
)
:
void| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX instance |

checkPreview(
)
:
booleanChecks to see if the preview parameter is set.
| Type | Description |
|---|---|
| boolean |

outputContent(
array $options
=
array()
)
:
voidPrepare the final response after the resource has been processed.
| Name | Type | Description |
|---|---|---|
| $options | array | Various options that can be set. |

sendRedirect(
string $url, array | boolean $options
=
false, string $type
=
'', string $responseCode
=
''
)
:
void | booleanSends a redirect to the specified URL using the specified method.
Valid $type values include: REDIRECT_REFRESH Uses the header refresh method REDIRECT_META Sends a a META HTTP-EQUIV="Refresh" tag to the output REDIRECT_HEADER Uses the header location method
REDIRECT_HEADER is the default.
| Name | Type | Description |
|---|---|---|
| $url | string | The URL to redirect the client browser to. |
| $options | array | boolean | An array of options for the redirect OR indicates if redirect attempts should be counted and limited to 3 (latter is deprecated usage; use count_attempts in options array). |
| $type | string | The type of redirection to attempt (deprecated, use type in options array). |
| $responseCode | string | The type of HTTP response code HEADER to send for the redirect (deprecated, use responseCode in options array) |
| Type | Description |
|---|---|
| void | boolean |