Application
Table of Contents
Interfaces
- IAPIDeclaration
- Declaration for a Group of API Functions
- IAPIFunction
- Declaration for an API Function
- IContentFormatter
- IDatabaseDriver
- IIPGeoLocationService
- Interface for IP Geolocation Services
- IMailDriver
- Interface IMailDriver
- IModal
- IRenderer
- IRoute
- Interface IRequestAction
- IRequestAction
- Legacy interface for request actions.
- ISerializable
- ITheme
- Interface ITheme
- IViewController
- Interface IViewController
Classes
- AJAX
- AjaxController
- AJAXRoute
- AjaxAPI
- JSAPI
- JSModalAPI
- APIMessage
- Defines a Message contains Feedback-Behavior
- APIResponse
- Defines an API Response Object
- BasicAPIFunction
- Defines a Basic API Function
- BlueScopeAutoLoader
- AutoloadHelper
- DataMapper
- DataMappingHelper
- DBConfig
- DetailSerialization
- HideOnSerialization
- Attribute to hide a property on serialization
- MySqlDatabase
- MySQLQuery
- Constants
- GenericRoute
- A generic route that can be used to define a route with a custom execution function
- EvaluateFilterExtension
- A twig extension that will add an "evaluate" filter, for dynamic evaluation.
- CacheObject
- ContentHeader
- DebugHelper
- Helper Functions accessible in Debug MOde
- Events
- FileServer
- Instance for Serving Files
- ImageServer
- Instance for Serving Images
- LicensingHelper
- MathHelper
- OpenSslHelper
- RecaptchaHelper
- Class RecaptchaHelper
- UserAgentParser
- 3rd Party Lib parseUserAgentString.php Class (With Bots) Version 1.38 Written by Thomas Parkison.
- UserAgentHelper
- Helper class for user agent parser (self written)
- I18nLanguage
- I18nManager
- GeoIPData
- Data class for IP Geocoding
- GeoIPResponse
- JsonToken
- FileContainer
- InfoSniperGeolocationService
- IP Geolocation Service for InfoSniper.net
- MailBuilder
- Class for building Mails
- PhpMailDriver
- SmtpMailDriver
- FormModal
- HtmlContainer
- HtmlLink
- HtmlForm
- HtmlFormInput
- HtmlFormCheckbox
- HtmlFormRadioButton
- HtmlOptionSelect
- HtmlTextArea
- HtmlHiddenField
- HtmlFileUploadField
- HtmlFormGroup
- HtmlFieldSet
- HtmlFormTabGroup
- HtmlCustomField
- HtmlTable
- HtmlTableRow
- HtmlHeaderRow
- MenuItem
- ViewControllerMenuItem
- Auth
- REST
- RESTfulController
- RESTfulRoute
- IntrusionHelper
- IntrusionDetector
- PasswordStrengthValidator
- PermissionManager
- BaseModal
- ErrorViewController
- PageViewController
- FormViewController
- TableViewController
Constants
- ACCOUNT_MENU = "account"
- BB_APIS = "bb.apis"
- BB_CACHE = "bb.cache"
- BB_CONTEXT = "bb.context"
- BB_DB = "bb.database"
- BB_DBDrivers = "bb.dbdrivers"
- BB_DEFAULTPATH = "bb.defaultPath"
- BB_DISPLAYALERTS = "bb.displayAlerts"
- BB_DYNAMIC_ROUTES = "bb.dynamicRoutes"
- BB_EVENT_HANDLERS = "bb.eventHandlers"
- BB_IP_BLACKLIST = "bb.ipBlacklist"
- BB_IP_WHITELIST = "bb.ipWhitelist"
- BB_IPGEOLOCATION = "bb.ipGeolocation"
- BB_LOCALE = "bb.locale"
- BB_MailDrivers = "bb.maildrivers"
- BB_MENUS = "bb.menus"
- BB_MODALS = "bb.modals"
- BB_PATH404 = "bb.404"
- BB_PATHMYACCOUNT = "bb.myaccount"
- BB_REST_API_KEYS = "bb.restApiKeys"
- BB_ROUTES = "bb.routes"
- BB_SESSION_CACHE = "bb.sessionCache"
- BB_SESSION_HISTORY = "bb-history"
- BB_SKIP_FILES = "bb.skipFiles"
- BB_THEME = "bb.theme"
- BB_TWIGFILTERS = "bb.twigFilters"
- BB_USERAUTH = "bb.userauth"
- BB_VAR_LANGUAGE = "language"
- BB_VAR_THEME = "theme"
- BB_VIEWCONTROLLERS = "bb.viewControllers"
- MAIN_MENU = "main"
Functions
- _ajax() : mixed
- getAjaxPathForFunction() : string|null
- bb_register_AJAX_api() : void
- Registers a AJAX API method
- autoload_dir() : mixed
- autoload() : mixed
- bb_init() : void
- Starts the Initialization Process and Database connection Steps: - Database connection - Load config from Database - Load locale - Load Theme
- bb_register() : void
- Starts the registration process of bb4 core functionality
- bb_post_register() : mixed
- bluebase_workflow() : void
- Frontend workflow, render requested page or whatever have to be done
- bb_add_alert() : void
- Adds an Alert to the Stack
- bb_set_alerts() : void
- Sets the Alert Stack
- bb_get_alerts() : null|array<string|int, mixed>
- Gets all Alerts
- bb_get_declared_apis() : array<string|int, mixed>
- Gets all loaded API Declarations
- bb_get_apimessage() : null|APIMessage
- Gets an API Message with Localized Messages
- bb_format_apimessage() : null|APIMessage
- Gets an API Message with Localized Messages and Formats it
- 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)
- bb_cache() : mixed
- Puts an Object in the Cache
- bb_cache_get() : mixed
- Returns a Item from the cache if its not expired, else null
- bb_cache_clear() : void
- Clears everything in the Cache
- bb_connectdb() : bool
- Establishes a Database connection using the given configuration stack
- bb_setdb() : void
- Sets the core Database
- bb_db() : null|IDatabaseDriver
- Gets the core Database or null
- bb_dbconnected() : bool
- Returns whether the Core Database is connected
- bb_dbalive() : bool
- Returns whether the Core Database is alive
- bb_get_locales() : null|array<string|int, mixed>
- Gets all installed BB4 Locales
- bb_get_installed_locales() : null|array<string|int, mixed>
- Gets all installed BB4 Locales
- locale_get_info() : array<string|int, null|string>
- Gets all essential informations about a bb4 locale
- bb_load_locale() : null|I18nLanguage
- Loads a locale by its fqn or null if nothing similiar can be found
- bb_this_locale() : null|I18nLanguage
- Gets the current active Locale or null if the initialization isn't executed successfully
- bb_set_this_locale() : void
- Sets the current active Locale
- bb_get_localedir() : string
- Gets the directory for the Locale Files
- bb_get_string() : null|string
- Gets the Localized String by its Path
- __() : null|string
- Alias for "bb_get_string"
- ___() : null|string
- Gets the String using a Context instead of a Path
- bb_format_i18n_data() : null|array<string|int, mixed>
- Formats all I18n Data Strings with the given vars
- bb_send_mail_template() : bool
- Sends a Mail using the configured Mailer and a template in the current theme
- bb_send_mail() : bool
- Sends a Mail using the configured Mailer
- bb_register_maildriver() : void
- Registers a Mail Driver
- bb_get_maildriver() : null|IMailDriver
- Gets the Mail Driver
- bb_register_dbdriver() : void
- Registers a Database Driver
- bb_get_dbdriver() : null|IDatabaseDriver
- Gets a Database Driver registered to the type
- bb_get_menus() : null|array<string|int, mixed>
- Gets the Menus
- bb_get_menu() : null|array<string|int, mixed>
- Gets the Menu by the Id
- bb_register_menuitem() : void
- Registers a MenuItem in a category
- bb_sort_navigation() : array<string|int, mixed>
- Returns a Sorted Navigation for all Items
- bb_get_themes() : array<string|int, mixed>
- Gets all loaded Themes
- bb_load_theme() : null|ITheme
- Loads a theme by its Name, if not found or any errors by loading it the return will be null
- bb_this_theme() : null|ITheme
- Returns the current loaded theme or null if the initialization isn't executed successfully
- bb_set_this_theme() : void
- Sets the current loaded theme
- bb_get_installed_themes() : null|array<string|int, mixed>
- Gets all installed BB4 Themes
- theme_get_info() : array<string|int, mixed>
- Gets all essentials informations about a bb4 theme
- bb_register_twigfilter() : void
- Registers a custom TwigFilter
- bb_set_twigfilters() : void
- Sets the Custom TwigFilter Stack
- bb_get_twigfilters() : null|array<string|int, mixed>
- Gets all Custom TwigFilters
- bb_request() : bool
- bb_show_error() : never
- Displays an error Page
- bb_show_404() : never
- Displays a 404 Page
- bb_require_login() : string
- Tells bb4 that a login is required, so it shows its login page
- bb_perform_login() : bool
- Performs the BB4 Login
- bb_register_init() : void
- Registers a callable for the initialization process
- bb_call_userinit() : void
- Calls all custom registered initialization methods
- bb_register_viewcontroller() : bool
- Register a ViewController to the BB4 View Stack
- bb_path_for_viewcontroller() : null|string
- Gets the Path for a View Controller from the ViewControllerStack
- bb_get_viewcontroller() : null|IViewController
- Gets the ViewController for the given Path or null if not found
- bb_get_viewcontrollers() : array<string|int, mixed>
- Get all registered ViewControllers
- bb_register_modal() : bool
- Registers a Modal
- bb_get_modal() : null|IModal
- Gets a registered Modal by its ID
- bb_get_modals() : array<string|int, mixed>
- Gets all registered Modals
- bb_modal_url_for_id() : null|string
- Gets the URL for a Modal by its ID
- bb_modal_url() : null|string
- Gets the URL for a Modal
- _m() : null|string
- Gets the URL for a Modal (alias for bb_modal_url)
- bb_register_path_action() : bool
- Registers a custom Action for Path to the BB4 Stack
- bb_register_route() : bool
- Registers a static Route to the BB4 Stack
- bb_register_dynamic_route() : bool
- Registers a dynamic Route to the BB4 Stack
- bb_match_dynamic_route() : array<string|int, mixed>|false
- Matches a dynamic route against the given URI
- bb_set_rest_api_keys() : void
- Sets the RESTful API Keys
- bb_get_rest_api_keys() : mixed
- Gets all registered RESTful API Keys
- bb_get_rest_api_key_header() : mixed
- Gets the RESTful API Key Header
- bb_use_rest() : void
- Registers a RESTful Route to the BB4 Stack
- bb_use_ajax() : void
- Registers an AJAX Route to the BB4 Stack
- bb_register_generic_route() : bool
- Registers a generic Route to the BB4 Stack
- bb_get_route() : null|IRequestAction
- Gets the Action for the given Path or null if not found
- bb_parse_route() : null|IRoute
- Parses the given Path and returns the matching Route
- bb_get_routes() : array<string|int, mixed>
- Returns all registered static Routes
- bb_get_dynamic_routes() : array<string|int, mixed>
- Returns all registered dynamic Routes
- bb_register_api() : mixed
- Registers a custom API to the BB4 Stack
- bb_get_apis() : mixed
- bb_set_geoip_service() : void
- Sets the IP Geolocation Service to use
- bb_get_geoip_service() : mixed
- Gets the IP Geolocation Service
- bb_geocode_ip() : GeoIPResponse|null
- Geocodes an IP Address if a Geolocation Service is set
- bb_set_defpath() : void
- Set the default Path for an non-set requested action
- bb_get_defpath() : mixed
- Gets the default Path if the requested action is not set
- bb_set_path_myaccount() : void
- Sets the Path for the My Account Page
- bb_get_path_myaccount() : mixed
- Gets the Path for the My Account Page
- bb_set_404path() : void
- Sets the ActionPath if the requested Path doesn't exists.
- bb_get_404path() : mixed
- Gets the ActionPath for error code 404
- bb_get_rootdir() : string
- Gets the Root Directory of the BB4 Application
- bb_send_content_type() : void
- Send the Content Type Header (only if headers not sent yet)
- bb_start_session() : bool
- Starts a session
- bb_destroy_session() : bool
- Destroys a running session
- bb_get_user_auth() : string|null
- Reads the stored Device Authentication base token from the session
- bb_set_user_auth() : void
- Stores the Device Authentication base token in the session
- class_SetProperties() : mixed
- class_getProperty() : mixed
- class_toArray() : mixed
- class_toMultiArray() : mixed
- array_getSingleLevel() : mixed
- array_csv() : string
- array_rows_csv() : string
- array_replaceKeys() : mixed
- array_removeByValue() : mixed
- sql_BuildWhereClause() : mixed
- sha256_generateToken() : mixed
- _rv() : mixed
- strex_randomString() : mixed
- strex_getRangeString() : mixed
- strex_replaceByArray() : mixed
- strex_startsWith() : mixed
- strex_startsWithIgnorecase() : mixed
- strex_endsWith() : mixed
- strex_endsWithIgnorecase() : mixed
- strex_contains() : mixed
- strex_containsIgnorecase() : mixed
- strex_pathCombine() : string
- Combines Parts in an Array using the delimiter
- strex_limitToChars() : true
- Limits a String to only some allowed characters
- regex_replace() : string
- Replaces Occurences defined by Patterns using Regex
- php_getDeclaredClassesOfType() : mixed
- php_autoload() : mixed
- dir_includeFiles() : mixed
- dir_getFiles() : mixed
- dir_getDirectories() : mixed
- file_GetNameWithoutExtension() : mixed
- sess_get() : mixed
- query_get() : mixed
- post_get() : mixed
- header_get() : mixed
- arr_get() : mixed
- boolvalex() : mixed
- mail_splitaddresses() : array<string|int, mixed>
- sql_GetWhereSelector() : mixed
- sql_BuildOptions() : mixed
- sql_BuildList() : mixed
- sql_BuildBaseFilter() : array<string|int, mixed>
- sql_BuildInsertString() : mixed
- sql_BuildUpdateString() : mixed
- php_safe_redirect() : mixed
- safe_redirect() : mixed
- php_get_current_url() : mixed
- html_sanitize() : mixed
- time_diff() : int|float
- Gets the Difference between two times
- calc_date_diff() : string|array<string|int, float>
- Calculates the Difference between two Dates
- date_toDecimalHours() : mixed
- Converts a Time HH:mm to a Decimal Time
- decimal_HoursToFormat() : string
- Converts a Decimal Time to HH:mm
- convertToHoursMins() : string
- Converts a Time in Minutes to HH:mm
- days_between_dates() : float
- Returns the Days between two dates
- is_expired() : bool
- Checks if a Date is Expired
- php_getUploadedFiles() : array<string|int, mixed>|null
- Gets all Uploaded Files for a multi File POST Upload
- php_getPostFieldsStartsWith() : array<string|int, mixed>|null
- Gets all Post Fields starting with
- get_url_allowed_chars() : string
- Gets all Allowed characters in an URL
- make_page_slug() : string|null
- Gets a Slug for a given string
- make_file_name() : string|array<string|int, string>|null
- Limits the string to a FileName
- strex_validateEuVatID() : bool
- Validates an EU Vat ID
- strex_validateName() : bool
- Validates a Name
- strex_validatePhone() : bool
- Validates a Phone Number
- strex_parseName() : null|array<string|int, mixed>
- Parses a Name from a string (must starts with firstname)
- options() : mixed
- Gets rendered Options
- options_inline() : string
- Render Inline Options
- options_dropdown() : string
- Render DropDown Options
- option() : array<string|int, mixed>
- Creates a new Option Item
- modal_option() : void
- Creates a new Modal Option Item
- check_date() : bool
- Checks if a Date is valid
- check_time() : int|false
- Checks if a Time is valid
- br2ln() : mixed
- Reverse nl2br
- resize_image() : never
- Resizes an Image to a destination size Supported: image/jpeg image/gif image/png
- validate_file() : bool
- Validates a File
- validate_image() : bool
- Validates an Image File
- validate_json() : bool
- Checks whether a String is valid Json
- scale_by_ratio() : array<string|int, mixed>
- Scales a Size by Ratio
- get_dates_in_range() : array<string|int, mixed>|null
- Gets all Dates in a Range
- is_weekday() : bool
- Checks if a Date is a WeekDay
- format_time() : string|false
- Formats the time using the current active locale
- format_date() : string|false
- Formats the date using the current active locale
- format_datetime() : string|false
- Formats the datetime using the current active locale
- format_decimal() : string
- Formats a decimal to local format
- format_price() : null|string
- Formats a Price to Local Format (without currency symbol)
- parse_price() : float
- Parses a price the local format
- parse_decimal() : float
- Parses a decimal from the local format
- get_ip() : mixed
- Returns the current remote peers ip address
- get_auth_header() : mixed
- Gets the Value of the Authorization Header
- parse_auth_header() : false|array<string|int, string>
- Parses the Authorization Header
- __setVar() : void
- Sets a Var in the Global Directory
- __getVar() : mixed
- Gets a Var from the Global Directory
- sanitize_output() : mixed
- Sanitizes the HTML Output
- getAttributesFromField() : array<string|int, mixed>
- Gets the Value of a Key in an Array
- getAttributeIfExists() : mixed
- Gets a specific Attribute from a Field if it exists
- isValidUUIDv4() : mixed
- com_create_guid() : mixed
- create_seeded_guid() : string
- Creates a Seeded GUID
- bb_setCookie() : bool
- Sets a Cookie
- twig_load() : Environment
- findContentFormatter() : object|null
- Tries to find a content formatter by its mime type
- getDeclaredContentFormatters() : array<string|int, string>
- Gets all declared content formatters
- getRequestedResponseContentFormatter() : mixed
- Tries to get the requested response content formatter
- getRequestedResponseFormat() : null|array<string|int, mixed>
- Gets the requested response format
- isFormEncoded() : bool
- Determines if the request body contains form data ($_POST)
- getFormFields() : array<string|int, mixed>
- Returns the form fields of the current request
- bb_log() : mixed
- bb_clear_expired_logs() : mixed
- bb_get_logs_dir() : mixed
- bb_register_REST_api() : void
- Registers a RESTful API method
- bb_get_request_method() : string
- Returns the Request Method of the current request (GET, POST, PUT, DELETE)
- bb_get_json_payload() : mixed
- Returns the JSON payload of the current request
- getAuthorizationHeader() : mixed
- Get header Authorization
- getBearerToken() : mixed
- get access token from header
- api_error() : array<string|int, mixed>
- Returns an API Error
- api_success() : array<string|int, mixed>
- Returns an API Success
Constants
ACCOUNT_MENU
public
mixed
ACCOUNT_MENU
= "account"
BB_APIS
public
mixed
BB_APIS
= "bb.apis"
BB_CACHE
public
mixed
BB_CACHE
= "bb.cache"
BB_CONTEXT
public
mixed
BB_CONTEXT
= "bb.context"
BB_DB
public
mixed
BB_DB
= "bb.database"
BB_DBDrivers
public
mixed
BB_DBDrivers
= "bb.dbdrivers"
BB_DEFAULTPATH
public
mixed
BB_DEFAULTPATH
= "bb.defaultPath"
BB_DISPLAYALERTS
public
mixed
BB_DISPLAYALERTS
= "bb.displayAlerts"
BB_DYNAMIC_ROUTES
public
mixed
BB_DYNAMIC_ROUTES
= "bb.dynamicRoutes"
BB_EVENT_HANDLERS
public
mixed
BB_EVENT_HANDLERS
= "bb.eventHandlers"
BB_IP_BLACKLIST
public
mixed
BB_IP_BLACKLIST
= "bb.ipBlacklist"
BB_IP_WHITELIST
public
mixed
BB_IP_WHITELIST
= "bb.ipWhitelist"
BB_IPGEOLOCATION
public
mixed
BB_IPGEOLOCATION
= "bb.ipGeolocation"
BB_LOCALE
public
mixed
BB_LOCALE
= "bb.locale"
BB_MailDrivers
public
mixed
BB_MailDrivers
= "bb.maildrivers"
BB_MENUS
public
mixed
BB_MENUS
= "bb.menus"
BB_MODALS
public
mixed
BB_MODALS
= "bb.modals"
BB_PATH404
public
mixed
BB_PATH404
= "bb.404"
BB_PATHMYACCOUNT
public
mixed
BB_PATHMYACCOUNT
= "bb.myaccount"
BB_REST_API_KEYS
public
mixed
BB_REST_API_KEYS
= "bb.restApiKeys"
BB_ROUTES
public
mixed
BB_ROUTES
= "bb.routes"
BB_SESSION_CACHE
public
mixed
BB_SESSION_CACHE
= "bb.sessionCache"
BB_SESSION_HISTORY
public
mixed
BB_SESSION_HISTORY
= "bb-history"
BB_SKIP_FILES
public
mixed
BB_SKIP_FILES
= "bb.skipFiles"
BB_THEME
public
mixed
BB_THEME
= "bb.theme"
BB_TWIGFILTERS
public
mixed
BB_TWIGFILTERS
= "bb.twigFilters"
BB_USERAUTH
public
mixed
BB_USERAUTH
= "bb.userauth"
BB_VAR_LANGUAGE
public
mixed
BB_VAR_LANGUAGE
= "language"
BB_VAR_THEME
public
mixed
BB_VAR_THEME
= "theme"
BB_VIEWCONTROLLERS
public
mixed
BB_VIEWCONTROLLERS
= "bb.viewControllers"
MAIN_MENU
public
mixed
MAIN_MENU
= "main"
Functions
_ajax()
_ajax(mixed $function[, mixed $query = null ][, mixed $null = "" ][, mixed $fullPath = true ][, mixed $ajaxPath = "ajax" ]) : mixed
Parameters
- $function : mixed
- $query : mixed = null
- $null : mixed = ""
- $fullPath : mixed = true
- $ajaxPath : mixed = "ajax"
getAjaxPathForFunction()
getAjaxPathForFunction(mixed $function[, array<string|int, mixed>|null $query = null ][, mixed $null = "" ][, mixed $fullPath = true ][, mixed $ajaxPath = "ajax" ]) : string|null
Parameters
- $function : mixed
- $query : array<string|int, mixed>|null = null
- $null : mixed = ""
- $fullPath : mixed = true
- $ajaxPath : mixed = "ajax"
Return values
string|nullbb_register_AJAX_api()
Registers a AJAX API method
bb_register_AJAX_api(AjaxController $instance, mixed $alias, callable $function[, bool $requiresAuth = false ][, mixed $requiredPermission = null ][, mixed $requiredFields = null ]) : void
Parameters
- $instance : AjaxController
- $alias : mixed
-
Path of the AJAX API (e.g. "category/method")
- $function : callable
-
The function that should be called when the API is requested (must accept one parameter for the payload)
- $requiresAuth : bool = false
-
True if the API requires authentication
- $requiredPermission : mixed = null
-
The permission that is required to access the API if it requires authentication
- $requiredFields : mixed = null
-
The fields that are required in the payload
autoload_dir()
autoload_dir(array<string|int, mixed>|null $directories) : mixed
Parameters
- $directories : array<string|int, mixed>|null
autoload()
autoload(mixed $configuration) : mixed
Parameters
- $configuration : mixed
bb_init()
Starts the Initialization Process and Database connection Steps: - Database connection - Load config from Database - Load locale - Load Theme
bb_init() : void
bb_register()
Starts the registration process of bb4 core functionality
bb_register() : void
bb_post_register()
bb_post_register() : mixed
bluebase_workflow()
Frontend workflow, render requested page or whatever have to be done
bluebase_workflow() : void
bb_add_alert()
Adds an Alert to the Stack
bb_add_alert(mixed $status, mixed $htmlText[, bool $dismissable = true ]) : void
Parameters
- $status : mixed
-
Status (primary|secondary|success|danger|warning|info|light|dark)
- $htmlText : mixed
-
Content of the Alert
- $dismissable : bool = true
-
Whether the alert is dismissable
bb_set_alerts()
Sets the Alert Stack
bb_set_alerts(array<string|int, mixed> $alerts) : void
Parameters
- $alerts : array<string|int, mixed>
bb_get_alerts()
Gets all Alerts
bb_get_alerts() : null|array<string|int, mixed>
Return values
null|array<string|int, mixed>bb_get_declared_apis()
Gets all loaded API Declarations
bb_get_declared_apis() : array<string|int, mixed>
Return values
array<string|int, mixed>bb_get_apimessage()
Gets an API Message with Localized Messages
bb_get_apimessage(mixed $messagePath[, string $titlePath = "default" ][, bool $error = false ][, bool $vibrate = false ][, bool $forceLoginValidation = false ]) : null|APIMessage
Parameters
- $messagePath : mixed
-
Path to the Message
- $titlePath : string = "default"
-
Path tot the Title (Default: default) - if null no title
- $error : bool = false
-
Is the Message an error
- $vibrate : bool = false
-
If true, device gives haptic feedback
- $forceLoginValidation : bool = false
-
If true, device forced reauthorization by user
Return values
null|APIMessagebb_format_apimessage()
Gets an API Message with Localized Messages and Formats it
bb_format_apimessage(null|array<string|int, mixed> $formats, mixed $messagePath[, string $titlePath = "default" ][, bool $error = false ][, bool $vibrate = false ][, bool $forceLoginValidation = false ]) : null|APIMessage
Parameters
- $formats : null|array<string|int, mixed>
-
String Formats
- $messagePath : mixed
-
Path to the Message
- $titlePath : string = "default"
-
Path tot the Title (Default: default) - if null no title
- $error : bool = false
-
Is the Message an error
- $vibrate : bool = false
-
If true, device gives haptic feedback
- $forceLoginValidation : bool = false
-
If true, device forced reauthorization by user
Return values
null|APIMessagebb_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
Return values
null|array<string|int, mixed>bb_cache()
Puts an Object in the Cache
bb_cache(mixed $key, mixed $obj[, bool $session = false ]) : mixed
Parameters
- $key : mixed
-
The Key the Item will stored by (must be unique, will be overwritten elsewise)
- $obj : mixed
-
The Object to Store (can be CacheObject with own CachePolicy, else default CachePolicy will used)
- $session : bool = false
-
Store the Item in the Session Cache?
bb_cache_get()
Returns a Item from the cache if its not expired, else null
bb_cache_get(mixed $key[, bool $session = false ]) : mixed
Parameters
- $key : mixed
-
Key the Item is stored in the Cache
- $session : bool = false
-
Is the Item stored in the Session Cache?
bb_cache_clear()
Clears everything in the Cache
bb_cache_clear([bool $session = false ]) : void
Parameters
- $session : bool = false
-
If true, the session will be cleared, else only the just-in-time cache
bb_connectdb()
Establishes a Database connection using the given configuration stack
bb_connectdb(array<string|int, mixed> $config) : bool
Parameters
- $config : array<string|int, mixed>
-
Configuration Stack with all Connection Parameters
Return values
bool —Returns true if connection is established successful
bb_setdb()
Sets the core Database
bb_setdb(IDatabaseDriver $db) : void
Parameters
- $db : IDatabaseDriver
-
DB to use
bb_db()
Gets the core Database or null
bb_db() : null|IDatabaseDriver
Return values
null|IDatabaseDriverbb_dbconnected()
Returns whether the Core Database is connected
bb_dbconnected() : bool
Return values
boolbb_dbalive()
Returns whether the Core Database is alive
bb_dbalive() : bool
Return values
boolbb_get_locales()
Gets all installed BB4 Locales
bb_get_locales() : null|array<string|int, mixed>
Return values
null|array<string|int, mixed>bb_get_installed_locales()
Gets all installed BB4 Locales
bb_get_installed_locales() : null|array<string|int, mixed>
Return values
null|array<string|int, mixed>locale_get_info()
Gets all essential informations about a bb4 locale
locale_get_info(I18nLanguage $locale) : array<string|int, null|string>
Parameters
- $locale : I18nLanguage
Return values
array<string|int, null|string>bb_load_locale()
Loads a locale by its fqn or null if nothing similiar can be found
bb_load_locale(mixed $fqn) : null|I18nLanguage
Parameters
- $fqn : mixed
-
Full Qualified Name of the Language
Return values
null|I18nLanguagebb_this_locale()
Gets the current active Locale or null if the initialization isn't executed successfully
bb_this_locale() : null|I18nLanguage
Return values
null|I18nLanguagebb_set_this_locale()
Sets the current active Locale
bb_set_this_locale(I18nLanguage $locale) : void
Parameters
- $locale : I18nLanguage
-
Locale Instance
bb_get_localedir()
Gets the directory for the Locale Files
bb_get_localedir() : string
Return values
stringbb_get_string()
Gets the Localized String by its Path
bb_get_string(mixed $path[, string|int|float $values = null ]) : null|string
Parameters
- $path : mixed
-
StringPath
- $values : string|int|float = null
-
Values
Return values
null|string__()
Alias for "bb_get_string"
__(mixed $path[, string|int|float $values = null ]) : null|string
Parameters
- $path : mixed
-
StringPath
- $values : string|int|float = null
-
Values
Return values
null|string___()
Gets the String using a Context instead of a Path
___(mixed $string[, mixed $values = null ][, mixed $context = null ]) : null|string
Parameters
- $string : mixed
-
The Strings Name
- $values : mixed = null
-
Values to insert
- $context : mixed = null
-
Context or null for current context
Return values
null|stringbb_format_i18n_data()
Formats all I18n Data Strings with the given vars
bb_format_i18n_data(mixed $localeData, mixed $subVars) : null|array<string|int, mixed>
Parameters
- $localeData : mixed
- $subVars : mixed
Return values
null|array<string|int, mixed>bb_send_mail_template()
Sends a Mail using the configured Mailer and a template in the current theme
bb_send_mail_template(string|array<string|int, mixed> $to, string $subject, string $template, array<string|int, mixed> $vars, null|array<string|int, mixed> $attachments[, null|string $from = null ][, null|string $from_name = null ][, bool $isBodyHtml = true ][, string $charset = "UTF-8" ]) : bool
Parameters
- $to : string|array<string|int, mixed>
-
Recipients as array or string (mail1;mail2 or mail1,mail2 or mail1 mail2)
- $subject : string
-
The Mails subject
- $template : string
-
Mail Template name
- $vars : array<string|int, mixed>
-
Vars for the Mail Template
- $attachments : null|array<string|int, mixed>
-
Attachment Files or null
- $from : null|string = null
-
Overwrite the From Mail
- $from_name : null|string = null
-
Overwrite the From Name
- $isBodyHtml : bool = true
-
Is the Body Html
- $charset : string = "UTF-8"
-
Charset for the Body
Return values
bool —True if sent successful or false if failed
bb_send_mail()
Sends a Mail using the configured Mailer
bb_send_mail(string|array<string|int, mixed> $to, string $subject, string $body, null|array<string|int, mixed> $attachments[, null|string $from = null ][, null|string $from_name = null ][, bool $isBodyHtml = true ][, string $charset = "UTF-8" ]) : bool
Parameters
- $to : string|array<string|int, mixed>
-
Recipients as array or string (mail1;mail2 or mail1,mail2 or mail1 mail2)
- $subject : string
-
The Mails subject
- $body : string
-
The Body (HTML or Plain text)
- $attachments : null|array<string|int, mixed>
-
Attachment Files or null
- $from : null|string = null
-
Overwrite the From Mail
- $from_name : null|string = null
-
Overwrite the From Name
- $isBodyHtml : bool = true
-
Is the Body Html
- $charset : string = "UTF-8"
-
Charset for the Body
Return values
bool —True if sent successful or false if failed
bb_register_maildriver()
Registers a Mail Driver
bb_register_maildriver(mixed $type, IMailDriver $driver) : void
Parameters
- $type : mixed
-
Type for configuration
- $driver : IMailDriver
-
Mail Driver Instance
bb_get_maildriver()
Gets the Mail Driver
bb_get_maildriver(mixed $type) : null|IMailDriver
Parameters
- $type : mixed
-
Type for configuration
Return values
null|IMailDriver —null if no driver is registered to this name
bb_register_dbdriver()
Registers a Database Driver
bb_register_dbdriver(mixed $type, IDatabaseDriver $driver) : void
Parameters
- $type : mixed
-
Type for configuration
- $driver : IDatabaseDriver
-
DB Driver Instance
bb_get_dbdriver()
Gets a Database Driver registered to the type
bb_get_dbdriver(mixed $type) : null|IDatabaseDriver
Parameters
- $type : mixed
-
Database Type
Return values
null|IDatabaseDriverbb_get_menus()
Gets the Menus
bb_get_menus() : null|array<string|int, mixed>
Return values
null|array<string|int, mixed>bb_get_menu()
Gets the Menu by the Id
bb_get_menu(mixed $menuId) : null|array<string|int, mixed>
Parameters
- $menuId : mixed
Return values
null|array<string|int, mixed>bb_register_menuitem()
Registers a MenuItem in a category
bb_register_menuitem(mixed $menuId, mixed $category, MenuItem $item[, mixed $permissionRequired = null ]) : void
Parameters
- $menuId : mixed
-
Id of the Menu (for instance: MainMenu, FooterMenu)
- $category : mixed
-
Category in the Menu
- $item : MenuItem
-
Item
- $permissionRequired : mixed = null
bb_sort_navigation()
Returns a Sorted Navigation for all Items
bb_sort_navigation() : array<string|int, mixed>
Return values
array<string|int, mixed>bb_get_themes()
Gets all loaded Themes
bb_get_themes() : array<string|int, mixed>
Return values
array<string|int, mixed>bb_load_theme()
Loads a theme by its Name, if not found or any errors by loading it the return will be null
bb_load_theme(mixed $theme) : null|ITheme
Parameters
- $theme : mixed
-
Name of the Theme to be loaded
Return values
null|ITheme —Returns null if any error or the theme doesn't exists
bb_this_theme()
Returns the current loaded theme or null if the initialization isn't executed successfully
bb_this_theme() : null|ITheme
Return values
null|IThemebb_set_this_theme()
Sets the current loaded theme
bb_set_this_theme(ITheme $theme) : void
Parameters
- $theme : ITheme
-
Theme to be set as loaded
bb_get_installed_themes()
Gets all installed BB4 Themes
bb_get_installed_themes() : null|array<string|int, mixed>
Return values
null|array<string|int, mixed>theme_get_info()
Gets all essentials informations about a bb4 theme
theme_get_info(ITheme $theme[, mixed $className = null ]) : array<string|int, mixed>
Parameters
- $theme : ITheme
- $className : mixed = null
Return values
array<string|int, mixed>bb_register_twigfilter()
Registers a custom TwigFilter
bb_register_twigfilter(TwigFilter $filter) : void
Parameters
- $filter : TwigFilter
bb_set_twigfilters()
Sets the Custom TwigFilter Stack
bb_set_twigfilters(array<string|int, mixed> $alerts) : void
Parameters
- $alerts : array<string|int, mixed>
bb_get_twigfilters()
Gets all Custom TwigFilters
bb_get_twigfilters() : null|array<string|int, mixed>
Return values
null|array<string|int, mixed>bb_request()
bb_request(mixed $requested) : bool
Parameters
- $requested : mixed
Return values
boolbb_show_error()
Displays an error Page
bb_show_error(mixed $errorCode[, mixed $isApi = false ]) : never
Parameters
- $errorCode : mixed
-
Error Code for Informations
- $isApi : mixed = false
Return values
neverbb_show_404()
Displays a 404 Page
bb_show_404() : never
Return values
neverbb_require_login()
Tells bb4 that a login is required, so it shows its login page
bb_require_login() : string
Return values
stringbb_perform_login()
Performs the BB4 Login
bb_perform_login() : bool
Return values
boolbb_register_init()
Registers a callable for the initialization process
bb_register_init(callable $callback[, int $priority = 99 ]) : void
Parameters
- $callback : callable
-
Initialization Callable
- $priority : int = 99
-
Priority, the higher the number, the lower the priority. If the priority is less than 0 the initialization will be called before bb4 initialization
bb_call_userinit()
Calls all custom registered initialization methods
bb_call_userinit([bool $postInitialization = true ]) : void
Parameters
- $postInitialization : bool = true
-
If false, only all Initializations Priorities less than 0 will be calles, if true all equals or larger than 0
bb_register_viewcontroller()
Register a ViewController to the BB4 View Stack
bb_register_viewcontroller(IViewController $viewController[, mixed $slug = null ]) : bool
Parameters
- $viewController : IViewController
-
ViewController to register
- $slug : mixed = null
-
Path (URL-Path), for instance path/to/viewcontroller becomes to www.website.org/path/to/viewcontroller
Return values
bool —Returns false if the path is used by another view controller
bb_path_for_viewcontroller()
Gets the Path for a View Controller from the ViewControllerStack
bb_path_for_viewcontroller(IViewController $viewController) : null|string
Parameters
- $viewController : IViewController
-
ViewController to find Path
Return values
null|stringbb_get_viewcontroller()
Gets the ViewController for the given Path or null if not found
bb_get_viewcontroller(mixed $path) : null|IViewController
Parameters
- $path : mixed
-
Path the ViewController is registered to
Return values
null|IViewControllerbb_get_viewcontrollers()
Get all registered ViewControllers
bb_get_viewcontrollers() : array<string|int, mixed>
Return values
array<string|int, mixed>bb_register_modal()
Registers a Modal
bb_register_modal(IModal $modal) : bool
Parameters
- $modal : IModal
-
Modal to register
Return values
boolbb_get_modal()
Gets a registered Modal by its ID
bb_get_modal(mixed $id) : null|IModal
Parameters
- $id : mixed
-
ID of the Modal
Return values
null|IModalbb_get_modals()
Gets all registered Modals
bb_get_modals() : array<string|int, mixed>
Return values
array<string|int, mixed>bb_modal_url_for_id()
Gets the URL for a Modal by its ID
bb_modal_url_for_id(mixed $modalId[, null|array<string|int, mixed> $query = null ]) : null|string
Parameters
- $modalId : mixed
-
Modal ID
- $query : null|array<string|int, mixed> = null
-
Query String
Return values
null|stringbb_modal_url()
Gets the URL for a Modal
bb_modal_url(Modal|string $modalOrClass[, null|array<string|int, mixed> $query = null ]) : null|string
Parameters
- $modalOrClass : Modal|string
- $query : null|array<string|int, mixed> = null
Return values
null|string_m()
Gets the URL for a Modal (alias for bb_modal_url)
_m(Modal|string $modalOrClass[, null|array<string|int, mixed> $query = null ]) : null|string
Parameters
- $modalOrClass : Modal|string
- $query : null|array<string|int, mixed> = null
Return values
null|stringbb_register_path_action()
Registers a custom Action for Path to the BB4 Stack
bb_register_path_action(mixed $path, IRequestAction $action) : bool
Parameters
- $path : mixed
-
Path (URL-Path), for instance path/to/action becomes to www.website.org/path/to/action
- $action : IRequestAction
-
Callable if this path is called
Return values
bool —Returns false if the path is used
bb_register_route()
Registers a static Route to the BB4 Stack
bb_register_route(mixed $routePath, IRoute $route) : bool
Parameters
- $routePath : mixed
-
Path (URL-Path), for instance path/to/route becomes to www.website.org/path/to/route
- $route : IRoute
-
Route to register
Return values
bool —Returns false if the path is used
bb_register_dynamic_route()
Registers a dynamic Route to the BB4 Stack
bb_register_dynamic_route(mixed $routePath, IRoute $route[, mixed $regex = null ]) : bool
Parameters
- $routePath : mixed
-
Path (URL-Path), for instance path/to/{0}/{1} becomes to www.website.org/path/to/123/456
- $route : IRoute
-
Route to register
- $regex : mixed = null
-
Optional Regex for the Route (for instance {0} = \d+)
Return values
boolbb_match_dynamic_route()
Matches a dynamic route against the given URI
bb_match_dynamic_route(mixed $uri) : array<string|int, mixed>|false
Parameters
- $uri : mixed
-
URI to match
Return values
array<string|int, mixed>|falsebb_set_rest_api_keys()
Sets the RESTful API Keys
bb_set_rest_api_keys(mixed $keys) : void
Parameters
- $keys : mixed
-
Array of RESTful API Keys
bb_get_rest_api_keys()
Gets all registered RESTful API Keys
bb_get_rest_api_keys() : mixed
bb_get_rest_api_key_header()
Gets the RESTful API Key Header
bb_get_rest_api_key_header() : mixed
bb_use_rest()
Registers a RESTful Route to the BB4 Stack
bb_use_rest() : void
bb_use_ajax()
Registers an AJAX Route to the BB4 Stack
bb_use_ajax() : void
bb_register_generic_route()
Registers a generic Route to the BB4 Stack
bb_register_generic_route(mixed $routePath, callable $exec[, mixed $accessPermission = null ]) : bool
Parameters
- $routePath : mixed
-
The Path to register
- $exec : callable
-
The Execution Function
- $accessPermission : mixed = null
-
Access Permission for the Route (optional)
Return values
boolbb_get_route()
Gets the Action for the given Path or null if not found
bb_get_route(mixed $path) : null|IRequestAction
Parameters
- $path : mixed
-
Path the action is registered to
Return values
null|IRequestActionbb_parse_route()
Parses the given Path and returns the matching Route
bb_parse_route(mixed $path, mixed &$args) : null|IRoute
Parameters
- $path : mixed
-
The Path to parse
- $args : mixed
-
Arguments for the Route out of the Path
Return values
null|IRoutebb_get_routes()
Returns all registered static Routes
bb_get_routes() : array<string|int, mixed>
Return values
array<string|int, mixed>bb_get_dynamic_routes()
Returns all registered dynamic Routes
bb_get_dynamic_routes() : array<string|int, mixed>
Return values
array<string|int, mixed>bb_register_api()
Registers a custom API to the BB4 Stack
bb_register_api(IAPIDeclaration $api) : mixed
Parameters
- $api : IAPIDeclaration
-
API to register
bb_get_apis()
bb_get_apis() : mixed
bb_set_geoip_service()
Sets the IP Geolocation Service to use
bb_set_geoip_service(IIPGeoLocationService $service) : void
Parameters
- $service : IIPGeoLocationService
-
Service to register
bb_get_geoip_service()
Gets the IP Geolocation Service
bb_get_geoip_service() : mixed
bb_geocode_ip()
Geocodes an IP Address if a Geolocation Service is set
bb_geocode_ip(mixed $ip) : GeoIPResponse|null
Parameters
- $ip : mixed
Return values
GeoIPResponse|nullbb_set_defpath()
Set the default Path for an non-set requested action
bb_set_defpath(mixed $path) : void
Parameters
- $path : mixed
-
Default Path
bb_get_defpath()
Gets the default Path if the requested action is not set
bb_get_defpath() : mixed
bb_set_path_myaccount()
Sets the Path for the My Account Page
bb_set_path_myaccount(mixed $path) : void
Parameters
- $path : mixed
-
Path to set
bb_get_path_myaccount()
Gets the Path for the My Account Page
bb_get_path_myaccount() : mixed
bb_set_404path()
Sets the ActionPath if the requested Path doesn't exists.
bb_set_404path(mixed $path) : void
Parameters
- $path : mixed
-
Path to the 404 Page or Action
bb_get_404path()
Gets the ActionPath for error code 404
bb_get_404path() : mixed
bb_get_rootdir()
Gets the Root Directory of the BB4 Application
bb_get_rootdir([mixed $subPath = null ]) : string
Parameters
- $subPath : mixed = null
-
May you want to append some subdir/file to get a full path
Return values
stringbb_send_content_type()
Send the Content Type Header (only if headers not sent yet)
bb_send_content_type([string $mimeType = Constants::JSON_MIME ][, string $encoding = null ]) : void
Parameters
- $mimeType : string = Constants::JSON_MIME
-
Content Type
- $encoding : string = null
-
Content Encoding
bb_start_session()
Starts a session
bb_start_session() : bool
Return values
bool —true if session is started successfully
bb_destroy_session()
Destroys a running session
bb_destroy_session() : bool
Return values
bool —true if session is destroyed successfully
bb_get_user_auth()
Reads the stored Device Authentication base token from the session
bb_get_user_auth() : string|null
Return values
string|nullbb_set_user_auth()
Stores the Device Authentication base token in the session
bb_set_user_auth(mixed $token) : void
Parameters
- $token : mixed
-
BaseToken
class_SetProperties()
class_SetProperties(array<string|int, mixed> $array, mixed &$obj) : mixed
Parameters
- $array : array<string|int, mixed>
- $obj : mixed
class_getProperty()
class_getProperty(mixed $obj, mixed $property) : mixed
Parameters
- $obj : mixed
- $property : mixed
class_toArray()
class_toArray(object|null $obj) : mixed
Parameters
- $obj : object|null
class_toMultiArray()
class_toMultiArray(array<string|int, mixed> $objArray) : mixed
Parameters
- $objArray : array<string|int, mixed>
array_getSingleLevel()
array_getSingleLevel(array<string|int, mixed> $multiLevel[, mixed $delimiter = "->" ][, mixed $onlyStrings = false ]) : mixed
Parameters
- $multiLevel : array<string|int, mixed>
- $delimiter : mixed = "->"
- $onlyStrings : mixed = false
array_csv()
array_csv(array<string|int, mixed> $fields) : string
Parameters
- $fields : array<string|int, mixed>
Return values
stringarray_rows_csv()
array_rows_csv(array<string|int, mixed> $rows) : string
Parameters
- $rows : array<string|int, mixed>
Return values
stringarray_replaceKeys()
array_replaceKeys(mixed $oldKey, mixed $newKey, array<string|int, mixed> $input) : mixed
Parameters
- $oldKey : mixed
- $newKey : mixed
- $input : array<string|int, mixed>
array_removeByValue()
array_removeByValue(mixed &$array, mixed $value) : mixed
Parameters
- $array : mixed
- $value : mixed
sql_BuildWhereClause()
sql_BuildWhereClause(array<string|int, mixed>|null $whereData) : mixed
Parameters
- $whereData : array<string|int, mixed>|null
sha256_generateToken()
sha256_generateToken([mixed $seed = null ]) : mixed
Parameters
- $seed : mixed = null
_rv()
_rv(IViewController $viewController[, mixed $authenticatedUser = null ][, mixed $exit = false ]) : mixed
Parameters
- $viewController : IViewController
- $authenticatedUser : mixed = null
- $exit : mixed = false
strex_randomString()
strex_randomString([mixed $length = 10 ]) : mixed
Parameters
- $length : mixed = 10
strex_getRangeString()
strex_getRangeString(mixed $str[, mixed $isNumericRange = false ][, mixed $uniqueItems = true ][, string $baseDelimiter = "," ][, string $rangeDelimiter = "-" ]) : mixed
Parameters
- $str : mixed
- $isNumericRange : mixed = false
- $uniqueItems : mixed = true
- $baseDelimiter : string = ","
- $rangeDelimiter : string = "-"
strex_replaceByArray()
strex_replaceByArray(mixed $str, array<string|int, mixed> $replace[, mixed $prefix = "" ][, mixed $suffix = "" ][, mixed $replaceValues = false ][, mixed $twoLevelReplacements = false ]) : mixed
Parameters
- $str : mixed
- $replace : array<string|int, mixed>
- $prefix : mixed = ""
- $suffix : mixed = ""
- $replaceValues : mixed = false
- $twoLevelReplacements : mixed = false
strex_startsWith()
strex_startsWith(mixed $string, mixed $startsWith) : mixed
Parameters
- $string : mixed
- $startsWith : mixed
strex_startsWithIgnorecase()
strex_startsWithIgnorecase(mixed $string, mixed $startsWith) : mixed
Parameters
- $string : mixed
- $startsWith : mixed
strex_endsWith()
strex_endsWith(mixed $string, mixed $endsWith) : mixed
Parameters
- $string : mixed
- $endsWith : mixed
strex_endsWithIgnorecase()
strex_endsWithIgnorecase(mixed $string, mixed $endsWith) : mixed
Parameters
- $string : mixed
- $endsWith : mixed
strex_contains()
strex_contains(mixed $string, mixed $what) : mixed
Parameters
- $string : mixed
- $what : mixed
strex_containsIgnorecase()
strex_containsIgnorecase(mixed $string, mixed $what) : mixed
Parameters
- $string : mixed
- $what : mixed
strex_pathCombine()
Combines Parts in an Array using the delimiter
strex_pathCombine(array<string|int, mixed> $parts[, string $delimiter = "/" ]) : string
Parameters
- $parts : array<string|int, mixed>
-
All Parts to combine
- $delimiter : string = "/"
-
Delimiter
Return values
stringstrex_limitToChars()
Limits a String to only some allowed characters
strex_limitToChars(mixed $input, mixed $allowedChars[, string $replaceTo = "" ]) : true
Parameters
- $input : mixed
- $allowedChars : mixed
- $replaceTo : string = ""
Return values
trueregex_replace()
Replaces Occurences defined by Patterns using Regex
regex_replace(string $in, array<string|int, mixed> $patterns) : string
Parameters
- $in : string
-
StringStack for Replacement
- $patterns : array<string|int, mixed>
-
All Patterns to replace ("PATTERN (A-z*)" => "Replace $1")
Return values
stringphp_getDeclaredClassesOfType()
php_getDeclaredClassesOfType(mixed $class) : mixed
Parameters
- $class : mixed
php_autoload()
php_autoload(mixed $directory[, bool $includeSubdirs = false ]) : mixed
Parameters
- $directory : mixed
- $includeSubdirs : bool = false
dir_includeFiles()
dir_includeFiles(mixed $directory[, array<string|int, mixed>|null $extFilter = null ][, bool $includeSubdirs = false ]) : mixed
Parameters
- $directory : mixed
- $extFilter : array<string|int, mixed>|null = null
- $includeSubdirs : bool = false
dir_getFiles()
dir_getFiles(mixed $directory[, array<string|int, mixed>|null $extFilter = null ][, bool $includeSubdirs = false ][, bool $useFullPath = true ]) : mixed
Parameters
- $directory : mixed
- $extFilter : array<string|int, mixed>|null = null
- $includeSubdirs : bool = false
- $useFullPath : bool = true
dir_getDirectories()
dir_getDirectories(mixed $directory[, bool $includeSubdirs = false ]) : mixed
Parameters
- $directory : mixed
- $includeSubdirs : bool = false
file_GetNameWithoutExtension()
file_GetNameWithoutExtension(mixed $fileName) : mixed
Parameters
- $fileName : mixed
sess_get()
sess_get(mixed $key[, mixed $null = null ]) : mixed
Parameters
- $key : mixed
- $null : mixed = null
query_get()
query_get(mixed $key[, mixed $null = null ]) : mixed
Parameters
- $key : mixed
- $null : mixed = null
post_get()
post_get(mixed $key[, mixed $null = null ]) : mixed
Parameters
- $key : mixed
- $null : mixed = null
header_get()
header_get(mixed $header[, mixed $null = null ]) : mixed
Parameters
- $header : mixed
- $null : mixed = null
arr_get()
arr_get(mixed $arr, mixed $key[, mixed $default = null ]) : mixed
Parameters
- $arr : mixed
- $key : mixed
- $default : mixed = null
boolvalex()
boolvalex(mixed $value) : mixed
Parameters
- $value : mixed
mail_splitaddresses()
mail_splitaddresses(mixed $addresses) : array<string|int, mixed>
Parameters
- $addresses : mixed
Return values
array<string|int, mixed>sql_GetWhereSelector()
sql_GetWhereSelector(mixed $fieldName, mixed $idValue[, mixed $useLike = false ]) : mixed
Parameters
- $fieldName : mixed
- $idValue : mixed
- $useLike : mixed = false
sql_BuildOptions()
sql_BuildOptions(array<string|int, mixed>|null $options) : mixed
Parameters
- $options : array<string|int, mixed>|null
sql_BuildList()
sql_BuildList(array<string|int, mixed>|null $options) : mixed
Parameters
- $options : array<string|int, mixed>|null
sql_BuildBaseFilter()
sql_BuildBaseFilter(array<string|int, mixed>|null $filter) : array<string|int, mixed>
Parameters
- $filter : array<string|int, mixed>|null
Return values
array<string|int, mixed>sql_BuildInsertString()
sql_BuildInsertString(object $obj[, array<string|int, mixed>|null $ignoreFields = null ][, array<string|int, mixed>|null $skipFieldsIfEmpty = null ][, array<string|int, mixed>|null $notNullableFields = null ][, bool $hideInsertIndex = false ]) : mixed
Parameters
- $obj : object
- $ignoreFields : array<string|int, mixed>|null = null
- $skipFieldsIfEmpty : array<string|int, mixed>|null = null
- $notNullableFields : array<string|int, mixed>|null = null
- $hideInsertIndex : bool = false
sql_BuildUpdateString()
sql_BuildUpdateString(object $obj[, array<string|int, mixed>|null $ignoreFields = null ][, array<string|int, mixed>|null $skipFieldsIfEmpty = null ][, array<string|int, mixed>|null $notNullableFields = null ][, mixed $idField = null ]) : mixed
Parameters
- $obj : object
- $ignoreFields : array<string|int, mixed>|null = null
- $skipFieldsIfEmpty : array<string|int, mixed>|null = null
- $notNullableFields : array<string|int, mixed>|null = null
- $idField : mixed = null
php_safe_redirect()
php_safe_redirect(mixed $title, mixed $url[, mixed $exit = true ]) : mixed
Parameters
- $title : mixed
- $url : mixed
- $exit : mixed = true
safe_redirect()
safe_redirect(mixed $url) : mixed
Parameters
- $url : mixed
php_get_current_url()
php_get_current_url([mixed $includeQuery = false ]) : mixed
Parameters
- $includeQuery : mixed = false
html_sanitize()
html_sanitize(mixed $buffer) : mixed
Parameters
- $buffer : mixed
time_diff()
Gets the Difference between two times
time_diff(mixed $time1, mixed $time2) : int|float
Parameters
- $time1 : mixed
- $time2 : mixed
Return values
int|floatcalc_date_diff()
Calculates the Difference between two Dates
calc_date_diff(mixed $date1, mixed $date2[, bool $returnAsDate = false ]) : string|array<string|int, float>
Parameters
- $date1 : mixed
-
Date one
- $date2 : mixed
-
Date two
- $returnAsDate : bool = false
-
Return the result formatted as Y-m-d ?
Return values
string|array<string|int, float>date_toDecimalHours()
Converts a Time HH:mm to a Decimal Time
date_toDecimalHours(mixed $time) : mixed
Parameters
- $time : mixed
-
Time in HH:mm format (H:i in PHP)
decimal_HoursToFormat()
Converts a Decimal Time to HH:mm
decimal_HoursToFormat(mixed $dbl) : string
Parameters
- $dbl : mixed
-
Decimal Time
Return values
stringconvertToHoursMins()
Converts a Time in Minutes to HH:mm
convertToHoursMins(mixed $time[, string $format = '%02d:%02d' ]) : string
Parameters
- $time : mixed
-
Time in Minutes
- $format : string = '%02d:%02d'
-
Format
Return values
stringdays_between_dates()
Returns the Days between two dates
days_between_dates(mixed $date1, mixed $date2[, mixed $preventNegative = true ]) : float
Parameters
- $date1 : mixed
-
Date 1
- $date2 : mixed
-
Date 2
- $preventNegative : mixed = true
Return values
floatis_expired()
Checks if a Date is Expired
is_expired(mixed $date, mixed $expirationDays) : bool
Parameters
- $date : mixed
-
Date to check
- $expirationDays : mixed
-
Expiration days
Return values
boolphp_getUploadedFiles()
Gets all Uploaded Files for a multi File POST Upload
php_getUploadedFiles(mixed $name) : array<string|int, mixed>|null
Parameters
- $name : mixed
-
Name of the File Field
Return values
array<string|int, mixed>|nullphp_getPostFieldsStartsWith()
Gets all Post Fields starting with
php_getPostFieldsStartsWith(mixed $startsWith[, bool $includeValues = false ]) : array<string|int, mixed>|null
Parameters
- $startsWith : mixed
-
Chars the POST Field starts with
- $includeValues : bool = false
-
If true, the Key will be the field without startswith and the value is the POST Value
Return values
array<string|int, mixed>|nullget_url_allowed_chars()
Gets all Allowed characters in an URL
get_url_allowed_chars() : string
Return values
stringmake_page_slug()
Gets a Slug for a given string
make_page_slug(mixed $str[, mixed $tolower = true ]) : string|null
Parameters
- $str : mixed
- $tolower : mixed = true
Return values
string|nullmake_file_name()
Limits the string to a FileName
make_file_name(mixed $str[, bool $tolower = false ]) : string|array<string|int, string>|null
Parameters
- $str : mixed
- $tolower : bool = false
Return values
string|array<string|int, string>|nullstrex_validateEuVatID()
Validates an EU Vat ID
strex_validateEuVatID(mixed $vatId) : bool
Parameters
- $vatId : mixed
-
Vat ID
Return values
boolstrex_validateName()
Validates a Name
strex_validateName(mixed $name) : bool
Parameters
- $name : mixed
-
Input Name
Return values
boolstrex_validatePhone()
Validates a Phone Number
strex_validatePhone(mixed $phone) : bool
Parameters
- $phone : mixed
Return values
boolstrex_parseName()
Parses a Name from a string (must starts with firstname)
strex_parseName(mixed $name[, bool $middleName = false ]) : null|array<string|int, mixed>
Parameters
- $name : mixed
-
Input name
- $middleName : bool = false
-
Parse Middle Name, will include Middle Names as seperat parts, ID: 0 First Name, ID 1: Middle Name, ID 3: Last name
Return values
null|array<string|int, mixed> —Will return Array with Names, by default ID 0: First Name, ID: 1 Last name
options()
Gets rendered Options
options(array<string|int, mixed>|null $options[, mixed $shown = 3 ][, mixed $isAdvancedTable = true ]) : mixed
Parameters
- $options : array<string|int, mixed>|null
- $shown : mixed = 3
- $isAdvancedTable : mixed = true
options_inline()
Render Inline Options
options_inline(null|array<string|int, mixed> $options, mixed $isAdvancedTable) : string
Parameters
- $options : null|array<string|int, mixed>
- $isAdvancedTable : mixed
Return values
stringoptions_dropdown()
Render DropDown Options
options_dropdown(null|array<string|int, mixed> $options) : string
Parameters
- $options : null|array<string|int, mixed>
Return values
stringoption()
Creates a new Option Item
option(mixed $text, mixed $icon, mixed $href[, array<string|int, mixed>|null $hrefAttributes = null ][, mixed $autoApplyTitleAttribute = true ]) : array<string|int, mixed>
Parameters
- $text : mixed
-
Text for the Item
- $icon : mixed
-
Icon class or null
- $href : mixed
-
Link
- $hrefAttributes : array<string|int, mixed>|null = null
- $autoApplyTitleAttribute : mixed = true
Return values
array<string|int, mixed>modal_option()
Creates a new Modal Option Item
modal_option(mixed $text, mixed $icon, mixed $modalId[, bool $reusable = false ][, array<string|int, mixed>|null $queryParameters = null ][, null|array<string|int, mixed> $customAttributes = null ][, bool $autoApplyTitleAttribute = true ]) : void
Parameters
- $text : mixed
-
Text for the Item
- $icon : mixed
-
Icon class or null
- $modalId : mixed
-
Modal ID
- $reusable : bool = false
- $queryParameters : array<string|int, mixed>|null = null
- $customAttributes : null|array<string|int, mixed> = null
- $autoApplyTitleAttribute : bool = true
check_date()
Checks if a Date is valid
check_date(mixed $date[, bool $isTime = false ]) : bool
Parameters
- $date : mixed
-
Date to check
- $isTime : bool = false
-
is the Date already converted to time?
Return values
boolcheck_time()
Checks if a Time is valid
check_time(mixed $time) : int|false
Parameters
- $time : mixed
-
Time in HH:MM Format
Return values
int|falsebr2ln()
Reverse nl2br
br2ln(mixed $str[, string $lbr = "
" ]) : mixed
Parameters
- $str : mixed
-
String to Replace
- $lbr : string = " "
-
Linebreak Characters
resize_image()
Resizes an Image to a destination size Supported: image/jpeg image/gif image/png
resize_image(mixed $imagePath, mixed $width, mixed $height[, mixed $fileName = null ]) : never
Parameters
- $imagePath : mixed
- $width : mixed
- $height : mixed
- $fileName : mixed = null
Return values
nevervalidate_file()
Validates a File
validate_file(mixed $fileName[, null|array<string|int, mixed> $allowedMimeTypes = null ][, mixed $maxFileSize = null ]) : bool
Parameters
- $fileName : mixed
-
Full path to the File
- $allowedMimeTypes : null|array<string|int, mixed> = null
-
Array with allowed mime types
- $maxFileSize : mixed = null
-
Maximum File Size
Return values
boolvalidate_image()
Validates an Image File
validate_image(mixed $fileName[, null|array<string|int, mixed> $allowedMimeTypes = null ][, mixed $maxFileSize = null ]) : bool
Parameters
- $fileName : mixed
-
Full File Name
- $allowedMimeTypes : null|array<string|int, mixed> = null
-
Array with allowed mime types
- $maxFileSize : mixed = null
-
Maximum File Size
Return values
boolvalidate_json()
Checks whether a String is valid Json
validate_json(mixed $string) : bool
Parameters
- $string : mixed
Return values
boolscale_by_ratio()
Scales a Size by Ratio
scale_by_ratio(mixed $width, mixed $height, mixed $newWidth[, mixed $newHeight = null ][, bool $preventUpscale = true ]) : array<string|int, mixed>
Parameters
- $width : mixed
-
Original Width
- $height : mixed
-
Original Height
- $newWidth : mixed
-
Scaled Width or null to scale width
- $newHeight : mixed = null
-
Scaled Height or null to scale height
- $preventUpscale : bool = true
-
Prevent Upscaling
Return values
array<string|int, mixed>get_dates_in_range()
Gets all Dates in a Range
get_dates_in_range(mixed $firstDate, mixed $lastDate[, callable $checkDateCallback = null ]) : array<string|int, mixed>|null
Parameters
- $firstDate : mixed
- $lastDate : mixed
- $checkDateCallback : callable = null
Return values
array<string|int, mixed>|nullis_weekday()
Checks if a Date is a WeekDay
is_weekday(mixed $date[, bool $isTime = false ][, array<string|int, mixed> $weekDays = [1, 2, 3, 4, 5] ]) : bool
Parameters
- $date : mixed
-
Date to check
- $isTime : bool = false
-
Is the Date a Time
- $weekDays : array<string|int, mixed> = [1, 2, 3, 4, 5]
-
WeekDays
Return values
boolformat_time()
Formats the time using the current active locale
format_time(mixed $time[, bool $isTime = false ]) : string|false
Parameters
- $time : mixed
-
Time to format
- $isTime : bool = false
-
is the given Time already a parsed time?
Return values
string|falseformat_date()
Formats the date using the current active locale
format_date(mixed $time[, bool $isTime = false ]) : string|false
Parameters
- $time : mixed
-
Time to format
- $isTime : bool = false
-
is the given Time already a parsed time?
Return values
string|falseformat_datetime()
Formats the datetime using the current active locale
format_datetime(mixed $time[, bool $isTime = false ]) : string|false
Parameters
- $time : mixed
-
Time to format
- $isTime : bool = false
-
is the given Time already a parsed time?
Return values
string|falseformat_decimal()
Formats a decimal to local format
format_decimal(float $decimal[, mixed $decimals = 2 ][, mixed $trimZeros = false ]) : string
Parameters
- $decimal : float
-
Decimal
- $decimals : mixed = 2
- $trimZeros : mixed = false
Return values
stringformat_price()
Formats a Price to Local Format (without currency symbol)
format_price(mixed $price) : null|string
Parameters
- $price : mixed
Return values
null|stringparse_price()
Parses a price the local format
parse_price(string $localized) : float
Parameters
- $localized : string
-
Decimal
Return values
floatparse_decimal()
Parses a decimal from the local format
parse_decimal(string $localized) : float
Parameters
- $localized : string
-
Decimal
Return values
floatget_ip()
Returns the current remote peers ip address
get_ip() : mixed
get_auth_header()
Gets the Value of the Authorization Header
get_auth_header([string $headerName = "AUTHORIZATION" ][, bool $parseHeader = false ]) : mixed
Parameters
- $headerName : string = "AUTHORIZATION"
-
Name of the Auth Header
- $parseHeader : bool = false
parse_auth_header()
Parses the Authorization Header
parse_auth_header(mixed $headerData) : false|array<string|int, string>
Parameters
- $headerData : mixed
Return values
false|array<string|int, string>__setVar()
Sets a Var in the Global Directory
__setVar(mixed $var, mixed $val) : void
Parameters
- $var : mixed
-
Key
- $val : mixed
-
Value
__getVar()
Gets a Var from the Global Directory
__getVar(mixed $var[, mixed $default = NULL ]) : mixed
Parameters
- $var : mixed
-
Key
- $default : mixed = NULL
-
Default Value, if Key not found
sanitize_output()
Sanitizes the HTML Output
sanitize_output(mixed $buffer) : mixed
Parameters
- $buffer : mixed
getAttributesFromField()
Gets the Value of a Key in an Array
getAttributesFromField(string $class, string $fieldName) : array<string|int, mixed>
Parameters
- $class : string
- $fieldName : string
Tags
Return values
array<string|int, mixed>getAttributeIfExists()
Gets a specific Attribute from a Field if it exists
getAttributeIfExists(string $class, string $fieldName, string $attributeName) : mixed
Parameters
- $class : string
-
The Class
- $fieldName : string
-
The Field Name
- $attributeName : string
-
The Attribute Name
Tags
isValidUUIDv4()
isValidUUIDv4(mixed $uuid) : mixed
Parameters
- $uuid : mixed
com_create_guid()
com_create_guid() : mixed
create_seeded_guid()
Creates a Seeded GUID
create_seeded_guid(string $seed) : string
Parameters
- $seed : string
-
The Seed
Return values
stringbb_setCookie()
Sets a Cookie
bb_setCookie(mixed $name, mixed $value, mixed $expires[, string $samesite = "None" ]) : bool
Parameters
- $name : mixed
-
The Name of the Cookie
- $value : mixed
-
Value of the Cookie
- $expires : mixed
-
When the Cookie expires
- $samesite : string = "None"
-
If the Cookie is SameSite
Return values
bool —If the Cookie was set
twig_load()
twig_load(mixed $templateDir) : Environment
Parameters
- $templateDir : mixed
Return values
EnvironmentfindContentFormatter()
Tries to find a content formatter by its mime type
findContentFormatter(mixed $mimeType) : object|null
Parameters
- $mimeType : mixed
-
The mime type to search for
Return values
object|nullgetDeclaredContentFormatters()
Gets all declared content formatters
getDeclaredContentFormatters() : array<string|int, string>
Return values
array<string|int, string>getRequestedResponseContentFormatter()
Tries to get the requested response content formatter
getRequestedResponseContentFormatter([mixed $default = null ]) : mixed
Parameters
- $default : mixed = null
-
The default formatter to return if none is found
getRequestedResponseFormat()
Gets the requested response format
getRequestedResponseFormat() : null|array<string|int, mixed>
Return values
null|array<string|int, mixed>isFormEncoded()
Determines if the request body contains form data ($_POST)
isFormEncoded(string $body) : bool
Parameters
- $body : string
-
The request body
Return values
boolgetFormFields()
Returns the form fields of the current request
getFormFields(string $body) : array<string|int, mixed>
Parameters
- $body : string
Return values
array<string|int, mixed>bb_log()
bb_log(mixed $event[, mixed $warnLevel = Constants::LOG_INFO ][, mixed $time = null ]) : mixed
Parameters
- $event : mixed
- $warnLevel : mixed = Constants::LOG_INFO
- $time : mixed = null
bb_clear_expired_logs()
bb_clear_expired_logs() : mixed
bb_get_logs_dir()
bb_get_logs_dir() : mixed
bb_register_REST_api()
Registers a RESTful API method
bb_register_REST_api(float $version, mixed $requestMethod, mixed $alias, callable $function[, bool $requiresAuth = false ][, mixed $requiredPermission = null ][, mixed $requiredFields = null ]) : void
Parameters
- $version : float
- $requestMethod : mixed
-
The request method (GET, POST, PUT, DELETE)
- $alias : mixed
-
Path of the API (e.g. "category/method")
- $function : callable
-
The function that should be called when the API is requested (must accept one parameter for the payload)
- $requiresAuth : bool = false
-
True if the API requires authentication
- $requiredPermission : mixed = null
-
The permission that is required to access the API if it requires authentication
- $requiredFields : mixed = null
-
The fields that are required in the payload
bb_get_request_method()
Returns the Request Method of the current request (GET, POST, PUT, DELETE)
bb_get_request_method() : string
Return values
stringbb_get_json_payload()
Returns the JSON payload of the current request
bb_get_json_payload() : mixed
getAuthorizationHeader()
Get header Authorization
getAuthorizationHeader() : mixed
getBearerToken()
get access token from header
getBearerToken() : mixed
api_error()
Returns an API Error
api_error(mixed $error[, array<string|int, mixed> $fields = [] ]) : array<string|int, mixed>
Parameters
- $error : mixed
-
Error Message
- $fields : array<string|int, mixed> = []
-
Fields
Return values
array<string|int, mixed>api_success()
Returns an API Success
api_success(mixed $data) : array<string|int, mixed>
Parameters
- $data : mixed
-
Data