我是codeigniter的新手。我正在使用分页。分页链接显示得很好,但是当我点击任何链接时,我就会退出。这是我的代码,请检查是否需要更正
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Packages extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->model('admin_packages');
$this->load->model('common_model');
$this->load->helper(array('form', 'url'));
$this->load->library('form_validation');
$this->load->library('pagination');
$this->load->library('common');
}
function packages()
{
if(!$this->session->userdata('userid'))
redirect('index.php/users/login');
$ofset=0;
$config['base_url']='http://localhost/index.php/vehicles/packages/';
$config['total_rows']=$this>common_model>get_countt('packages_purchased','user_id',$this->session->userdata('userid'));
$config['per_page'] = '10';
$config['use_page_numbers'] = TRUE;
$config['full_tag_open'] = '<p align="center">';
$config['full_tag_close'] = '</p>';
$this->pagination->initialize($config);
if($this->uri->segment(3))
$ofset=($this->uri->segment(3)-1)*$config['per_page'];
$uid=$this->session->userdata('userid');
$bal=$this->vehicle->available_balance($uid);
$arr['balanc']=$bal->mots;
$arr['dtee']=$bal->dt;
$arr['pack']=$this->common_model->get_alldetails('packages','status',1);
$arr['det']=$this->vehicle->purchased_packages($this->session->userdata('userid'),$ofset,$config['per_page']);
$arr['page_title']='Reminder | Automated TEXT and Email Alerts for Garage Owners';
$this->breadcrumb->append_crumb("My Account<span> › <span>Packages", '/page');
$this->load->template('vehicles/purchased_packages',$arr);
}