Brimbox Logo Brimbox Version 2.3.4 Released


This method to set and return a value based on whether a constant is declared and set, usually declared in file bb_constants.php.

Class: bb_main, called as $main

File: bb_main.php (php)


function get_constant($constant, $default = "")


$value = $main->get_constant('CONSTANT', $default);

Outputs: Value of constant if constant is set, otherwise the default.

Parameter: $constant (constant)
The name of the constant being evaluated, can be set: $constant = ‘CONSTANT’

Parameter: $default (mixed)
The default value of the constant if not set or defined.

Updated: 2016-07-07