dump()
Dumps information about a variable, like var_dump() but with improved syntax and coloring.
dump(mixed $variable[, bool $export = false ]) : string|void
Parameters
- $variable : mixed
- $export : bool = false
Dumps information about a variable, like var_dump() but with improved syntax and coloring.
dump(mixed $variable[, bool $export = false ]) : string|void
Shorthand for sending DebugR messages.
debugr([mixed $variable = null ]) : DebugR
debugr()->log($var); instead of \Sledgehammer\DebugR::log($var); debugr($var); instead of \Sledgehammer\DebugR::dump($var).
Return the value of a variable or return null if the valiable not exist. (Prevents "Undefined variable" notices) WARNING! As a side-effect non existing variables are set to null.
value(mixed &$variable) : mixed
If you pass array element to value($var['index']) and $var didn't exist, an array is created: array('index' => null)
Use \Sledgehammer\array_value() which doesn't have this side effect for array.
Example: if (value($_GET['foo']) == 'bar') { instead of if (isset($_GET['foo']) && $_GET['foo'] == 'bar') {
Return the value of the array element or return null if the element doesn't exist. (Prevents "Undefined index" notices).
array_value(array<string|int, mixed> $array, string $key) : mixed
Example: if (\Sledgehammer\array_value($_GET, 'foo') == 'bar') { instead of if (isset($_GET['foo']) && $_GET['foo'] == 'bar') {
Report a fatal error (and stop executing).
error(string $message[, mixed $information = null ]) : mixed
It's preferred to throw Exceptions, which allows the calling code to react to the error.
The error
[optional] Additional information
Report a warning.
warning(string $message[, mixed $information = null ]) : mixed
The warning
[optional] Additional information
Report a notice.
notice(string $message[, mixed $information = null ]) : mixed
The notice
[optional] Additional information
Report deprecated functionality.
deprecated([string $message = 'This functionality will no longer be supported in upcomming releases' ][, mixed $information = null ]) : mixed
The message
[optional] Additional information
Report an exception.
report_exception(Exception $exception) : mixed
render($component) is an alias to $component->render() but render($component) generates a notice when the $component isn't a component compatible object instead of an fatal error.
render(mixed $component) : mixed
Check if $component is compatible with the Component interface via ducktyping.
is_component([Component &$component = '__UNDEFINED__' ]) : bool
Genereer een <script src=""> tag, mits deze al een keer gegenereerd is.
javascript_once(string $src[, string $identifier = null ]) : mixed