[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-/