Alpha ZealPHP is early-stage and under active development. APIs may change between minor versions until v1.0. Feedback and bug reports welcome on GitHub.
API Index — Namespaces, Packages, Reports, Indices

Request extends Request
in package

Table of Contents

Properties

$cookie  : array<string, string>|null
$files  : array<string, mixed>|null
$get  : array<string, mixed>|null
$header  : array<string, string>|null
$parent  : Request
$post  : array<string, mixed>|null
$server  : array<string, mixed>|null
$tmpfiles  : array<string, mixed>|null

Methods

__call()  : mixed
Forward method calls to the underlying OpenSwoole request.
__construct()  : mixed
__get()  : mixed
Proxy property reads to the underlying OpenSwoole request.
__set()  : mixed
Proxy property writes to the underlying OpenSwoole request.
create()  : bool
getContent()  : string|false
getData()  : string|false
getHeader()  : array<string, string>|false
getMethod()  : array<string, string>|false
htmxCurrentUrl()  : string|null
Returns the HX-Current-URL browser URL, or null if absent.
htmxPrompt()  : string|null
Returns the HX-Prompt user response string, or null if absent.
htmxRequestType()  : string|null
The HX-Request-Type header (htmx 4): 'full' when the response replaces the body (or uses hx-select), 'partial' otherwise; null when absent.
htmxSource()  : string|null
The raw HX-Source header (htmx 4): the triggering element as tag#id, or null.
htmxTarget()  : string|null
The target element's id, or null if absent or the target has no id.
htmxTrigger()  : string|null
The triggering element's id, or null if absent or it has no id: htmx 2's HX-Trigger, else the id part of htmx 4's HX-Source.
htmxTriggerName()  : string|null
Returns the HX-Trigger-Name element name (htmx 2 only), or null if absent.
htmxVersion()  : int|null
Which htmx sent the request: 4 when it carries HX-Request-Type (only htmx 4 sends it), 2 for any other htmx request, null for a non-htmx one.
isBoosted()  : bool
Returns true when the request was issued via hx-boost.
isCompleted()  : bool
isHistoryRestoreRequest()  : bool
Returns true when the request is a history-restoration miss.
isHtmx()  : bool
Returns true when the request carries HX-Request: true.
parse()  : bool
rawContent()  : string|null
elementId()  : string|null
The id in an htmx element identifier: main (htmx 2) or div#main (htmx 4) → main; a bare tag from htmx 4 (div, element without id) → null.

Properties

public array<string, string>|null $cookie

$files

public array<string, mixed>|null $files

$get

public array<string, mixed>|null $get

$header

public array<string, string>|null $header

$post

public array<string, mixed>|null $post

$server

public array<string, mixed>|null $server

$tmpfiles

public array<string, mixed>|null $tmpfiles

Methods

__call()

Forward method calls to the underlying OpenSwoole request.

public __call(string $name, array<int, mixed> $arguments) : mixed
Parameters
$name : string
$arguments : array<int, mixed>

__construct()

public __construct(Request $request) : mixed
Parameters
$request : Request

__get()

Proxy property reads to the underlying OpenSwoole request.

public & __get(string $name) : mixed
Parameters
$name : string

__set()

Proxy property writes to the underlying OpenSwoole request.

public __set(string $name, mixed $value) : mixed
Parameters
$name : string
$value : mixed

create()

public create([array<string, mixed> $settings = = '[]' ]) : bool
Parameters
$settings : array<string, mixed> = = '[]'
Return values
bool

getContent()

public getContent() : string|false
Return values
string|false

getData()

public getData() : string|false
Return values
string|false

getHeader()

public getHeader() : array<string, string>|false
Return values
array<string, string>|false

getMethod()

public getMethod() : array<string, string>|false
Return values
array<string, string>|false

htmxCurrentUrl()

Returns the HX-Current-URL browser URL, or null if absent.

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

htmxPrompt()

Returns the HX-Prompt user response string, or null if absent.

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

htmxRequestType()

The HX-Request-Type header (htmx 4): 'full' when the response replaces the body (or uses hx-select), 'partial' otherwise; null when absent.

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

htmxSource()

The raw HX-Source header (htmx 4): the triggering element as tag#id, or null.

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

htmxTarget()

The target element's id, or null if absent or the target has no id.

public htmxTarget() : string|null

htmx 2 sends the bare id (main); htmx 4 sends tag#id (div#main), or just the tag when the element has no id. Both come back as main.

Return values
string|null

htmxTrigger()

The triggering element's id, or null if absent or it has no id: htmx 2's HX-Trigger, else the id part of htmx 4's HX-Source.

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

htmxTriggerName()

Returns the HX-Trigger-Name element name (htmx 2 only), or null if absent.

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

htmxVersion()

Which htmx sent the request: 4 when it carries HX-Request-Type (only htmx 4 sends it), 2 for any other htmx request, null for a non-htmx one.

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

isBoosted()

Returns true when the request was issued via hx-boost.

public isBoosted() : bool
Return values
bool

isCompleted()

public isCompleted() : bool
Return values
bool

isHistoryRestoreRequest()

Returns true when the request is a history-restoration miss.

public isHistoryRestoreRequest() : bool
Return values
bool

isHtmx()

Returns true when the request carries HX-Request: true.

public isHtmx() : bool
Return values
bool

parse()

public parse(string $data) : bool
Parameters
$data : string
Return values
bool

rawContent()

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

elementId()

The id in an htmx element identifier: main (htmx 2) or div#main (htmx 4) → main; a bare tag from htmx 4 (div, element without id) → null.

private elementId(mixed $v) : string|null
Parameters
$v : mixed
Return values
string|null
On this page