People, how to specify your group of settings (not default). Kohana 3.2.
Here is what a piece of code with pagination looks like.
$count = ORM::factory('product')->count_all(); $pagination = Pagination::factory(array( 'total_items' => $count, )); //Вывод из БД записей $products = ORM::factory('product') ->limit($pagination->items_per_page) ->order_by('id', 'desc') ->offset($pagination->offset) ->find_all();
This is what the config file looks like.
return array( // Application defaults 'default' => array( 'current_page' => array('source' => 'route', 'key' => 'page'), // source: "query_string" or "route" 'total_items' => 0, 'items_per_page' => 10, 'view' => 'pagination/floating', 'auto_hide' => TRUE, 'first_page_in_url' => FALSE, 'uri_segment' => 'page' ), 'admin' => array( 'current_page' => array('source' => 'route', 'key' => 'page'), // source: "query_string" or "route" 'total_items' => 0, 'items_per_page' => 50, 'view' => 'pagination/floating', 'auto_hide' => TRUE, 'first_page_in_url' => FALSE, 'uri_segment' => 'page' ), );