 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
MaltBlue.com: Use RouteMatch in Zend Framework 2 For Easy Routing
by Chris Cornutt May 02, 2013 @ 11:14:22
In the latest to his site Matthew Setter takes a look at easy routing with RouteMatch in Zend Framework 2 applications. The RouteMatch component gives you better control over your routing and lets you define "match paths" for URL to Controller mappings.
Today using Zend Framework 2 RouteMatch, Router and Request objects, I show you an easy way to dynamically update the current route. It's almost painlessly simple. [...] Well, like most things in web application development, what starts out simply in the beginner often grows more complex over time. So too is my once simple route.
His "simple" route started getting a bit out of control when he added in some pagination to the page (and query for the path match). He wanted to figure out how to re-render data with the same filters but show the next page of data. He shows how to use the RouteMatch component to achieve just this. He creates a custom module with a "listViewToolbar" helper that lets you read the router, request and handle the parameters sent via the URL. The "invoke" method is called to render the toolbar in the page, complete with the new settings.
voice your opinion now!
routematch zendframework2 tutorial routing http toolbar pagination
PHPMaster.com: Pagination with CodeIgniter
by Chris Cornutt January 30, 2012 @ 12:15:22
On PHPMaster.com today there's a new tutorial showing you how to handle simple pagination in a popular PHP framework, CodeIgniter.
Pagination is particularly useful when you are coding an application that interfaces with a database. A large dataset might have hundreds of possible results for one query, and pagination creates a much nicer user experience. In this tutorial, I'll use CodeIgniter's pagination library to show you how you can create a paginated list of results from a MySQL database. Along the way, you'll also see how to fix a problem with the pagination links that the library might produce.
He starts on the backend, creating a model to work with Country information and includes a "fetch_countries" method to grab the limited/paged list. Next up is the controller with an "example1" method that looks to the URL to see what page it should be on. The view is simple enough - just outputting the results back without worrying about how many to show.
voice your opinion now!
codeigniter framework tutorial pagination mvc country
Brian Swan's Blog: Paging Data with the SQL Server Drivers for PHP Simplified
by Chris Cornutt January 27, 2011 @ 12:54:56
Brian Swan has simplified the pagination using the SQL Server drivers for PHP in his latest post. He shows how to use a cursor to move around in the result set from your query.
An oversimplified definition of a database cursor might be this: A cursor is database functionality that allows you to point to a certain location within a result set and allows you to move forward (and sometimes backward, depending upon the cursor type) through the result set one row at a time. [...] In the paging [scenario], I'll use a static cursor since that cursor type would seem to satisfy the requirements of many web-based applications.
He shows how to execute a simple query with a dynamic cursor by specifying it in the connection call. He then uses the sqlsrv_num_rows to find the number of records returned and a sqlsrv_fetch_array call to pull just the page you need. He also includes some handy code to paginate the results, complete with links.
voice your opinion now!
sqlserver driver pagination numrows tutorial cursor
Eli White's Blog: An intriguing use of lambda functions
by Chris Cornutt March 11, 2010 @ 08:48:16
In a new post to his blog today Eli White takes a look at an interesting use of lambda functions he's figured out for a his development at work.
I found a very specific use out of the blue of Lambda functions that I have now used and I see as a great use-case. Which is specifically passing functions/logic from your Controller to your View. In the case of Goodsie, I'm using PHP for my templating language and as usual I'm trying to remove as much logic from my View as possible, while still allowing the view to be malleable.
His method centered around a pagination subview that he wanted to make flexible enough to work with both the standard page view and with an ajax request. Lambda functions came to the rescue by dynamically creating a function based on the request need.
voice your opinion now!
lambda function pagination subview tutorial
Zend Developer Zone: Paging and Sorting Data with Zend Framework, Doctrine and PEAR (part 2)
by Chris Cornutt January 04, 2010 @ 11:52:33
The Zend Developer Zone has posted the second part of their look at pagination with the combination of the Zend Framework, Doctrine and PEAR and how the Zend_Paginator component compares to the PEAR and Doctrine alternatives.
In the previous segment of this article, I introduced you to the Zend_Paginator class, which provides a flexible API for paginating any data collection, whether it is expressed as an array or a database result set. [...] This article will explore two such alternatives, the PEAR Pager class and the Doctrine Pager class, and give you a crash course in how you can use them to quickly add paging and sorting features to your PHP application.
The article gives examples for both of the other methods - a simple pagination of database information with the PEAR pager component (and other packages that can make the results more effective) and the creation of a Doctrine instance where the results are handled via a series of built-in method calls.
voice your opinion now!
tutorial zendframework pear doctrine pagination sort
PaperMashup.com: Easy PHP Pagination
by Chris Cornutt December 22, 2009 @ 10:38:08
In a new post to Ashley Ford's blog there's a tutorial on paginating your data (from an array of data pulled from a database) with a simple PHP script:
I've had a few pagination scripts over the years but I thought i'd share the one that i'm currently using as it's a useful script to have in your toolbox. As a developer you'll soon find a need to paginate data when displaying contents from the database, and rather than use JavaScript which could require all the data to be loaded into the page on load, we can use PHP to ensure that we're only requesting the data that we need from the database.
Some sample code is included showing how to use the LIMIT statement (there's similar features in the other major databases) to only pull a subset of the data needed back into your script. Some CSS is also included to make it all look a bit. You can see it in action here and download the source here.
voice your opinion now!
pagination tutorial database
Zend Developer Zone: Paging and Sorting Data with Zend Framework, Doctrine and PEAR (part 1)
by Chris Cornutt December 11, 2009 @ 09:43:29
On the Zend Developer Zone there's the first part of a series looking at pagination and sorting of data with the combination of the Zend Framework, Doctrine and PEAR.
When building database-backed applications, one of the important problems for a developer or user interface engineer involves making large data sets more manageable by, and therefore more useful to, application users. [...] Back in the good old days, adding pagination to a PHP application was mostly a manual task, involving offset calculations and custom query generation. In recent years, the task has become significantly simpler, mostly due to the presence of ready-made pagination components in most common frameworks.
His tutorial uses the Zend Framework, Doctrine and the Pager, MDB2 and Structures_Datagrid PEAR packages. He starts with a basic select and format kind of example to show a few lines per page. To improve it (for larger data sets) he shows how to use the Zend_Paginator to only grab the rows needed for the page. Finally, he adds in code to allow for column sorting, making it easy to reorganize the results how you'd like.
voice your opinion now!
zendframework pagination sorting doctrine pear tutorial
Aext.net: CodeIgniter and jQuery - Real Live Search with Pagination
by Chris Cornutt October 20, 2009 @ 12:33:57
On the Aext.net website there's been a recent tutorial looking at pagination in a CodeIgniter application using the jQuery Javascript library.
In this tutorial, we will create a search page with CodeIgniter and jQuery. We're not gonna create only a default search page using CodeIgniter framework, but also a real time search with jQuery's support. And one more, enable GET method in CodeIginter that was stupidly disable by default.
You'll need to already have CodeIgniter installed and have some sample data you want to paginate. They take you from there, though - configuring the framework, altering your database table and creating each of the MVC parts to make the pagination work. Toss in a bit of jQuery-based Javascript and you'll get something like this.
voice your opinion now!
codeigniter jquery pagination tutorial
NETTUTS.com CodeIgniter from Scratch Day 7: Pagination
by Chris Cornutt October 02, 2009 @ 07:51:40
On NETTUTS.com today they've posted part seven of their "CodeIgniter from Scratch" series of screencasts looking at building a CodeIgniter application from the ground up. This time the focus is on pagination.
In these last two weeks, I've received bunches of requests for a CodeIgniter pagination screencast; so that's what we'll be reviewing today! As a bonus, we'll also take a look at the super convenient HTML Table class.
They show how to use a local setup (MAMP) to set up a CodeIgniter instance that pulls the data in and splits it out into multiple pages. Their paginated data comes out of a MySQL database.
voice your opinion now!
codeigniter screencast tutorial pagination
|
Community Events
Don't see your event here? Let us know!
|