So, here are some ideas to get you started.
First you must start with the route and take the page number as a dynamic parameter.
this.resource('posts', { path: '/posts/:page' };
Then, since I have no experience with Silex, you need to support some server-side options that you can use to paginate. For example, offset and limit , where first means how many records you want to skip, and then specify how many records you want to select. Ideally, you should implement them as query parameters, such as ?offset=0&limit=10 .
Then you simply implement your table route as follows:
App.TableRoute = Ember.Route.extend({ model: function (params) { return App.Post.find({ offset: (params.page - 1) * 10, limit: 10 }); } });
Then you can start to do even more magic and create your own parameter on the page or check the page number, having previously scored the number of all records.
source share