API Documentation

helpers.php

Table of Contents

Functions

hyde()  : HydeKernel
Get the available HydeKernel instance.
unslash()  : string
Remove trailing slashes from the start and end of a string.
asset()  : string
Get a relative link or URL to an asset in the media directory.
route()  : Route|null
Get a page route instance by its key. Casting it to a string will return a relative link to the page.
url()  : string
Get a qualified URL to the supplied path if a base URL is set.
hyde()  : HydeKernel
Get the available HydeKernel instance.
unslash()  : string
Remove trailing slashes from the start and end of a string.
unixsum()  : string
A EOL agnostic wrapper for calculating MD5 checksums.
unixsum_file()  : string
Shorthand for {@see unixsum()} but loads a file.
make_title()  : string
normalize_newlines()  : string
strip_newlines()  : string
trim_slashes()  : string
evaluate_arrayable()  : array<string|int, mixed>
yaml_encode()  : string
yaml_decode()  : mixed
path_join()  : string
normalize_slashes()  : string

Functions

unslash()

Remove trailing slashes from the start and end of a string.

This function will be replaced by unslash() in v2.0

unslash(string $string) : string
Parameters
$string : string
Tags
codeCoverageIgnore

This function is deprecated and will be removed in a future release.

Return values
string

asset()

Get a relative link or URL to an asset in the media directory.

asset(string $name[, bool $preferQualifiedUrl = false ]) : string
Parameters
$name : string
$preferQualifiedUrl : bool = false
Return values
string

route()

Get a page route instance by its key. Casting it to a string will return a relative link to the page.

route(string $key) : Route|null
Parameters
$key : string
Return values
Route|null

url()

Get a qualified URL to the supplied path if a base URL is set.

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

unslash()

Remove trailing slashes from the start and end of a string.

unslash(string $string) : string
Parameters
$string : string
Return values
string

unixsum()

A EOL agnostic wrapper for calculating MD5 checksums.

unixsum(string $string) : string

This function is not cryptographically secure.

Parameters
$string : string
Return values
string

unixsum_file()

Shorthand for {@see unixsum()} but loads a file.

unixsum_file(string $file) : string
Parameters
$file : string
Return values
string

make_title()

make_title(string $value) : string
Parameters
$value : string
Return values
string

normalize_newlines()

normalize_newlines(string $string) : string
Parameters
$string : string
Return values
string

strip_newlines()

strip_newlines(string $string) : string
Parameters
$string : string
Return values
string

trim_slashes()

trim_slashes(string $string) : string
Parameters
$string : string
Return values
string

evaluate_arrayable()

evaluate_arrayable(array<string|int, mixed>|Arrayable $array) : array<string|int, mixed>
Parameters
$array : array<string|int, mixed>|Arrayable
Return values
array<string|int, mixed>

yaml_encode()

yaml_encode(mixed $input[, int $inline = 2 ][, int $indent = 4 ][, int $flags = 0 ]) : string
Parameters
$input : mixed
$inline : int = 2
$indent : int = 4
$flags : int = 0
Return values
string

yaml_decode()

yaml_decode(string $input[, int $flags = 0 ]) : mixed
Parameters
$input : string
$flags : int = 0

path_join()

path_join(string $directory, string ...$paths) : string
Parameters
$directory : string
$paths : string
Return values
string

normalize_slashes()

normalize_slashes(string $string) : string
Parameters
$string : string
Return values
string

        
On this page

Search results