Plib_XH

Request
in package

A request to a CMSimple_XH page

This encapsulates the request super-globals $_GET, $_POST and $_COOKIE as well as some CMSimple_XH specifics, such as XH_ADM and $sl.

Tags
final

Table of Contents

Methods

admin()  : bool
Whether the user is logged in as administrator
cookie()  : string|null
current()  : self
edit()  : bool
Wraps $edit
file()  : UploadedFile|null
Retrieves information about an uploaded file
get()  : string|null
getArray()  : array<string|int, string>|null
header()  : string|null
Retrieves an HTTP request header
language()  : string
post()  : string|null
postArray()  : array<string|int, string>|null
remoteAddr()  : string
s()  : int
The selected page ($s)
selected()  : string
The selected URL ($su)
time()  : int
url()  : Url
username()  : string|null
The name of the currently logged in user

Methods

public cookie(string $key) : string|null
Parameters
$key : string
Return values
string|null

current()

public static current() : self
Return values
self

edit()

Wraps $edit

public edit() : bool
Tags
since
1.2
Return values
bool

file()

Retrieves information about an uploaded file

public file(string $key) : UploadedFile|null

This is basically a wrapper over $_FILES. For now, only simple $keys are supported, i.e. no arrays. If the file referred to by $key has been uploaded, an UploadedFile instance is returned. Otherwise null is returned.

Parameters
$key : string
Tags
since
1.5
Return values
UploadedFile|null

get()

public get(string $key) : string|null
Parameters
$key : string
Return values
string|null

getArray()

public getArray(string $key) : array<string|int, string>|null
Parameters
$key : string
Tags
since
1.6
Return values
array<string|int, string>|null

header()

Retrieves an HTTP request header

public header(string $key) : string|null
Parameters
$key : string
Tags
since
1.1
Return values
string|null

language()

public language() : string
Return values
string

post()

public post(string $key) : string|null
Parameters
$key : string
Return values
string|null

postArray()

public postArray(string $key) : array<string|int, string>|null
Parameters
$key : string
Tags
since
1.2
Return values
array<string|int, string>|null

remoteAddr()

public remoteAddr() : string
Tags
since
1.2
Return values
string

s()

The selected page ($s)

public s() : int
Tags
since
1.6
Return values
int

selected()

The selected URL ($su)

public selected() : string
Tags
since
1.2
Return values
string

time()

public time() : int
Return values
int

username()

The name of the currently logged in user

public username() : string|null

This currently supports Register_XH and Memberpages. If no user is logged in, null is returned. This method is completely orthogonal to Request::admin(); a user may be logged in simultaneously as member and admin.

Tags
since
1.6
Return values
string|null

        
On this page

Search results