PHP Classes

potential nice addition

Recommend this page to a friend!

      Pagination with density  >  All threads  >  potential nice addition  >  (Un) Subscribe thread alerts  
Subject:potential nice addition
Summary:how to make this useful by extension
Messages:2
Author:rudie dirkx
Date:2010-10-23 18:08:13
Update:2010-10-27 06:37:21
 

  1. potential nice addition   Reply   Report abuse  
Picture of rudie dirkx rudie dirkx - 2010-10-23 18:08:13
This class would be much more useful if you put the actual rendering in seperate methods to the whole rendering would be extendable:

<?php

class Pagination {

function displayLinks() {
// ...
$pageLinks .= $this->render_LinkToFirstPage();
for ( ... ) {
$pageLinks .= $this->render_LinkToPageX($i);
}
return $this->render_PageLinksContainer($pageLinks);
}

}

?>

etcetera

  2. Re: potential nice addition   Reply   Report abuse  
Picture of vimal vimal - 2010-10-27 06:37:21 - In reply to message 1 from rudie dirkx
rudie dirkx,
thanks for that suggestion.Certainly we can add more extendability to the class like this.I also think to write a method to style it with customizable features.
thanks again...