Pagination is a piece of cake in codeigniter but adding sorting columns is one heck of a task. This is how i did it The Controller <?php class View extends Controller { function view() { parent::Controller(); $this->load->helper(‘url’); $this->load->library(‘pagination’); } function orders() { //page title $data['title']=’Page Title’; //pagination configurations $config['total_rows'] = $this->db->get(‘dbname’)-> num_rows(); $config['per_page'] = ’50′; [...]
Archive for the ‘PHP’ Category
talk to the database from a helper : Codeigniter
Recently I had to get a particular data in almost every view so, it became in a way redundant to pass the data to the view every time. Thus, to overcome this problem i created a helper of my own that could make queries to the database and get required results. This is how i [...]