doc: recipes, pager template types and styling - #61
Merged
Merged
Conversation
It's a table about `Collection` methods - what a `Page` reads is covered in the pagination section.
Two worked examples for the non-database case: iterating a paginated API with `LazyCollection`, and making that countable with `CallbackCollection` when the API reports a total.
Declares each variable's type and purpose with Twig's `types` tag and documentation comments, which the Symfony language tools use for completion and hover. Requires `twig/twig` 3.13+, so the dev constraint pins it.
The class names the templates emit are the styling hooks - a short Tailwind example, and a pointer to it from the templating section.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A few documentation follow-ups to #60.
Recipessection, working through the same problem three ways: iterating GitHub's issue search with aLazyCollection, making it countable withCallbackCollection, then wrapping it in a customCollectionthat overridescount()andtake()so the API's own paging is used. Each recipe names what the previous one can't do cheaply. The request counts in it are measured, not guessed.pages()caveat. "Each page is a separate query" was only true for Doctrine - a source that reaches an offset by skipping re-reads everything before each page, so walking 2,000 items in pages of 100 costs 249 reads instead of 20. That's now stated, with a pointer to the recipe that fixes it.typestag and documentation comments, so the Symfony language tools can offer completion and hover. This needstwig/twig3.13+, hence the dev constraint - the only non-doc change here.Page::hasMorePages()row from the lazy/eager table - it's a table ofCollectionmethods.