Esempio n. 1
0
src\route::add('', config::routefunction('main', 'welcome'));
src\route::add('file/(.*)', config::routefunction('file', 'getFile'));
src\route::add('register', function () {
    $ble = src\factory::getAuth();
    echo $ble->register();
});
src\route::add('login', function () {
    $ble = new aut\userauth();
    if ($ble->login()) {
        echo 'logged in';
    } else {
        echo 'nooob';
    }
});
src\route::add('userschema', function () {
    $data = factory::getSql();
    if ($data == null) {
        echo 'shut the f**k up';
    }
    $std = 'class webusers{ ';
    foreach ($data->getCells('webusers') as $key => $value) {
        $std .= 'public $' . $value . '; ';
    }
    $std .= '}';
    echo $std;
});
//complex route with parameter
src\route::add('user:(.*)', function ($id) {
    //Do something
    echo 'Edit user with id ' . $id;
});