Hello,

I just built the first *datasource* using the data in JSON format from a 
remote site.

I receive JSON data in the following form.



{
  "metadata": {
    "host": "api.examplestore.com",
    "path": "\/catalog\/search",
    "query": "query=manafucturer+name&facets%5B0%5D=fieldType%3Arelease",
    "page": 1,
    *"perPage": 10,**
    "count": 209,
    "totalPages": 21,*
    "nextQuery": 
"query=manafucturer+name&facets%5B0%5D=fieldType%3Arelease&page=2",
    "perPageOptions": [
      {
        "value": 50,
        "applyQuery": 
"query=manafucturer+name&facets%5B0%5D=fieldType%3Arelease&perPage=50"
      },
      {
        "value": 100,
        "applyQuery": 
"query=manafucturer+name&facets%5B0%5D=fieldType%3Arelease&perPage=100"
      },
      {
        "value": 150,
        "applyQuery": 
"query=manafucturer+name&facets%5B0%5D=fieldType%3Arelease&perPage=150"
      }
    ],
    "facets": {
      "fields": {
        "": [
          
        ]
      }
    },
    "appliedFacets": [
      
    ],
    "spellcheck": {
      "suggestions": [
        
      ]
    }
  },
  "results": [
    {
      "id": 188183,
      "type": "product",
      "name": "Product Name",
      "slug": "product-slug",
      "release": "2012-12-11",
      ...
      },
... //next 9 results
}


As you can see, I receive a limited number of products, for example, 10 of the 
209th
Now need guidance on how to use information from metadata (count, totalPages
, perPageOptions) in pagination helper / component to display other products
.


Any help and suggestions are welcome.

Sorry if my English is not the best

Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to