![]() |
Pagination for CMS - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Pagination for CMS (/showthread.php?tid=23583) |
Pagination for CMS - El Forum - 10-15-2009 [eluser]Unknown[/eluser] Hi Guys, I am a newbie in Codeigniter and would request you Smart guys to help me out. I am creating a CMS. I have created a admin section in which we have one module with name Manage Products. Now, when I display a list of all products that have been stored in database table, I want them to appear only 10 products at a time using pagination. This page should be displaying in following format Product Name | Product Price | Product Description | EDIT | DELETE Now, using pagination i am able to display till Product Name | Product Price | Product Description. For this, I have used Pagination class with Table Class. Now what I want is to display a fixed image for both edit and delete carrying product id so that when we click on Edit against a specifi product, it can take me to EDIT CONTROLLER. Please make sure that I want to use these CLASSES in many more Modules in the same way with more Columns like for example, one more module called Category Management, I want following : Category Name | Category Description | EDIT | DELETE | Active / Inactive I WOULD REQUEST YOU GUYS TO PLEASE HELP ME OUT WITH THIS. Pagination for CMS - El Forum - 10-15-2009 [eluser]bigtony[/eluser] You can put an image within an anchor like this: Code: <?php echo anchor("controller/edit/{$id}", img(array('src' => 'path/to/edit.gif', 'alt' => "Edit {$name}"))); ?> Pagination for CMS - El Forum - 10-15-2009 [eluser]markup2go[/eluser] If you're using the table class then your links probably need to be in the array you pass to the generate() method. This can be done in the model. Pagination for CMS - El Forum - 11-14-2009 [eluser]w0bbes[/eluser] Hey! Im not sure how pagination would handle this but the problem with the table class and adding a edit/delete cell i solved in the following way by just adding the cells "manually".. (excuse the dutch) Code: $this->table->set_heading('Titel','Inhoud','Opties'); replace the $id with your db id |