From ec8b181f130e1f7bb3190b95f9bc1593371ead54 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Fri, 14 Dec 2012 01:03:02 -0500 Subject: [PATCH] Added pagination example Sort of thinking there needs to be a "walk" method. Something like $places->walk('method') so you can be all like while (...) { ... } and easily spin through. Also considering a "next" method to help grab page 2 so you're now passing around variables (that's still allowed to, I guess) --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b66c846..30cdbec 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Usage Examples ```php require_once 'GooglePlaces.php'; -$google_places = new GooglePlaces('_YOUR_API_KEY'); +$google_places = new GooglePlaces('_YOUR_API_KEY_'); ``` ### Search nearby, ranked by prominence @@ -39,6 +39,13 @@ $google_places->types = 'restaurant'; // Requires keyword, name or types $results = $google_places->searchNearby(); ``` +### Second page of search nearby results + +```php +$google_plages->pageToken = $results['next_page_token']; +$page2_results = $google_places->searchNearby(); +``` + The Fututre -----------