hi
Did you get this fixed? I have the same problem!!
kind Regards
Chris
| SitePoint Sponsor |
hi
Did you get this fixed? I have the same problem!!
kind Regards
Chris
Chris,
most likely you have you php.ini file set to force the long version of the php open tag.
Look for the following in your php.ini to be sure.
short_open_tag = Off
That being the case you need to edit the Paginated.php and PageLayout.php files and make sure the open tag is '<?php'. After that the example should run smoothly.
paul.

thanks for this useful article.
The most flexible and easiest to implement pagination class I have seen so far. Brilliant.
pagination using phpcode+mysql,html code
Your thoughts on using a default strategy or explicitly have the user define it in the constructor of Paginated class rather use setLayout()?
Interesting now in ZF 1.6 is the Zend_Paginator. It works on the notion of a strategy for the data to be passed and accepts arrays and a db select object
$pageNumber = $this->_getParam('page') ? $this->_getParam('page') : 1;
$select->from('user')
->order("user.name")
->limitPage($pageNumber, 10);
//set page number
$paginator = new Zend_Paginator(new Zend_Paginator_Adapter_DbSelect($select));
$paginator->setCurrentPageNumber($pageNumber);
$paginator->setItemCountPerPage(10);
Zend_Paginator::setDefaultScrollingStyle('All');
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_control.phtml');
$this->view->paginator = $paginator;
//the above is available in your view
//<?=$this->paginator?> will echo page links
Extremely useful on small result sets, but I think this would slow down pages with very large result sets. An approach similar to the Zend_Paginator may be applied by modifying the Paginated class to accept SQL SELECT strings.
wel coding.i like this type of templates.i will say it is nice coding.
it is good coding but i want to learn more easy steps!

as OJ mentioned, this is not good with huge result set. In thousand result set, this will surely pretty slow, what more with millions of records? Don't like to recommend this one.
http://collecta-mania.com.au
Can this code be amended to use a set of ID's within the array as the pagination instead of page numbers?
i.e instead of ?page=2 you would have ?imageid=1610, the resulting pagination thus forming permalinks.
Notice: Undefined offset: 8 in C:\workspace\turnos\hosting\scr\modelo\paginacion\Paginated.php on line 100 i have this problem when i have 8 items in my array and i show 5 elemens per page, the page 1 show ok but the second show this notice
Nice tutorial as usual, but i have to be honest, it's not really that easy to follow. Maybe i'm experiencing a blond moment, and i'm sure i could just download the code and play, but the run down on instructios need to be put into better novice terms or perhaps less use of web language terms would make this a little easier to read.
I'm still learning PHP myself (constantly - it's never ending, lol), and although it makes sense for the most part, i can't help but feel baffled by what seems should be fairly straight-forward task.
I'd suggest just this, pass along your article to a family member, someone with little or no experience and ask them if what they read makes sense, if not then perhaps rethink the wording or terms used.
I've read many articles here, and it's an absolute gem of a resource, but i felt this one a little lacking in the breakdown. Of course that's not to say it's a bad article, it's great work, just left a little high and dry with the "idiot proof" run down on code.
We idiots need it in simple terms to, even if the above seems simple enough... *does that make sense*...
All the best to sitepoint peeps for 2009 anywho!!..
add this at line 101 or so of Paginated.php (replace what's there) - should fix the error.
if($index<sizeof($this->rs)){
return $this->rs[$index];
}else{
return false;
}
The script works well, but how can I convert this so that it reads information out of my database? I also need to be able to have multiple column of data, is this possible to do?
Dan.
I don't know PHP that well. I'm a Ruby guy. But this is what I'd expect from a pagination lib and was incredibly simple to work with & extend.
Hey, awesome tutorial, works very well with personal extension, one thing (minor cosmetic fix); in your doublebarlayout.php, in order to keep consistency, put the "next" before the "last" at the very end of the file
I can't say this class seems practical to use. It could be made so much more simpler than it is.
For example, my pagination class you pass a result set, batch number (number of records to show at any one time) and the current page number. Job's a good 'un.
I don't know, I find the following much easier myself
PHP Code:$paginator = Zend_Paginator::factory($rowset)
->setCurrentPageNumber(3);
echo $paginator;
I have tried to implement this class (which I love, by the way). It offers me the ability to enter my own query AND results display, which I haven't found anywhere else. I do have one question and am unsure of where to post it. Could someone please help me figure out where to post a question regarding the target being a page "included" in a div via a database query?


hi hapagirl and welcome to the forums
Post your question in the main PHP forum.
Mike Swiffin - Community Team Leader
Only a woman can read between the lines of a one word answer.....
I started out with nothing... and still got most of it left!
I love this Pagination!
Last edited by LTT; Aug 24, 2009 at 12:06. Reason: I R DUMB
Fatal error: Interface 'PageLayout' not found in [path]\DoubleBarLayon line 4
This is still not working for me either!!
Did anyone find a solution?
Colin
SOLVED:
require_once "DoubleBarLayout.php"; was needed.
Bookmarks