Welcome Guest, Not a member yet? Register   Sign In
Poll: are you with improve pagination library
You do not have permission to vote in this poll.
yes
77.78%
7 77.78%
no
22.22%
2 22.22%
Total 9 vote(s) 100%
* You voted for this item. [Show Results]

about pagination library
#1

hi everyone..

i used codeigniter for 3 years ago and i was so happy with this ..when i stopped i tried to learn another framework..like (laravel-cakephp)

now i am in home again Smile but i have many thoughts to improve codeigniter like i saw before in other frameworks...

the big thing i you will noticed when you learn other frameworks i pagination

pagination in codeigniter still confused and big code like this :

PHP Code:
/**
     *  display all items in datagrid.
     */
    
public function overview($row 0) {

        
$this->load->library('pagination');

        
$config['base_url'] = base_url() . "items/admin_items/overview";
        
$config['total_rows'] = $this->items->getTotalItems();
        
$config['per_page'] = '10';
        
$config['uri_segment'] = 4;
        
$config['full_tag_open'] = '<div class="pages">';
        
$config['full_tag_close'] = '</div>';

        
$config['cur_tag_open'] = '<a href="javascript:void(0)" class="current">';
        
$config['cur_tag_close'] = '</a>';

        
$config['first_link'] = '&lt;&lt; الأولى';
        
$config['last_link'] = 'الأخيرة &gt;&gt;';

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

        
$data['row'] = $row;
        
$data['total_rows'] = $this->items->getTotalItems();
        
$data['links'] = $this->pagination->create_links();

        
$data['items'] = $this->items->get_items($row"add");
        
$this->view('items/items_list'$data);
    } 

but in laravel i just need one line like this

PHP Code:
public function show(){
    
$photos Photo::paginate(10);
    return 
View::make('photos.show', array('photos' => $photos));


can you improve pagination library in CI 3 version
Reply
#2

This lib class is really nasty..
Its not going to be at 3.0 but perhaps in next version it will be good to be updated..
P.S > pagination in Laravel is not so simple as you describe it but its a lot easier than CI ..
Best VPS Hosting : Digital Ocean
Reply
#3

On the subject of Pagination, it would be nice to have a way of doing a "Load more..." link, which simply retrieves additional items, rather than a whole page refresh.

I understand the pros and cons for this, but a simple option would also be nice.
Reply
#4

(11-14-2014, 07:56 AM)sv3tli0 Wrote: This lib class is really nasty..
Its not going to be at 3.0 but perhaps in next version it will be good to be updated..
P.S > pagination in Laravel is not so simple as you describe it but its a lot easier than CI ..

ok..that what i mean...i hope they will update it as soon as possible..i hate to define uri_segment and baseurl and total_rows every time and write all this lines
Reply




Theme © iAndrew 2016 - Forum software by © MyBB