RE: [PEAR] Pager 2.x

From: Date: Mon, 22 Mar 2004 00:19:33 +0000
Subject: RE: [PEAR] Pager 2.x
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-11434@lists.php.net to get a copy of this message
Hi! Thanks for your answer! > You could do that fairly easily extending Pager_Sliding > and overriding the "getNextPageID()" and getPrevPageID()" > methods. Now this is strange: I try to override the two methods in my child-class and even the php-manual says that "calls of redefined methods in parent classes will call the redefined method" I cannot get the desired result from this: class mypager extends Pager { var $steps=3; function getNextPageID() { return ($this->getCurrentPageID() > ($this->numPages()-$this->steps)) ? false : $this->getCurrentPageID() + $this->steps; } function getPreviousPageID() { return ($this->getCurrentPageID() < $this->steps) ? false : $this->getCurrentPageID() - $this->steps; } } putting control echos in the redefined functions shows that they are not executed. If I exchange the two functions in the original Common.php the result looks like I want it - but I don't want to do that... I know - this is pretty much a pure php question but I guess it is easy for you to answer. Has it to do with the fact that I am overriding the grandfathers method? (mypager extends Pager extends Pager_Common) Regards Daniel PS.: I think I would then also add a setsteps()

« previous php.pear.general (#11434) next »