{"action":"created","issue":{"url":"https://api.github.com/repos/TomBZombie/CDS/issues/3","labels_url":"https://api.github.com/repos/TomBZombie/CDS/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/TomBZombie/CDS/issues/3/comments","events_url":"https://api.github.com/repos/TomBZombie/CDS/issues/3/events","html_url":"https://github.com/TomBZombie/CDS/issues/3","id":104495177,"number":3,"title":"How about this idea? Limits should be a part of CDS too. ","user":{"login":"smolinari","id":3314957,"avatar_url":"https://avatars.githubusercontent.com/u/3314957?v=3","gravatar_id":"","url":"https://api.github.com/users/smolinari","html_url":"https://github.com/smolinari","followers_url":"https://api.github.com/users/smolinari/followers","following_url":"https://api.github.com/users/smolinari/following{/other_user}","gists_url":"https://api.github.com/users/smolinari/gists{/gist_id}","starred_url":"https://api.github.com/users/smolinari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smolinari/subscriptions","organizations_url":"https://api.github.com/users/smolinari/orgs","repos_url":"https://api.github.com/users/smolinari/repos","events_url":"https://api.github.com/users/smolinari/events{/privacy}","received_events_url":"https://api.github.com/users/smolinari/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-02T14:36:47Z","updated_at":"2015-09-02T15:28:40Z","closed_at":null,"body":"For instance (and I am not sure it is in the right place).\r\n\r\n\tpublic function testRepeatObjectWithLimit() {\r\n\t\t$template = '<template name=\"\">\r\n\t\t\t\t<ul><li>TEST1</li></ul>\r\n\t\t</template>';\r\n\t\t//This time we have a limit of 2, so only two iterations should be presented\r\n\t\t$cds = 'ul li {repeat: data(list); iterations: 2; content: iteration(id)}';\r\n\t\t$data = new stdclass;\r\n\t\t$data->list = [];\r\n\t\t$one = new stdclass;\t\t\r\n\t\t$one->id = 'One';\r\n\t\t$data->list[] = $one;\r\n\t\t$two = new stdclass;\t\t\r\n\t\t$two->id = 'Two';\r\n\t\t$data->list[] = $two;\r\n\t\t$three = new stdclass;\t\t\r\n\t\t$three->id = 'Three';\r\n\t\t$data->list[] = $three;\r\n\t\t\r\n\t\t$template = new \\CDS\\Builder($template, $cds, $data);\r\n\t\t\r\n\t\t$this->assertEquals('<ul><li>One</li><li>Two</li>' ,$template->output()); \r\n\t}\r\n\r\nWould that (or something similar) be feasible? \r\n\r\nIs the data retrieval also being controlled over the CDS? Or is the template system \"given\" the data? I'd like to see it retrieve, like it should be.\r\n\r\nScott"},"comment":{"url":"https://api.github.com/repos/TomBZombie/CDS/issues/comments/137132700","html_url":"https://github.com/TomBZombie/CDS/issues/3#issuecomment-137132700","issue_url":"https://api.github.com/repos/TomBZombie/CDS/issues/3","id":137132700,"user":{"login":"TomBZombie","id":2454540,"avatar_url":"https://avatars.githubusercontent.com/u/2454540?v=3","gravatar_id":"","url":"https://api.github.com/users/TomBZombie","html_url":"https://github.com/TomBZombie","followers_url":"https://api.github.com/users/TomBZombie/followers","following_url":"https://api.github.com/users/TomBZombie/following{/other_user}","gists_url":"https://api.github.com/users/TomBZombie/gists{/gist_id}","starred_url":"https://api.github.com/users/TomBZombie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomBZombie/subscriptions","organizations_url":"https://api.github.com/users/TomBZombie/orgs","repos_url":"https://api.github.com/users/TomBZombie/repos","events_url":"https://api.github.com/users/TomBZombie/events{/privacy}","received_events_url":"https://api.github.com/users/TomBZombie/received_events","type":"User","site_admin":false},"created_at":"2015-09-02T15:28:40Z","updated_at":"2015-09-02T15:28:40Z","body":"Completely agree with this, and the impementation. Perhaps we need to be able to do offsets as well?\r\n\r\nPerhaps the way page ranges are specified for printers?\r\n\r\nDefault: Indefinite:\r\n```php\r\nrepeat: data(list) 1 *;\r\n```\r\n\r\nRange 5-7\r\n```php\r\nrepeat: data(list) 5 7;\r\n```\r\n\r\nFirst 5:\r\n\r\n```php\r\nrepeat: data(list) 1 5;\r\n```\r\n\r\nDo we also need to do sorting here? How would that work?"}}