GravExtension
extends AbstractExtension
in package
implements
GlobalsInterface
Class GravExtension
Table of Contents
Interfaces
- GlobalsInterface
Properties
Methods
- __construct() : mixed
- GravExtension constructor.
- absoluteUrlFilter() : string
- arrayFilter() : array<string|int, mixed>
- Casts input to array.
- arrayIntersectFunc() : array<string|int, mixed>|Collection
- Wrapper for array_intersect() method
- arrayKeyValueFunc() : array<string|int, mixed>
- Workaround for twig associative array initialization Returns a key => val array
- authorize() : bool
- Authorize an action. Returns true if the user is logged in and has the right to execute $action.
- base32DecodeFilter() : string
- Return Base32 decoded string
- base32EncodeFilter() : string
- Return Base32 encoded string
- base64DecodeFilter() : string|false
- Return Base64 decoded string
- base64EncodeFilter() : string
- Return Base64 encoded string
- bodyClassFunc() : string
- takes an array of classes, and if they are not set on body_classes look to see if they are set in theme config
- boolFilter() : bool
- Casts input to bool.
- chunkSplitFilter() : string
- Wrapper for chunk_split() function
- containsFilter() : string|bool
- determine if a string contains another
- cronFunc() : CronExpression
- Get Cron object for a crontab 'at' format
- definedDefaultFilter() : mixed|null
- dump() : mixed
- Based on Twig\Extension\Debug / twig_var_dump (c) 2011 Fabien Potencier
- endsWithFilter() : bool
- evaluateStringFunc() : mixed
- This function will evaluate a $string through the $environment, and return its results.
- evaluateTwigFunc() : mixed
- This function will evaluate Twig $twig through the $environment, and return its results.
- exifFunc() : mixed
- Get the Exif data for a file
- fieldNameFilter() : string
- Filters field name by changing dot notation into array notation.
- fieldParentFilter() : string
- Filters field name by changing dot notation into array notation.
- filterFunc() : array<string|int, mixed>|CallbackFilterIterator
- floatFilter() : float
- Casts input to float.
- getCookie() : string
- Used to retrieve a cookie value
- getFilters() : array<string|int, mixed>
- Return a list of all filters.
- getFunctions() : array<string|int, mixed>
- Return a list of all functions.
- getGlobals() : array<string|int, mixed>
- Register some standard globals
- getTokenParsers() : array<string|int, mixed>
- getTypeFunc() : string
- Function/Filter to return the type of variable
- gistFunc() : string
- Output a Gist
- inflectorFilter() : string
- Inflector supports following notations:
- intFilter() : int
- Casts input to int.
- isAjaxFunc() : bool
- Check if HTTP_X_REQUESTED_WITH has been set to xmlhttprequest, in which case we may unsafely assume ajax. Non critical use only.
- jsonDecodeFilter() : array<string|int, mixed>
- Decodes string from JSON.
- ksortFilter() : array<string|int, mixed>
- Return ksorted collection.
- ltrimFilter() : string
- mapFunc() : array<string|int, mixed>|CallbackFilterIterator
- markdownFunction() : string
- md5Filter() : string
- Return MD5 hash from the input.
- mediaDirFunc() : Media|null
- Process a folder as Media and return a media object
- modulusFilter() : int
- Returns the modulus of an integer
- niceCronFilter() : string
- Gets a human readable output for cron syntax
- niceFilesizeFunc() : string
- Returns a nicer more readable filesize based on bytes
- niceNumberFunc() : string|bool
- Returns a nicer more readable number
- nicetimeFunc() : string
- displays a facebook style 'time ago' formatted date/time
- nonceFieldFunc() : string
- Used to add a nonce to a form. Call {{ nonce_field('action') }} specifying a string representing the action.
- ofTypeFunc() : bool
- Function/Filter to test type of variable
- padFilter() : string
- Pad a string to a certain length with another string
- pageHeaderVarFunc() : mixed
- Look for a page header variable in an array of pages working its way through until a value is found
- print_r() : string
- randomizeFilter() : array<string|int, mixed>
- Returns array in a random order.
- randomStringFunc() : string
- Generate a random string
- rangeFunc() : array<string|int, mixed>
- Generates an array containing a range of elements, optionally stepped
- readFileFunc() : bool|string
- Simple function to read a file based on a filepath and output it
- redirectFunc() : void
- redirect browser from twig
- reduceFunc() : array<string|int, mixed>|CallbackFilterIterator
- regexFilter() : array<string|int, mixed>
- Twig wrapper for PHP's preg_grep method
- regexMatch() : array<string|int, mixed>|false
- Twig wrapper for PHP's preg_match method
- regexReplace() : string|array<string|int, string>|null
- Twig wrapper for PHP's preg_replace method
- regexSplit() : array<string|int, mixed>|false
- Twig wrapper for PHP's preg_split method
- repeatFunc() : string
- Repeat given string x times.
- replaceLastFilter() : string|mixed
- rtrimFilter() : string
- safeEmailFilter() : string
- Protects email address.
- sortByKeyFilter() : array<string|int, mixed>
- Sorts a collection by key
- startsWithFilter() : bool
- stringFilter() : string
- Returns a string from a value. If the value is array, return it json encoded
- svgImageFunction() : string|array<string|int, string>|null
- Returns the content of an SVG image and adds extra classes as needed
- themeVarFunc() : mixed
- Get a theme variable Will try to get the variable for the current page, if not found, it tries it's parent page on up to root.
- translate() : string
- translateArray() : string
- translateFunc() : string
- Translate a string
- translateLanguage() : string
- Translate Strings
- uniqueId() : string
- Generates a random string with configurable length, prefix and suffix.
- urlFunc() : string|false
- Return URL to the resource.
- vardumpFunc() : void
- Dump a variable to the browser
- xssFunc() : bool|string|array<string|int, mixed>
- Allow quick check of a string for XSS Vulnerabilities
- yamlDecodeFilter() : array<string|int, mixed>
- Decode/Parse data from YAML format
- yamlEncodeFilter() : string
- Dump/Encode data into YAML format
- yamlFilter() : string
Properties
$config
protected
Config
$config
$debugger
protected
Debugger|null
$debugger
$grav
protected
Grav
$grav
Methods
__construct()
GravExtension constructor.
public
__construct() : mixed
absoluteUrlFilter()
public
absoluteUrlFilter(string $string) : string
Parameters
- $string : string
Return values
stringarrayFilter()
Casts input to array.
public
arrayFilter(mixed $input) : array<string|int, mixed>
Parameters
- $input : mixed
Return values
array<string|int, mixed>arrayIntersectFunc()
Wrapper for array_intersect() method
public
arrayIntersectFunc(array<string|int, mixed>|Collection $array1, array<string|int, mixed>|Collection $array2) : array<string|int, mixed>|Collection
Parameters
- $array1 : array<string|int, mixed>|Collection
- $array2 : array<string|int, mixed>|Collection
Return values
array<string|int, mixed>|CollectionarrayKeyValueFunc()
Workaround for twig associative array initialization Returns a key => val array
public
arrayKeyValueFunc(string $key, string $val[, array<string|int, mixed>|null $current_array = null ]) : array<string|int, mixed>
Parameters
- $key : string
-
key of item
- $val : string
-
value of item
- $current_array : array<string|int, mixed>|null = null
-
optional array to add to
Return values
array<string|int, mixed>authorize()
Authorize an action. Returns true if the user is logged in and has the right to execute $action.
public
authorize(string|array<string|int, mixed> $action) : bool
Parameters
- $action : string|array<string|int, mixed>
-
An action or a list of actions. Each entry can be a string like 'group.action' or without dot notation an associative array.
Return values
bool —Returns TRUE if the user is authorized to perform the action, FALSE otherwise.
base32DecodeFilter()
Return Base32 decoded string
public
base32DecodeFilter(string $str) : string
Parameters
- $str : string
Return values
stringbase32EncodeFilter()
Return Base32 encoded string
public
base32EncodeFilter(string $str) : string
Parameters
- $str : string
Return values
stringbase64DecodeFilter()
Return Base64 decoded string
public
base64DecodeFilter(string $str) : string|false
Parameters
- $str : string
Return values
string|falsebase64EncodeFilter()
Return Base64 encoded string
public
base64EncodeFilter(string $str) : string
Parameters
- $str : string
Return values
stringbodyClassFunc()
takes an array of classes, and if they are not set on body_classes look to see if they are set in theme config
public
bodyClassFunc(array<string|int, mixed> $context, string|array<string|int, string> $classes) : string
Parameters
- $context : array<string|int, mixed>
- $classes : string|array<string|int, string>
Return values
stringboolFilter()
Casts input to bool.
public
boolFilter(mixed $input) : bool
Parameters
- $input : mixed
Return values
boolchunkSplitFilter()
Wrapper for chunk_split() function
public
chunkSplitFilter(string $value, int $chars[, string $split = '-' ]) : string
Parameters
- $value : string
- $chars : int
- $split : string = '-'
Return values
stringcontainsFilter()
determine if a string contains another
public
containsFilter(string $haystack, string $needle) : string|bool
Parameters
- $haystack : string
- $needle : string
Tags
Return values
string|boolcronFunc()
Get Cron object for a crontab 'at' format
public
cronFunc(string $at) : CronExpression
Parameters
- $at : string
Return values
CronExpressiondefinedDefaultFilter()
public
definedDefaultFilter(mixed $value[, null $default = null ]) : mixed|null
Parameters
- $value : mixed
- $default : null = null
Return values
mixed|nulldump()
Based on Twig\Extension\Debug / twig_var_dump (c) 2011 Fabien Potencier
public
dump(Environment $env, array<string|int, mixed> $context) : mixed
Parameters
- $env : Environment
- $context : array<string|int, mixed>
endsWithFilter()
public
endsWithFilter(string $haystack, string $needle) : bool
Parameters
- $haystack : string
- $needle : string
Return values
boolevaluateStringFunc()
This function will evaluate a $string through the $environment, and return its results.
public
evaluateStringFunc(array<string|int, mixed> $context, string $string) : mixed
Parameters
- $context : array<string|int, mixed>
- $string : string
evaluateTwigFunc()
This function will evaluate Twig $twig through the $environment, and return its results.
public
evaluateTwigFunc(array<string|int, mixed> $context, string $twig) : mixed
Parameters
- $context : array<string|int, mixed>
- $twig : string
exifFunc()
Get the Exif data for a file
public
exifFunc(string $image[, bool $raw = false ]) : mixed
Parameters
- $image : string
- $raw : bool = false
fieldNameFilter()
Filters field name by changing dot notation into array notation.
public
fieldNameFilter(string $str) : string
Parameters
- $str : string
Return values
stringfieldParentFilter()
Filters field name by changing dot notation into array notation.
public
fieldParentFilter(string $str) : string
Parameters
- $str : string
Return values
stringfilterFunc()
public
filterFunc(Environment $env, array<string|int, mixed> $array, callable|string $arrow) : array<string|int, mixed>|CallbackFilterIterator
Parameters
- $env : Environment
- $array : array<string|int, mixed>
- $arrow : callable|string
Tags
Return values
array<string|int, mixed>|CallbackFilterIteratorfloatFilter()
Casts input to float.
public
floatFilter(mixed $input) : float
Parameters
- $input : mixed
Return values
floatgetCookie()
Used to retrieve a cookie value
public
getCookie(string $key) : string
Parameters
- $key : string
-
The cookie name to retrieve
Return values
stringgetFilters()
Return a list of all filters.
public
getFilters() : array<string|int, mixed>
Return values
array<string|int, mixed>getFunctions()
Return a list of all functions.
public
getFunctions() : array<string|int, mixed>
Return values
array<string|int, mixed>getGlobals()
Register some standard globals
public
getGlobals() : array<string|int, mixed>
Return values
array<string|int, mixed>getTokenParsers()
public
getTokenParsers() : array<string|int, mixed>
Return values
array<string|int, mixed>getTypeFunc()
Function/Filter to return the type of variable
public
getTypeFunc(mixed $var) : string
Parameters
- $var : mixed
Return values
stringgistFunc()
Output a Gist
public
gistFunc(string $id[, string|false $file = false ]) : string
Parameters
- $id : string
- $file : string|false = false
Return values
stringinflectorFilter()
Inflector supports following notations:
public
inflectorFilter(string $action, string $data[, int|null $count = null ]) : string
{{ 'person'|pluralize }} => people
{{ 'shoes'|singularize }} => shoe
{{ 'welcome page'|titleize }} => "Welcome Page"
{{ 'send_email'|camelize }} => SendEmail
{{ 'CamelCased'|underscorize }} => camel_cased
{{ 'Something Text'|hyphenize }} => something-text
{{ 'something_text_to_read'|humanize }} => "Something text to read"
{{ '181'|monthize }} => 5
{{ '10'|ordinalize }} => 10th
Parameters
- $action : string
- $data : string
- $count : int|null = null
Return values
stringintFilter()
Casts input to int.
public
intFilter(mixed $input) : int
Parameters
- $input : mixed
Return values
intisAjaxFunc()
Check if HTTP_X_REQUESTED_WITH has been set to xmlhttprequest, in which case we may unsafely assume ajax. Non critical use only.
public
isAjaxFunc() : bool
Return values
bool —True if HTTP_X_REQUESTED_WITH exists and has been set to xmlhttprequest
jsonDecodeFilter()
Decodes string from JSON.
public
jsonDecodeFilter(string $str[, bool $assoc = false ][, int $depth = 512 ][, int $options = 0 ]) : array<string|int, mixed>
Parameters
- $str : string
- $assoc : bool = false
- $depth : int = 512
- $options : int = 0
Return values
array<string|int, mixed>ksortFilter()
Return ksorted collection.
public
ksortFilter(array<string|int, mixed>|null $array) : array<string|int, mixed>
Parameters
- $array : array<string|int, mixed>|null
Return values
array<string|int, mixed>ltrimFilter()
public
ltrimFilter(string $value[, string|null $chars = null ]) : string
Parameters
- $value : string
- $chars : string|null = null
Return values
stringmapFunc()
public
mapFunc(Environment $env, array<string|int, mixed> $array, callable|string $arrow) : array<string|int, mixed>|CallbackFilterIterator
Parameters
- $env : Environment
- $array : array<string|int, mixed>
- $arrow : callable|string
Tags
Return values
array<string|int, mixed>|CallbackFilterIteratormarkdownFunction()
public
markdownFunction(array<string|int, mixed> $context, string $string[, bool $block = true ]) : string
Parameters
- $context : array<string|int, mixed>
- $string : string
- $block : bool = true
-
Block or Line processing
Return values
stringmd5Filter()
Return MD5 hash from the input.
public
md5Filter(string $str) : string
Parameters
- $str : string
Return values
stringmediaDirFunc()
Process a folder as Media and return a media object
public
mediaDirFunc(string $media_dir) : Media|null
Parameters
- $media_dir : string
Return values
Media|nullmodulusFilter()
Returns the modulus of an integer
public
modulusFilter(string|int $number, int $divider[, array<string|int, mixed>|null $items = null ]) : int
Parameters
- $number : string|int
- $divider : int
- $items : array<string|int, mixed>|null = null
-
array of items to select from to return
Return values
intniceCronFilter()
Gets a human readable output for cron syntax
public
niceCronFilter(string $at) : string
Parameters
- $at : string
Return values
stringniceFilesizeFunc()
Returns a nicer more readable filesize based on bytes
public
niceFilesizeFunc(int $bytes) : string
Parameters
- $bytes : int
Return values
stringniceNumberFunc()
Returns a nicer more readable number
public
niceNumberFunc(int|float|string $n) : string|bool
Parameters
- $n : int|float|string
Return values
string|boolnicetimeFunc()
displays a facebook style 'time ago' formatted date/time
public
nicetimeFunc(string $date[, bool $long_strings = true ][, bool $show_tense = true ]) : string
Parameters
- $date : string
- $long_strings : bool = true
- $show_tense : bool = true
Return values
stringnonceFieldFunc()
Used to add a nonce to a form. Call {{ nonce_field('action') }} specifying a string representing the action.
public
nonceFieldFunc(string $action[, string $nonceParamName = 'nonce' ]) : string
For maximum protection, ensure that the string representing the action is as specific as possible
Parameters
- $action : string
-
the action
- $nonceParamName : string = 'nonce'
-
a custom nonce param name
Return values
string —the nonce input field
ofTypeFunc()
Function/Filter to test type of variable
public
ofTypeFunc(mixed $var[, string|null $typeTest = null ][, string|null $className = null ]) : bool
Parameters
- $var : mixed
- $typeTest : string|null = null
- $className : string|null = null
Return values
boolpadFilter()
Pad a string to a certain length with another string
public
static padFilter(string $input, int $pad_length[, string $pad_string = ' ' ][, int $pad_type = STR_PAD_RIGHT ]) : string
Parameters
- $input : string
- $pad_length : int
- $pad_string : string = ' '
- $pad_type : int = STR_PAD_RIGHT
Return values
stringpageHeaderVarFunc()
Look for a page header variable in an array of pages working its way through until a value is found
public
pageHeaderVarFunc(array<string|int, mixed> $context, string $var[, string|array<string|int, string>|null $pages = null ]) : mixed
Use themeVarFunc() instead
Parameters
- $context : array<string|int, mixed>
- $var : string
-
the variable to look for in the page header
- $pages : string|array<string|int, string>|null = null
-
array of pages to check (current page upwards if not null)
print_r()
public
print_r(mixed $var) : string
Parameters
- $var : mixed
Return values
stringrandomizeFilter()
Returns array in a random order.
public
randomizeFilter(array<string|int, mixed>|Traversable $original[, int $offset = 0 ]) : array<string|int, mixed>
Parameters
- $original : array<string|int, mixed>|Traversable
- $offset : int = 0
-
Can be used to return only slice of the array.
Return values
array<string|int, mixed>randomStringFunc()
Generate a random string
public
randomStringFunc([int $count = 5 ]) : string
Parameters
- $count : int = 5
Return values
stringrangeFunc()
Generates an array containing a range of elements, optionally stepped
public
rangeFunc([int $start = 0 ][, int $end = 100 ][, int $step = 1 ]) : array<string|int, mixed>
Parameters
- $start : int = 0
-
Minimum number, default 0
- $end : int = 100
-
Maximum number, default
getrandmax() - $step : int = 1
-
Increment between elements in the sequence, default 1
Return values
array<string|int, mixed>readFileFunc()
Simple function to read a file based on a filepath and output it
public
readFileFunc(string $filepath) : bool|string
Parameters
- $filepath : string
Return values
bool|stringredirectFunc()
redirect browser from twig
public
redirectFunc(string $url[, int $statusCode = 303 ]) : void
Parameters
- $url : string
-
the url to redirect to
- $statusCode : int = 303
-
statusCode, default 303
reduceFunc()
public
reduceFunc(Environment $env, array<string|int, mixed> $array, callable|string $arrow) : array<string|int, mixed>|CallbackFilterIterator
Parameters
- $env : Environment
- $array : array<string|int, mixed>
- $arrow : callable|string
Tags
Return values
array<string|int, mixed>|CallbackFilterIteratorregexFilter()
Twig wrapper for PHP's preg_grep method
public
regexFilter(array<string|int, mixed> $array, string $regex[, int $flags = 0 ]) : array<string|int, mixed>
Parameters
- $array : array<string|int, mixed>
- $regex : string
- $flags : int = 0
Return values
array<string|int, mixed>regexMatch()
Twig wrapper for PHP's preg_match method
public
regexMatch(string $subject, string $pattern[, int $flags = 0 ][, int $offset = 0 ]) : array<string|int, mixed>|false
Parameters
- $subject : string
-
the content to perform the match on
- $pattern : string
-
the regex pattern to use for match
- $flags : int = 0
- $offset : int = 0
Return values
array<string|int, mixed>|false —returns the matches if there is at least one match in the subject for a given pattern or null if not.
regexReplace()
Twig wrapper for PHP's preg_replace method
public
regexReplace(string|array<string|int, string> $subject, string|array<string|int, string> $pattern, string|array<string|int, string> $replace[, int $limit = -1 ]) : string|array<string|int, string>|null
Parameters
- $subject : string|array<string|int, string>
-
the content to perform the replacement on
- $pattern : string|array<string|int, string>
-
the regex pattern to use for matches
- $replace : string|array<string|int, string>
-
the replacement value either as a string or an array of replacements
- $limit : int = -1
-
the maximum possible replacements for each pattern in each subject
Return values
string|array<string|int, string>|null —the resulting content
regexSplit()
Twig wrapper for PHP's preg_split method
public
regexSplit(string $subject, string $pattern[, int $limit = -1 ][, int $flags = 0 ]) : array<string|int, mixed>|false
Parameters
- $subject : string
-
the content to perform the split on
- $pattern : string
-
the regex pattern to use for split
- $limit : int = -1
-
the maximum possible splits for the given pattern
- $flags : int = 0
Return values
array<string|int, mixed>|false —the resulting array after performing the split operation
repeatFunc()
Repeat given string x times.
public
repeatFunc(string $input, int $multiplier) : string
Parameters
- $input : string
- $multiplier : int
Return values
stringreplaceLastFilter()
public
replaceLastFilter(string|mixed $str, string $search, string $replace) : string|mixed
Parameters
- $str : string|mixed
- $search : string
- $replace : string
Return values
string|mixedrtrimFilter()
public
rtrimFilter(string $value[, string|null $chars = null ]) : string
Parameters
- $value : string
- $chars : string|null = null
Return values
stringsafeEmailFilter()
Protects email address.
public
safeEmailFilter(string $str) : string
Parameters
- $str : string
Return values
stringsortByKeyFilter()
Sorts a collection by key
public
sortByKeyFilter(array<string|int, mixed> $input, string $filter[, int $direction = SORT_ASC ][, int $sort_flags = SORT_REGULAR ]) : array<string|int, mixed>
Parameters
- $input : array<string|int, mixed>
- $filter : string
- $direction : int = SORT_ASC
- $sort_flags : int = SORT_REGULAR
Return values
array<string|int, mixed>startsWithFilter()
public
startsWithFilter(string $haystack, string $needle) : bool
Parameters
- $haystack : string
- $needle : string
Return values
boolstringFilter()
Returns a string from a value. If the value is array, return it json encoded
public
stringFilter(mixed $value) : string
Parameters
- $value : mixed
Return values
stringsvgImageFunction()
Returns the content of an SVG image and adds extra classes as needed
public
static svgImageFunction(string $path[, string|null $classes = null ][, mixed $strip_style = false ]) : string|array<string|int, string>|null
Parameters
- $path : string
- $classes : string|null = null
- $strip_style : mixed = false
Return values
string|array<string|int, string>|nullthemeVarFunc()
Get a theme variable Will try to get the variable for the current page, if not found, it tries it's parent page on up to root.
public
themeVarFunc(array<string|int, mixed> $context, string $var[, null $default = null ][, PageInterface|null $page = null ][, bool $exists = false ]) : mixed
If still not found, will use the theme's configuration value, If still not found, will use the $default value passed in
Parameters
- $context : array<string|int, mixed>
-
Twig Context
- $var : string
-
variable to be found (using dot notation)
- $default : null = null
-
the default value to be used as last resort
- $page : PageInterface|null = null
-
an optional page to use for the current page
- $exists : bool = false
-
toggle to simply return the page where the variable is set, else null
translate()
public
translate(Environment $twig, mixed ...$args) : string
Parameters
- $twig : Environment
- $args : mixed
Return values
stringtranslateArray()
public
translateArray(string $key, string $index[, array<string|int, mixed>|null $lang = null ]) : string
Parameters
- $key : string
- $index : string
- $lang : array<string|int, mixed>|null = null
Return values
stringtranslateFunc()
Translate a string
public
translateFunc() : string
Return values
stringtranslateLanguage()
Translate Strings
public
translateLanguage(string|array<string|int, mixed> $args[, array<string|int, mixed>|null $languages = null ][, bool $array_support = false ][, bool $html_out = false ]) : string
Parameters
- $args : string|array<string|int, mixed>
- $languages : array<string|int, mixed>|null = null
- $array_support : bool = false
- $html_out : bool = false
Return values
stringuniqueId()
Generates a random string with configurable length, prefix and suffix.
public
uniqueId([int $length = 9 ][, array<string|int, mixed> $options = ['prefix' => '', 'suffix' => ''] ]) : string
Unlike the built-in uniqid(), this string is non-conflicting and safe
Parameters
- $length : int = 9
- $options : array<string|int, mixed> = ['prefix' => '', 'suffix' => '']
Tags
Return values
stringurlFunc()
Return URL to the resource.
public
urlFunc(string $input[, bool $domain = false ][, bool $failGracefully = false ]) : string|false
Parameters
- $input : string
-
Resource to be located.
- $domain : bool = false
-
True to include domain name.
- $failGracefully : bool = false
-
If true, return URL even if the file does not exist.
Tags
Return values
string|false —Returns url to the resource or null if resource was not found.
vardumpFunc()
Dump a variable to the browser
public
vardumpFunc(mixed $var) : void
Parameters
- $var : mixed
xssFunc()
Allow quick check of a string for XSS Vulnerabilities
public
xssFunc(string|array<string|int, mixed> $data) : bool|string|array<string|int, mixed>
Parameters
- $data : string|array<string|int, mixed>
Return values
bool|string|array<string|int, mixed>yamlDecodeFilter()
Decode/Parse data from YAML format
public
yamlDecodeFilter(string $data) : array<string|int, mixed>
Parameters
- $data : string
Return values
array<string|int, mixed>yamlEncodeFilter()
Dump/Encode data into YAML format
public
yamlEncodeFilter(array<string|int, mixed>|object $data[, int $inline = 10 ]) : string
Parameters
- $data : array<string|int, mixed>|object
- $inline : int = 10
-
integer number of levels of inline syntax
Return values
stringyamlFilter()
public
yamlFilter(array<string|int, mixed>|object $value[, int|null $inline = null ][, int|null $indent = null ]) : string
Parameters
- $value : array<string|int, mixed>|object
- $inline : int|null = null
- $indent : int|null = null