Welcome Guest, Not a member yet? Register   Sign In
Cannot extend pagination class?
#1

[eluser]fancms[/eluser]
Because there are several config settings for pagination that I would use over and over again it made sense (to me) to create a function where, when using it, I could simply plug in the 2 or 3 variables needed and all would be well.

However, when I tried to create a library extending the Pagination class (which I assume is what I would need to do to extend said class), I keep getting a Fatal error that says the pagination class does not exist. I've tried several different methods, including loading the Pagination class prior to using my library, and still no go. I double-checked that the library I wrote was in the /application/libraries folder. I'm simply stumped.

Here's the code I have for my library:

Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Quickpage extends Pagination {
    
function Quickpage() {
     parent::Pagination();
    
}
    
function go($pageit,$totalrows,$perpage)
     {
          $domain = $this->config->item('base_url');
          $config = array("base_url" => $domain.$pageit,
                          "total_rows" => $totalrows,
                          "per_page" => $perpage,
          );
          
          $this->pagination->initialize($config);

          return $this->pagination->create_links();
     }    
    
}
?>

The pagination function works fine by itself, so I'm totally confused here 8-/


Messages In This Thread
Cannot extend pagination class? - by El Forum - 10-28-2007, 07:12 AM
Cannot extend pagination class? - by El Forum - 10-28-2007, 07:48 AM
Cannot extend pagination class? - by El Forum - 10-28-2007, 08:55 AM
Cannot extend pagination class? - by El Forum - 10-28-2007, 09:30 AM
Cannot extend pagination class? - by El Forum - 10-28-2007, 09:54 AM
Cannot extend pagination class? - by El Forum - 10-28-2007, 10:33 AM
Cannot extend pagination class? - by El Forum - 11-07-2007, 08:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB