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-URLbrowser URL, or null if absent. - htmxPrompt() : string|null
- Returns the
HX-Promptuser response string, or null if absent. - htmxRequestType() : string|null
- The
HX-Request-Typeheader (htmx 4):'full'when the response replaces the body (or uses hx-select),'partial'otherwise; null when absent. - htmxSource() : string|null
- The raw
HX-Sourceheader (htmx 4): the triggering element astag#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'sHX-Source. - htmxTriggerName() : string|null
- Returns the
HX-Trigger-Nameelement 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) ordiv#main(htmx 4) →main; a bare tag from htmx 4 (div, element without id) → null.
Properties
$cookie
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
$parent
public
Request
$parent
$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
boolgetContent()
public
getContent() : string|false
Return values
string|falsegetData()
public
getData() : string|false
Return values
string|falsegetHeader()
public
getHeader() : array<string, string>|false
Return values
array<string, string>|falsegetMethod()
public
getMethod() : array<string, string>|false
Return values
array<string, string>|falsehtmxCurrentUrl()
Returns the HX-Current-URL browser URL, or null if absent.
public
htmxCurrentUrl() : string|null
Return values
string|nullhtmxPrompt()
Returns the HX-Prompt user response string, or null if absent.
public
htmxPrompt() : string|null
Return values
string|nullhtmxRequestType()
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|nullhtmxSource()
The raw HX-Source header (htmx 4): the triggering element as tag#id, or null.
public
htmxSource() : string|null
Return values
string|nullhtmxTarget()
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|nullhtmxTrigger()
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|nullhtmxTriggerName()
Returns the HX-Trigger-Name element name (htmx 2 only), or null if absent.
public
htmxTriggerName() : string|null
Return values
string|nullhtmxVersion()
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|nullisBoosted()
Returns true when the request was issued via hx-boost.
public
isBoosted() : bool
Return values
boolisCompleted()
public
isCompleted() : bool
Return values
boolisHistoryRestoreRequest()
Returns true when the request is a history-restoration miss.
public
isHistoryRestoreRequest() : bool
Return values
boolisHtmx()
Returns true when the request carries HX-Request: true.
public
isHtmx() : bool
Return values
boolparse()
public
parse(string $data) : bool
Parameters
- $data : string
Return values
boolrawContent()
public
rawContent() : string|null
Return values
string|nullelementId()
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