Documentation

helpers.php

Table of Contents

HTTP_URL_JOIN_PATH  = 2
HTTP_URL_JOIN_QUERY  = 4
HTTP_URL_REPLACE  = 1
HTTP_URL_STRIP_ALL  = 1024
HTTP_URL_STRIP_AUTH  = 32
HTTP_URL_STRIP_FRAGMENT  = 512
HTTP_URL_STRIP_PASS  = 16
HTTP_URL_STRIP_PATH  = 128
HTTP_URL_STRIP_PORT  = 64
HTTP_URL_STRIP_QUERY  = 256
HTTP_URL_STRIP_USER  = 8
input()  : mixed
Returns an input parameter or the default value.
post()  : mixed
Identical function to input(), however restricted to POST values.
get()  : mixed
Identical function to input(), however restricted to GET values.
trace_log()  : void
Writes a trace message to a log file.
traceLog()  : void
Alias for trace_log()
trace_sql()  : void
Begins to monitor all SQL output.
traceSql()  : void
Alias for trace_sql()
plugins_path()  : string
Get the path to the plugins folder.
uploads_path()  : string
Get the path to the uploads folder.
themes_path()  : string
Get the path to the themes folder.
temp_path()  : string
Get the path to the temporary storage folder.
trans()  : string
Translate the given message.
array_build()  : array<string|int, mixed>
Build a new array using a callback.
collect()  : Collection
Create a collection from the given value.
http_build_url()  : string
Polyfill for `http_build_url` method provided by PECL HTTP extension.
is_countable()  : bool
Polyfill for `is_countable` method provided in PHP 7.3

Constants

HTTP_URL_JOIN_PATH

public mixed HTTP_URL_JOIN_PATH = 2

HTTP_URL_JOIN_QUERY

public mixed HTTP_URL_JOIN_QUERY = 4

HTTP_URL_REPLACE

public mixed HTTP_URL_REPLACE = 1

HTTP_URL_STRIP_ALL

public mixed HTTP_URL_STRIP_ALL = 1024

HTTP_URL_STRIP_AUTH

public mixed HTTP_URL_STRIP_AUTH = 32

HTTP_URL_STRIP_FRAGMENT

public mixed HTTP_URL_STRIP_FRAGMENT = 512

HTTP_URL_STRIP_PASS

public mixed HTTP_URL_STRIP_PASS = 16

HTTP_URL_STRIP_PATH

public mixed HTTP_URL_STRIP_PATH = 128

HTTP_URL_STRIP_PORT

public mixed HTTP_URL_STRIP_PORT = 64

HTTP_URL_STRIP_QUERY

public mixed HTTP_URL_STRIP_QUERY = 256

HTTP_URL_STRIP_USER

public mixed HTTP_URL_STRIP_USER = 8

Functions

input()

Returns an input parameter or the default value.

input([string|null $name = null ][, string|null $default = null ]) : mixed

Supports HTML Array names.

$value = input('value', 'not found');
$name = input('contact[name]');
$name = input('contact[location][city]');

Booleans are converted from strings

Parameters
$name : string|null = null
$default : string|null = null
Return values
mixed

post()

Identical function to input(), however restricted to POST values.

post([mixed $name = null ][, mixed $default = null ]) : mixed
Parameters
$name : mixed = null
$default : mixed = null
Return values
mixed

get()

Identical function to input(), however restricted to GET values.

get([mixed $name = null ][, mixed $default = null ]) : mixed
Parameters
$name : mixed = null
$default : mixed = null
Return values
mixed

trace_log()

Writes a trace message to a log file.

trace_log() : void
Return values
void

traceLog()

Alias for trace_log()

traceLog() : void
Return values
void

trace_sql()

Begins to monitor all SQL output.

trace_sql() : void
Return values
void

traceSql()

Alias for trace_sql()

traceSql() : void
Return values
void

plugins_path()

Get the path to the plugins folder.

plugins_path([string $path = '' ]) : string
Parameters
$path : string = ''
Return values
string

uploads_path()

Get the path to the uploads folder.

uploads_path([string $path = '' ]) : string
Parameters
$path : string = ''
Return values
string

themes_path()

Get the path to the themes folder.

themes_path([string $path = '' ]) : string
Parameters
$path : string = ''
Return values
string

temp_path()

Get the path to the temporary storage folder.

temp_path([string $path = '' ]) : string
Parameters
$path : string = ''
Return values
string

trans()

Translate the given message.

trans([string $id = null ][, array<string|int, mixed> $parameters = [] ][, string $locale = null ]) : string
Parameters
$id : string = null
$parameters : array<string|int, mixed> = []
$locale : string = null
Return values
string

array_build()

Build a new array using a callback.

array_build(array<string|int, mixed> $array, callable $callback) : array<string|int, mixed>
Parameters
$array : array<string|int, mixed>
$callback : callable
Return values
array<string|int, mixed>

collect()

Create a collection from the given value.

collect([mixed $value = null ]) : Collection
Parameters
$value : mixed = null
Return values
Collection

http_build_url()

Polyfill for `http_build_url` method provided by PECL HTTP extension.

http_build_url(array<string|int, mixed> $url[, array<string|int, mixed> $replace = [] ][, mixed $flags = HTTP_URL_REPLACE ][, array<string|int, mixed> &$newUrl = [] ]) : string
Parameters
$url : array<string|int, mixed>
$replace : array<string|int, mixed> = []
$flags : mixed = HTTP_URL_REPLACE
$newUrl : array<string|int, mixed> = []
Tags
see
UrlGenerator::buildUrl()
Return values
string

is_countable()

Polyfill for `is_countable` method provided in PHP 7.3

is_countable(mixed $value) : bool
Parameters
$value : mixed
Return values
bool

Search results