标签:
TODO
Update to:
- follow the changes in the user-guide
- use SQLite-compatible SQL syntax, and provide a script for inserting the data
In this tutorial, we will use the zend-paginator component to add a handy pagination controller to the bottom of the album list.
Currently, we only have a handful of albums to display, so showing everything on one page is not a problem. However, how will the album list look when we have 100 albums or more in our database? The standard solution to this problem is to split the data up into a number of pages, and allow the user to navigate around these pages using a pagination control. Just type "Zend Framework" into Google, and you can see their pagination control at the bottom of the page:
In order for us to have lots of albums in our database, you‘ll need to run the following SQL insert statement to insert the current 150 top iTunes albums (at the time of writing!):
INSERT INTO "album" ("artist", "title")
VALUES
("David Bowie", "The Next Day (Deluxe Version)"),
("Bastille", "Bad Blood"),
("Bruno Mars", "Unorthodox Jukebox"),
("Emeli Sandé", "Our Version of Events (Special Edition)"),
("Bon Jovi", "What About Now (Deluxe Version)"),
("Justin Timberlake", "The 20/20 Experience (Deluxe Version)"),
("Bastille", "Bad Blood (The Extended Cut)"),
("P!nk", "The Truth About Love"),
("Sound City - Real to Reel", "Sound City - Real to Reel"),
("Jake Bugg", "Jake Bugg"),
("Various Artists", "The Trevor Nelson Collection"),
("David Bowie", "The Next Day"),
("Mumford & Sons", "Babel"),
("The Lumineers", "The Lumineers"),
("Various Artists", "Get Ur Freak On - R&B Anthems"),
("The 1975", "Music For Cars EP"),
("Various Artists", "Saturday Night Club Classics - Ministry of Sound"),
("Hurts", "Exile (Deluxe)"),
("Various Artists", "Mixmag - The Greatest Dance Tracks of All Time"),
("Ben Howard", "Every Kingdom"),
("Stereophonics", "Graffiti On the Train"),
("The Script", "#3"),
("Stornoway", "Tales from Terra Firma"),
("David Bowie", "Hunky Dory (Remastered)"),
("Worship Central", "Let It Be Known (Live)"),
("Ellie Goulding", "Halcyon"),
("Various Artists", "Dermot O‘Leary Presents the Saturday Sessions 2013"),
("Stereophonics", "Graffiti On the Train (Deluxe Version)"),
("Dido", "Girl Who Got Away (Deluxe)"),
("Hurts", "Exile"),
("Bruno Mars", "Doo-Wops & Hooligans"),
("Calvin Harris", "18 Months"),
("Olly Murs", "Right Place Right Time"),
("Alt-J (?)", "An Awesome Wave"),
("One Direction", "Take Me Home"),
("Various Artists", "Pop Stars"),
("Various Artists", "Now That‘s What I Call Music! 83"),
("John Grant", "Pale Green Ghosts"),
("Paloma Faith", "Fall to Grace"),
("Laura Mvula", "Sing To the Moon (Deluxe)"),
(