Plib_XH

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|never

attachment()

public attachment() : string|null
Return values
string|null

bjs()

public bjs() : string|null
Tags
since
1.2
Return values
string|null

contentType()

public contentType() : string|null
Return values
string|null
public cookie() : array{: string, : string, : int}|null
Return values
array{: string, : string, : int}|null

create()

public static create([string $output = "" ]) : self
Parameters
$output : string = ""
Return values
self

error()

public static error(int $status[, string $output = "" ]) : self
Parameters
$status : int
$output : string = ""
Return values
self

hjs()

public hjs() : string|null
Tags
since
1.3
Return values
string|null

length()

public length() : int|null
Return values
int|null

location()

public location() : string|null
Return values
string|null

output()

public output() : string
Return values
string

redirect()

public static redirect(string $location) : self
Parameters
$location : string
Return values
self

status()

public status() : int
Return values
int

title()

public title() : string|null
Return values
string|null

withAttachment()

public withAttachment(string $attachment) : self
Parameters
$attachment : string
Return values
self

withBjs()

public withBjs(string $bjs) : self
Parameters
$bjs : string
Tags
since
1.2
Return values
self

withContentType()

public withContentType(string $contentType) : self
Parameters
$contentType : string
Return values
self

withCookie()

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
link
https://github.com/cmb69/plib_xh/issues/1
Return values
self

withHjs()

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
since
1.3
Return values
self

withLength()

public withLength(int $length) : self
Parameters
$length : int
Return values
self

withTitle()

public withTitle(string $title) : self
Parameters
$title : string
Return values
self

        
On this page

Search results