Skip to content

Utilities

Emanuele Minotto edited this page May 1, 2016 · 6 revisions

The crystal microframework offers some utilities, like the 404 route.

These utilities are really simple and are defined like the Settings and Dependency Injection items.

Currently defined utilities are:

$server = $mf('server');

var_dump($server['SERVER_NAME']); // localhost

$mf('get') // -> $_GET (with double access)
$mf('post') // -> $_POST (with double access)
$mf('cookie') // -> $_COOKIE (with double access)
$mf('env') // -> $_ENV (with double access)
$mf('request') // -> $_REQUEST (with double access)
$mf('server') // -> $_SERVER (with double access)

$mf('double_access'); // -> Closure containing the double access utility

$data = array( ... );
$data = $mf('double_access', $data); // shortcut for the double access utility
Clone this wiki locally