Welcome Guest, Not a member yet? Register   Sign In
problem with url
#11

[eluser]kv[/eluser]
ok let me explain .
Here is my controller code plz see the below.

file one controller:

class Contact_list extends Controller
{
function Contact_list() {
parent::Controller();
$this->load->helper(’url’);
$this->load->library(’session’);
$this->load->database();
$this->admin_url =$this->config->item(’admin_url’);
}

function index()
{

//load pagination class
$this->load->library(’pagination’);
$config[’base_url’] = $this->admin_url.’/contact_list/index/’;
$config[’total_rows’] = $this->db->count_all(’tbl_contact’);
$config[’per_page’] = ‘1’;
$config[’full_tag_open’] = ‘<p>’;
$config[’full_tag_close’] = ‘</p>’;

$this->pagination->initialize($config);

//load the model and get results
$this->load->model(’contact_model’);
echo $this->uri->segment(4);

$data[’results’] = $this->contact_model->get_books($config[’per_page’],$this->uri->segment(4));

// load the HTML Table Class
$this->load->library(’table’);
$this->table->set_heading(’First Name’, ‘Last Name’, ‘Email’, ‘Contact Date’,’Action’);

// load the view
$this->load->view(’admin/contactlist_form’, $data);
}
}

///model////
class contact_model extends Model {

function __construct(){
parent::Model();
}

function get_books($num, $offset) {
$query = $this->db->get(’tbl_contact’, $num, $offset);

return $query;
}
}

view page:

$this->load->view($this->config->item(’ADMIN_dir’).’header’);
$admin_url =$this->config->item(’admin_url’);

echo $this->table->generate($results);
echo $this->pagination->create_links();
$this->load->view($this->config->item(’ADMIN_dir’).’footer’);


Messages In This Thread
problem with url - by El Forum - 11-20-2007, 04:33 PM
problem with url - by El Forum - 11-20-2007, 04:55 PM
problem with url - by El Forum - 11-20-2007, 05:25 PM
problem with url - by El Forum - 11-20-2007, 05:36 PM
problem with url - by El Forum - 11-20-2007, 07:59 PM
problem with url - by El Forum - 11-20-2007, 08:05 PM
problem with url - by El Forum - 11-20-2007, 08:30 PM
problem with url - by El Forum - 11-20-2007, 08:50 PM
problem with url - by El Forum - 11-21-2007, 08:41 AM
problem with url - by El Forum - 11-21-2007, 09:37 AM
problem with url - by El Forum - 11-21-2007, 09:48 AM
problem with url - by El Forum - 11-21-2007, 11:43 AM
problem with url - by El Forum - 11-21-2007, 12:32 PM
problem with url - by El Forum - 11-21-2007, 03:39 PM
problem with url - by El Forum - 11-21-2007, 04:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB