News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Lee Davis' Blog:
Zend Paginator Example
April 19, 2012 @ 10:31:29

In a recent post to his blog Lee Davis gives an example of using the Zend Framework's pagination functionality, complete with some CSS to style it a bit better than the defaults.

One of the reasons why zend framework has been so popular is due to all the hard work put in to make sure components are extremely configurable. Sure there are default behaviours, but nothing is assumed and anything that needs to be overwritten or reconfigured can be. A strong emphasis on configuration over convention means you'll never be lumbered with code that just can't be changed. Zend Paginator is one of the smaller components of Zend Framework that allows you to get a simple paginator up and running on your listings or search pages in a matter of minutes.

Included in the post is a cut-and-pasteable view that creates the Previous/Next links as well as including the first/last page numbers and a few around the current page.

0 comments voice your opinion now!
zendframework zendpaginator tutorial view css


Till Klampaeckel's Blog:
Iterating over a table (with Zend_Db_Table and Zend_Paginator)
October 12, 2011 @ 11:01:44

Till Klampaeckel has a new post today looking at a solution for a common need - paginating through results as pulled from a database. With the help of the Zend_Db_Table and Zend_Paginator components of the Zend Framework it's a simple matter of passing the results into the Paginator and asking for a certain page.

So frequently, I need to run small data migrations or transformations. Especially on the way to Doctrine, there's a lot to clean-up in a database which has been used and evolved over five years or so.

Code snippets are included to define a class for the table, extending Zend_Db_Table_Abstract, and a new Zend_Paginator_Adapter_DbTableSelect object to create the paginated results. After that, it's as simple as setting the number of items per page and asking for a certain page. There's even a quick bit about being able to edit the rows inside the paginator directly (they're just Zend_Db_Table_Row records).

0 comments voice your opinion now!
tutorial iterate table zendframework zenddbtable zendpaginator


Rob Allen's Blog:
Exploring Zend_Paginator
May 04, 2011 @ 11:26:57

Rob Allen has a new post today exploring Zend_Paginator and some of the features it has to offer.

One area of displaying lists on web pages that I've generally disliked doing is pagination as it's a bit of a faff. Recently, I needed to do just this though as I couldn't delegate it as my colleague was too busy on other work. As a result, I thought that I should look into Zend_Paginator this time. Turns out that it's really easy to use and the documentation is great too.

He includes some sample code to set up the paginator (for his example it uses a data mapper) and push the results from the database into the Zend_Paginator object. He shows how to use the paginator to work through the results, pulling a page number from the URL. Finally, he shows the HTML to include the pagination links into your page.

0 comments voice your opinion now!
zendframework zendpaginator tutorial example


Joey Rivera's Blog:
Using Zend_Paginator with Twitter API and Zend_Cache
January 29, 2010 @ 10:54:44

In a recent post to his blog Joey Rivera looks at using the Zend_paginator component with Twitter and APC to create a cachable, paged view of a set of Twitter API results.

I'm going to focus more on Zend_Paginator and Zend_Rest_Client to access Twitters API since I've already created a post on Zend_Cache. Normally, I would use Zend_Service_Twitter to access the twitter service but it still seems to require authentication to retrieve a users timeline where only protected users should require authentication.

He includes all of the needed code including the bootstrap.ini file and his own custom Twitter service class that grabs the timeline of the given user and calls the REST interface to grab the latest posts and caches them to a file.

0 comments voice your opinion now!
zendpaginator zendcache tutorial twitter api


Ibuildings Blog:
Zend_Paginator First Impressions
December 02, 2008 @ 07:53:52

Lorna Mitchell has posted an article to the Ibuildings blog looking at the Zend_Paginator component of the Zend Frameworks, some of her first impressions.

The idea of this module is to allow collections of data to be paginated. It takes the set, restricts the results, and can also generate the page numbers you need to move around between the resulting paginated data. Basically it saves me writing the same pagination code multiple times and then having to fix the bug where the last result on the previous page appears on the next ... all this has been thought of already.

She shows how it works with a simple example - paginating results from a database table, setting the count per page and the current page number. This object is pushed out to the view and rendered (in her case) via a Smarty template.

0 comments voice your opinion now!
zendpaginator component zendframework impression example


Anis Ahmad's Blog:
Join Problems with Zend_Paginator and Zend_Db_Select objects
August 28, 2008 @ 11:18:55

Anis Ahmad had a problem. The Zend_Paginator component of the Zend Framework, while powerful, wasn't quite working right. Bugs popped up when he used a join along with a Zend_Db_Select.

One of the 4 Adapters for Zend_Paginator is DbSelect which uses a Zend_Db_Select instance. Now, the problem occurred if I need to have some calculative data from other tables and use join with the Zend_Db_Select object for them.

He gives an example of a join that he performed with the component, the details of the "behind the scenes" code and why it happened that way. He also offers a solution (before the Zend_Pagination component was patched for it, of course) of changing the count() method it uses slightly to remove an unneeded part of the query.

0 comments voice your opinion now!
zendpaginator zenddbselect component zendframework



Community Events





Don't see your event here?
Let us know!


deployment bugfix zendserver release framework series voicesoftheelephpant language interview conference developer laravel library podcast community api list introduction tips symfony

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework