PHP Class Bolt\Twig\Handler\UtilsHandler

Show file Open project: bolt/bolt Class Usage Examples

Public Methods

Method Description
__construct ( Silex\Application $app )
fileExists ( string $fn, boolean $safe ) : boolean Check if a file exists.
printBacktrace ( integer $depth, boolean $safe ) : string | null Output pretty-printed backtrace.
printFirebug ( mixed $var, mixed $msg, boolean $safe ) : string Send debug data to the developers FirePHP instance in-browser.
redirect ( string $path, boolean $safe ) : string Redirect the browser to another page.
request ( string $parameter, string $from, boolean $stripSlashes, boolean $safe ) : mixed Return the requested parameter from $_REQUEST, $_GET or $_POST.

Private Methods

Method Description
allowDebug ( boolean $safe ) : boolean Helper function to determine if we're supposed to allow backtrace and firebug. If $safe is set or $this->app['debug'] is false, we don't allow it. Otherwise we show only to _logged on_ users, _or_ non-authenticated users, but then debug_show_loggedoff needs to be set.

Method Details

__construct() public method

public __construct ( Silex\Application $app )
$app Silex\Application

fileExists() public method

Check if a file exists.
public fileExists ( string $fn, boolean $safe ) : boolean
$fn string
$safe boolean
return boolean

printBacktrace() public method

Output pretty-printed backtrace.
public printBacktrace ( integer $depth, boolean $safe ) : string | null
$depth integer
$safe boolean
return string | null

printFirebug() public method

Send debug data to the developers FirePHP instance in-browser.
public printFirebug ( mixed $var, mixed $msg, boolean $safe ) : string
$var mixed The data to be dumped into FirePHP
$msg mixed The message to associate with the data
$safe boolean
return string FirePHP formatted string

redirect() public method

Redirect the browser to another page.
public redirect ( string $path, boolean $safe ) : string
$path string
$safe boolean
return string

request() public method

Return the requested parameter from $_REQUEST, $_GET or $_POST.
public request ( string $parameter, string $from, boolean $stripSlashes, boolean $safe ) : mixed
$parameter string The parameter to get
$from string 'GET' or 'POST', all the others falls back to REQUEST.
$stripSlashes boolean Apply stripslashes. Defaults to false.
$safe boolean
return mixed