\DevOwl\HeadlessContentBlockerUtils

Utility helpers.

Summary

Methods
Properties
Constants
applyDynamicsToHtml()
array_flatten()
createRegexpPatternFromWildcardName()
startsWith()
endsWith()
No public properties found
TEMP_REGEX_AVOID_UNMASK
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

TEMP_REGEX_AVOID_UNMASK

TEMP_REGEX_AVOID_UNMASK ='PLEACE_REPLACE_ME_AGAIN'

Methods

applyDynamicsToHtml()

applyDynamicsToHtml(string  $src,array  $dynamics)

Takes any string and replaces `{{myVariable}}` with the value of the passed `dynamics` map.

Parameters

string $src
array $dynamics

array_flatten()

array_flatten(array  $array,boolean  $recursive = false)

Flatten an array.

Parameters

array $array
boolean $recursive

createRegexpPatternFromWildcardName()

createRegexpPatternFromWildcardName(string  $name)

Create a pattern for `preg_match_all` usage.

Parameters

string $name

startsWith()

startsWith(string  $haystack,string  $needle)

Check if a string starts with a given needle.

Parameters

string $haystack

The string to search in

string $needle

The starting string

endsWith()

endsWith(string  $haystack,string  $needle)

Check if a string starts with a given needle.

Parameters

string $haystack

The string to search in

string $needle

The starting string