Blaze Tama
Blaze Tama

Reputation: 10948

codeigniter's pagination css not working

NOTE : I just realized that something is wrong with my CSS, the browser only view my old css (means that i cant edit my css). Whats wrong?

I tried to follow this tutorial , but i dont do the exact same thing like the video.

I want to edit the appereance of my pagination links (using codeigniter). This is the controller code :

//pagination
    $config['base_url'] = site_url('/backend/umat/');
    //$config['base_url'] ='http://localhost/ci_gabdb/index.php/backend/umat/';
    $config['total_rows'] = $this->backend_m->count_umat();
    $config['per_page'] = 10; 
    $config['uri_segment'] = 3;
    $config['full_tag_open'] = '<div id="pagination">';
    $config['full_tag_close'] = '</div>';

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

    $data['pagination'] = $this->pagination->create_links();

Notice that i already use full_tag_open and full_tag_close. I also tried to manually insert the <div> tag in html, but none of them working.

This is my css code :

#pagination a {
    font-family: Tahoma, Geneva, sans-serif;
    font-size: 10px;
    color: #292929;
    text-decoration: none;
    background: #e3e3e3;
    border: 1px solid #000;
    padding: 4px 7px;
}

I think the paginations css should working properly, but its not. Where is my mistake? Thanks :D

Upvotes: 0

Views: 3441

Answers (2)

Rick Calder
Rick Calder

Reputation: 18685

What you have is a browser caching problem. There are a couple of solutions, hitting CTRL + F5 a few times in any browser will force a full refresh of the site. There are other ways to force CSS refreshes. One is to append a querystring to the CSS in your code the one I use in development is this:

   <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/main.css?time=<?php echo filemtime('./assets/css/main.css');?>" />

What that does is append the end of the css with a query string and changes with the time, so every time I load the page my browser thinks it's a new version of the CSS and reloads it.

You can also tell your browser to reload the entire page on every visit, where this setting is differs in all the browsers but in Chrome it's

Settings > Advanced Settings > Change Proxy Settings > General Tab > Browser History Settings > Temporary Internet Files change the radio button to every time I load a web page.

Upvotes: 1

Shina
Shina

Reputation: 2066

This is what I am using:

    // pagination code
    $config = array();
    $config["base_url"] = base_url() . "/themes/all";
    $config["total_rows"] = $this->auth_model->record_count();
    $config["per_page"] = 30;
    $config["uri_segment"] = 3;
    $choice = $config["total_rows"] / $config["per_page"];
    $config["num_links"] = round($choice);
    $config['full_tag_open'] = '<div class="pagination pagination-large"><ul>';
    $config['full_tag_close'] = '</ul></div>';
    $config['first_link'] = false;
    $config['last_link'] = false;
    $config['first_tag_open'] = '<li>';
    $config['first_tag_close'] = '</li>';
    $config['prev_link'] = '«';
    $config['prev_tag_open'] = '<li class="prev">';
    $config['prev_tag_close'] = '</li>';
    $config['next_link'] = '»';
    $config['next_tag_open'] = '<li>';
    $config['next_tag_close'] = '</li>';
    $config['last_tag_open'] = '<li>';
    $config['last_tag_close'] = '</li>';
    $config['cur_tag_open'] =  '<li class="active"><a href="#">';
    $config['cur_tag_close'] = '</a></li>';
    $config['num_tag_open'] = '<li>';
    $config['num_tag_close'] = '</li>';

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

    $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;
    $data["themes"] = $this->auth_model->fetch_themes_total($config["per_page"], $page);
    $data["links"] = $this->pagination->create_links();
    // pagination ends here

Upvotes: 3

Related Questions