Response
in package
FinalYes
The (partial) response to a CMSimple_XH page request
This class encapsulates access to some of CMSimple_XH globals, e.g. $o
and $title
, as well as sending of cookies, redirecting to another page,
and generally calls to header()
, and http_response_code()
.
A Response
does not cause any side-effects until it is invoked.
Table of Contents
Methods
- __invoke() : string|never
- attachment() : string|null
- bjs() : string|null
- contentType() : string|null
- cookie() : array{: string, : string, : int}|null
- create() : self
- error() : self
- hjs() : string|null
- length() : int|null
- location() : string|null
- output() : string
- redirect() : self
- status() : int
- title() : string|null
- withAttachment() : self
- withBjs() : self
- withContentType() : self
- withCookie() : self
- Set a cookie for the whole CMSimple_XH installation
- withHjs() : self
- Appends to $hjs
- withLength() : self
- withTitle() : self
Methods
__invoke()
public
__invoke() : string|never
Return values
string|neverattachment()
public
attachment() : string|null
Return values
string|nullbjs()
public
bjs() : string|null
Tags
Return values
string|nullcontentType()
public
contentType() : string|null
Return values
string|nullcookie()
public
cookie() : array{: string, : string, : int}|null
Return values
array{: string, : string, : int}|nullcreate()
public
static create([string $output = "" ]) : self
Parameters
- $output : string = ""
Return values
selferror()
public
static error(int $status[, string $output = "" ]) : self
Parameters
- $status : int
- $output : string = ""
Return values
selfhjs()
public
hjs() : string|null
Tags
Return values
string|nulllength()
public
length() : int|null
Return values
int|nulllocation()
public
location() : string|null
Return values
string|nulloutput()
public
output() : string
Return values
stringredirect()
public
static redirect(string $location) : self
Parameters
- $location : string
Return values
selfstatus()
public
status() : int
Return values
inttitle()
public
title() : string|null
Return values
string|nullwithAttachment()
public
withAttachment(string $attachment) : self
Parameters
- $attachment : string
Return values
selfwithBjs()
public
withBjs(string $bjs) : self
Parameters
- $bjs : string
Tags
Return values
selfwithContentType()
public
withContentType(string $contentType) : self
Parameters
- $contentType : string
Return values
selfwithCookie()
Set a cookie for the whole CMSimple_XH installation
public
withCookie(string $name, string $value, int $expires) : self
Parameters
- $name : string
- $value : string
- $expires : int
Tags
Return values
selfwithHjs()
Appends to $hjs
public
withHjs(string $hjs) : self
This does not work from templates, and therefore is better avoided, but sometimes it is just necessary.
Parameters
- $hjs : string
Tags
Return values
selfwithLength()
public
withLength(int $length) : self
Parameters
- $length : int
Return values
selfwithTitle()
public
withTitle(string $title) : self
Parameters
- $title : string