core/model/modx/modresponse.class.php

Show: inherited
Table of Contents

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

Package: modx

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.

Children
\modConnectorResponse
\modXMLRPCResponse
\modManagerResponse

Properties

Propertypublicstring  $body= 'null'

The body of this response

Default valuenullDetails
Type
string
Propertypublic\modContentType  $contentType= 'null'

The current content type on the resource

Default valuenullDetails
Type
\modContentType
Propertypublicstring  $header= 'null'

The HTTP header for this Response

Default valuenullDetails
Type
string
Propertypublic\modX  $modx= 'null'

A reference to the modX instance

Default valuenullDetails
Type
\modX

Methods

methodpublic__construct( \modX $modx ) : void

Parameters
Name Type Description
$modx \modX

A reference to the modX instance

methodpubliccheckPreview( ) : boolean

Checks to see if the preview parameter is set.

Returns
Type Description
boolean
methodpublicoutputContent( array $options = array() ) : void

Prepare the final response after the resource has been processed.

Parameters
Name Type Description
$options array

Various options that can be set.

methodpublicsendRedirect( string $url, array | boolean $options = false, string $type = '', string $responseCode = '' ) : void | boolean

Sends 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.

Parameters
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)

Returns
Type Description
void | boolean
Documentation was generated by DocBlox 0.18.1.