Exemplo n.º 1
0
    var_dump($record->field_example);
    // set new value
    $record->field_example = 'new value';
    var_dump($record->field_example);
    // now this show new value
    // in this case, this work as "UPLOAD" query.
    $record->save();
    var_dump($record->field_example);
    // this show new value
    // this assign the value of record to var $value
    _::$view->assign('value', $record->field_example);
    // in the html, you able to use {$value} to show the value of $record
    // this request use example.tpl as html to return.
    _::$view->show('example');
    // this delete the record
    $record->delete();
    // this contain the last query executed by the ORM
    // you use this to debug in case of error
    $record->lastQuery;
    // this contain the last error in the last query executed by the orm
    $record->lastError;
});
// in this controller is exampled use of $_POST $_GET $_SESSION $_COOKIE vars
_::define_controller('example_3', function () {
    // if is set example parameter of type post
    if (isset(_::$post['example'])) {
        // this is a object of postVar class
        $object = _::$post['example'];
        // this show the string filtered (avoiding XSRF vulnerability)
        var_dump((string) $object);
        // if you don't like filter you use real() function to transform in original value.