Ejemplo n.º 1
0
 /**
  * @return array
  */
 public function current()
 {
     $current = $this->get('decorator')->current();
     if (isset($current['number'])) {
         $current['offset'] = Opc_Paginator::countOffset($current['number'], $this->get('limit'));
     }
     return $current;
 }
Ejemplo n.º 2
0
Opl_Loader::loadPaths($config);
Opl_Loader::setCheckFileExists(false);
Opl_Loader::register();
Opl_Registry::setState('opl_debug_console', false);
Opl_Registry::setState('opl_extended_errors', true);
try {
    $tpl = new Opt_Class();
    $tpl->sourceDir = './templates/';
    $tpl->compileDir = './templates_c/';
    $tpl->charset = 'utf-8';
    $tpl->compileMode = Opt_Class::CM_REBUILD;
    $tpl->stripWhitespaces = false;
    //$tpl->register(Opt_Class::OPT_FORMAT, 'Paginator', 'Opc_Paginator_DataFormat');
    $tpl->setup();
    $opc = new Opc_Class();
    $pager = Opc_Paginator::create(1000, 13);
    // returns Opc_Paginator_Pager;
    $pager->all = 1000;
    $pager->page = isset($_GET['page']) ? $_GET['page'] : 1;
    $view = new Opt_View('paginator_opt.tpl');
    $view->pager = $pager;
    //$view->setFormat('pager', 'Paginator');
    $view->setFormat('pager', 'Objective/Array');
    $view->setFormat('pager.decorator', 'Objective');
    $out = new Opt_Output_Http();
    $out->setContentType(Opt_Output_Http::HTML);
    $out->render($view);
} catch (Opc_Exception $exception) {
    $handler = new Opc_ErrorHandler();
    $handler->display($exception);
} catch (Opt_Exception $exception) {
Ejemplo n.º 3
0
 public function testTicket138()
 {
     $opc = new Opc_Class();
     $paginator = Opc_Paginator::create(0, 100);
 }