Behavior.php
Table of Contents
Functions
- bb_replace_vars() : mixed
- Replace a String with all BB Vars
- bb_url() : mixed
- Creates an Url for a Path
- _u() : mixed
- Alias for "bb_url"
- _uq() : mixed
- Creates an Url for a Path with a Query
- _v() : mixed
- Returns the URL for an ViewController
- bb_mkurl() : string|null
- Trys to create a Url from a Real Path
- getContext() : string
- Gets the current Context
- setContext() : void
- Sets the current Context
- bb_get_vars() : array<string|int, mixed>
- Gets all Global Variables to use it, for instance in Templates
- bb_last_history() : void
- Returns the last Item in the history
- bb_add_history() : mixed
- Adds Entry to the History
- bb_get_history() : mixed
- Gets the History
- bb_clear_history() : void
- Clears the BackendBuilders History
- bb_do() : bool
- Check if the Request Action is the given one
- bb_call_event() : void
- Calls an Event
- bb_register_eventhandler() : void
- Registers an Event Handler
- bb_set_eventhandlers() : void
- Sets all EventHandlers
- bb_get_eventhandlers() : mixed
- Gets all EventHandlers
- bb_add_ip_to_whitelist() : void
- Adds an IP to the Whitelist
- bb_remove_ip_from_whitelist() : void
- Removes an IP from the Whitelist
- bb_get_ip_whitelist() : mixed
- Gets the IP Whitelist
- bb_is_ip_whitelisted() : bool
- Checks if an IP is Whitelisted
- bb_import_ip_whitelist() : void
- Imports an IP Whitelist
- bb_add_ip_to_blacklist() : void
- Adds an IP to the Blacklist
- bb_remove_ip_from_blacklist() : void
- Removes an IP from the Blacklist
- bb_get_ip_blacklist() : mixed
- Gets the IP Blacklist
- bb_is_ip_blacklisted() : bool
- Checks if an IP is Blacklisted
- bb_import_ip_blacklist() : void
- Imports an IP Blacklist
- config() : null|array<string|int, mixed>
- Gets the current Configuration
- set_config() : void
- Sets a property in the configuration
- bb_error() : void
- Handles app-terminating errors in BB4
- issue_nonce() : string
- Issues a Nonce
- use_nonce() : bool
- Checks a Nonces and invalidates a Session nonce
- load_json_file() : mixed
- Loads a JSON File
- load_lst_file() : null|array<string|int, mixed>
- Loads a List File (.lst)
Functions
bb_replace_vars()
Replace a String with all BB Vars
bb_replace_vars(mixed $str) : mixed
Parameters
- $str : mixed
bb_url()
Creates an Url for a Path
bb_url(mixed $path[, bool $isPureHtml = false ]) : mixed
Parameters
- $path : mixed
- $isPureHtml : bool = false
_u()
Alias for "bb_url"
_u(mixed $path[, mixed $isPureHtml = false ]) : mixed
Parameters
- $path : mixed
- $isPureHtml : mixed = false
_uq()
Creates an Url for a Path with a Query
_uq(mixed $path[, mixed $query = null ][, bool $isPureHtml = false ]) : mixed
Parameters
- $path : mixed
-
The Path
- $query : mixed = null
-
The Query
- $isPureHtml : bool = false
-
Whether the Url should be pure html
_v()
Returns the URL for an ViewController
_v(IViewController|string $viewController[, array<string|int, mixed>|null $query = null ][, bool $isPureHtml = false ][, mixed $notFound = "#" ]) : mixed
Parameters
- $viewController : IViewController|string
-
ViewController or his class
- $query : array<string|int, mixed>|null = null
- $isPureHtml : bool = false
- $notFound : mixed = "#"
bb_mkurl()
Trys to create a Url from a Real Path
bb_mkurl(mixed $path) : string|null
Parameters
- $path : mixed
-
Path within the bb4 root dir
Return values
string|null —Returns null if it's impossible to create a url
getContext()
Gets the current Context
getContext() : string
Return values
stringsetContext()
Sets the current Context
setContext(mixed $class) : void
Parameters
- $class : mixed
bb_get_vars()
Gets all Global Variables to use it, for instance in Templates
bb_get_vars([I18nLanguage|null $locale = null ][, ITheme|null $theme = null ][, mixed $transformSingleLevel = false ][, mixed $bypassCache = false ]) : array<string|int, mixed>
Parameters
- $locale : I18nLanguage|null = null
- $theme : ITheme|null = null
- $transformSingleLevel : mixed = false
- $bypassCache : mixed = false
Return values
array<string|int, mixed>bb_last_history()
Returns the last Item in the history
bb_last_history([mixed $lastId = 0 ]) : void
Parameters
- $lastId : mixed = 0
bb_add_history()
Adds Entry to the History
bb_add_history(mixed $url) : mixed
Parameters
- $url : mixed
bb_get_history()
Gets the History
bb_get_history() : mixed
bb_clear_history()
Clears the BackendBuilders History
bb_clear_history() : void
bb_do()
Check if the Request Action is the given one
bb_do(mixed $action) : bool
Parameters
- $action : mixed
Return values
boolbb_call_event()
Calls an Event
bb_call_event(string $eventType, mixed ...$args) : void
Parameters
- $eventType : string
- $args : mixed
bb_register_eventhandler()
Registers an Event Handler
bb_register_eventhandler(string $eventType, callable $handler) : void
Parameters
- $eventType : string
-
Event Type
- $handler : callable
-
Event Handler
bb_set_eventhandlers()
Sets all EventHandlers
bb_set_eventhandlers(array<string|int, mixed> $handlers) : void
Parameters
- $handlers : array<string|int, mixed>
bb_get_eventhandlers()
Gets all EventHandlers
bb_get_eventhandlers() : mixed
bb_add_ip_to_whitelist()
Adds an IP to the Whitelist
bb_add_ip_to_whitelist(mixed $ip) : void
Parameters
- $ip : mixed
-
IP to add
bb_remove_ip_from_whitelist()
Removes an IP from the Whitelist
bb_remove_ip_from_whitelist(mixed $ip) : void
Parameters
- $ip : mixed
bb_get_ip_whitelist()
Gets the IP Whitelist
bb_get_ip_whitelist() : mixed
bb_is_ip_whitelisted()
Checks if an IP is Whitelisted
bb_is_ip_whitelisted(mixed $ip) : bool
Parameters
- $ip : mixed
Return values
boolbb_import_ip_whitelist()
Imports an IP Whitelist
bb_import_ip_whitelist(array<string|int, mixed> $whitelist) : void
Parameters
- $whitelist : array<string|int, mixed>
-
Array of IPs to import
bb_add_ip_to_blacklist()
Adds an IP to the Blacklist
bb_add_ip_to_blacklist(mixed $ip) : void
Parameters
- $ip : mixed
bb_remove_ip_from_blacklist()
Removes an IP from the Blacklist
bb_remove_ip_from_blacklist(mixed $ip) : void
Parameters
- $ip : mixed
bb_get_ip_blacklist()
Gets the IP Blacklist
bb_get_ip_blacklist() : mixed
bb_is_ip_blacklisted()
Checks if an IP is Blacklisted
bb_is_ip_blacklisted(mixed $ip) : bool
Parameters
- $ip : mixed
Return values
boolbb_import_ip_blacklist()
Imports an IP Blacklist
bb_import_ip_blacklist(array<string|int, mixed> $blacklist) : void
Parameters
- $blacklist : array<string|int, mixed>
-
Array of IPs to import
config()
Gets the current Configuration
config() : null|array<string|int, mixed>
Return values
null|array<string|int, mixed>set_config()
Sets a property in the configuration
set_config(mixed $key, mixed $val) : void
Parameters
- $key : mixed
-
Configuration Key
- $val : mixed
-
Configuration Value
bb_error()
Handles app-terminating errors in BB4
bb_error(mixed $errCode, mixed $error[, mixed $showPlain = true ]) : void
Parameters
- $errCode : mixed
-
Error Code
- $error : mixed
-
Error Message
- $showPlain : mixed = true
issue_nonce()
Issues a Nonce
issue_nonce([int $length = 8 ][, mixed $nonceId = "nonce" ]) : string
Parameters
- $length : int = 8
-
Length of the Nonce (Default: 8)
- $nonceId : mixed = "nonce"
Return values
stringuse_nonce()
Checks a Nonces and invalidates a Session nonce
use_nonce(mixed $nonce[, mixed $nonceId = "nonce" ]) : bool
Parameters
- $nonce : mixed
-
Nonce to check
- $nonceId : mixed = "nonce"
Return values
boolload_json_file()
Loads a JSON File
load_json_file(mixed $path[, bool $associative = true ]) : mixed
Parameters
- $path : mixed
-
The File Path
- $associative : bool = true
-
Whether to return an associative array instead of an object
load_lst_file()
Loads a List File (.lst)
load_lst_file(mixed $path) : null|array<string|int, mixed>
Parameters
- $path : mixed
-
The File Path