Documentation

Workflow.php

Table of Contents

Functions

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

Functions

bb_request()

bb_request(mixed $requested) : bool
Parameters
$requested : mixed
Return values
bool

bb_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
never

bb_show_404()

Displays a 404 Page

bb_show_404() : never
Return values
never

bb_require_login()

Tells bb4 that a login is required, so it shows its login page

bb_require_login() : string
Return values
string

bb_perform_login()

Performs the BB4 Login

bb_perform_login() : bool
Return values
bool

bb_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|string

bb_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|IViewController

bb_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
bool

bb_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|IModal

bb_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|string

bb_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|string

bb_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
bool

bb_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>|false

bb_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
bool

bb_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|IRequestAction

bb_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|IRoute

bb_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_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|null

bb_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
string

bb_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|null

bb_set_user_auth()

Stores the Device Authentication base token in the session

bb_set_user_auth(mixed $token) : void
Parameters
$token : mixed

BaseToken


        
On this page

Search results