public abstract class Page

class.page.php #9

Page is an abstract class that holds an object representation of a page's headers.

Constants

public static
class.page.php #42
static integer HTTP_NOT_MODIFIED = 304

Refers to the HTTP status code, 304 Not Modified

public static
class.page.php #50
static integer HTTP_STATUS_BAD_REQUEST = 400

Refers to the HTTP status code, 400 Bad Request

public static
class.page.php #82
static integer HTTP_STATUS_ERROR = 500

Refers to the HTTP status code, 500 Internal Server Error

public static
class.page.php #66
static integer HTTP_STATUS_FORBIDDEN = 403

Refers to the HTTP status code, 403 Forbidden

public static
class.page.php #34
static integer HTTP_STATUS_FOUND = 302

Refers to the HTTP status code, 302 Found This is used as a temporary redirect

public static
class.page.php #25
static integer HTTP_STATUS_MOVED_PERMANENT = 301

Refers to the HTTP status code, 301 Moved Permanently

public static
class.page.php #74
static integer HTTP_STATUS_NOT_FOUND = 404

Refers to the HTTP status code, 404 Not Found

public static
class.page.php #17
static integer HTTP_STATUS_OK = 200

Refers to the HTTP status code, 200 OK

public static
class.page.php #58
static integer HTTP_STATUS_UNAUTHORIZED = 401

Refers to the HTTP status code, 401 Unauthorized

Properties

public static
class.page.php #90
static array $HTTP_STATUSES

Keyed array of all the string

Methods

void __construct()

Initialises the Page object by setting the headers to empty

void addHeaderToPage(string $name, string $value, integer $response_code)

Adds a header to the $_headers array using the $name as the key.

Parameters
  • $name stringThe header name, eg. Content-Type.

  • $value string(optional) The value for the header, eg. text/xml. Defaults to null.

  • $response_code integer(optional) The HTTP response code that should be set by PHP with this header, eg. 200

void generate(mixed $page)

This function calls __renderHeaders().

See Also
public static
class.page.php #154
static string getHeaderStatusString(integer $status_code)

This method format the provided $status_code to used php's header() function.

Parameters
  • $status_code integerThe HTTP Status code to get the value for

Returns

The formatted HTTP Status string

integer getHttpStatusCode()

Gets the current HTTP Status. If none is set, it assumes HTTPSTATUSOK

public static
class.page.php #134
static array|string getHttpStatusValue(integer $status_code)

This method returns the string HTTP Status value. If $status_code is null, it returns all the values currently registered.

Parameters
  • $status_code integer(optional) The HTTP Status code to get the value for.

Returns

Returns string if the $status_code is not null. Array otherwise

See Also
array headers()

Accessor function for $_headers

void isRequestValid()

This function will check to ensure that this post request is not larger than what the server is set to handle. If it is, a notice is shown.

See Also
void removeHeaderFromPage(string $name)

Removes a header from the $_headers array using the $name as the key.

Parameters
  • $name stringThe header name, eg. Expires.

public static
class.page.php #282
static void renderStatusCode(integer $status_code)

This method calls php's header() function in order to set the HTTP status code properly on all platforms.

See Also
void setHttpStatus(integer $status_code)

Shorthand for addHeaderToPage in order to set the HTTP Status header.

Parameters
  • $status_code integerThe HTTP Status numeric value.

public static
class.page.php #174
static void setHttpStatusValue(integer $status_code, string $string_value)

Sets the $sting_value for the specified $status_code. If $sting_value is null, the $status_code is removed from the array.

This allow developers to register customs HTTP_STATUS into the static Page::$HTTP_STATUSES array and use $page->setHttpStatus().

Parameters
  • $status_code integerThe HTTP Status numeric code.

  • $string_value stringThe HTTP Status string value.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details