InitRenderTrait
Table of Contents
Methods
- intilializeRender() : void
- Builds the filters and loads the article list. Filter objects are built here in PHP, Latte does not build them; the template only passes the ready `$tagIds` on from `render()`.
Methods
intilializeRender()
Builds the filters and loads the article list. Filter objects are built here in PHP, Latte does not build them; the template only passes the ready `$tagIds` on from `render()`.
private
intilializeRender(array<int, int> $tagIds[, int $maxNumber = 5 ]) : void
The tag filter (tags.id IN (...)) is assigned first: tags is an M2M collection on
Article and id is the identifier of Tag; JoinHelper resolves the path tags.id
as a left join of article.tags plus a WHERE on the tag alias id.
The activated/published filters are assigned after the tag filter, so the same key
from the tag filter can be overwritten but not the other way around. The front end must
never list an inactive or unpublished article, even when the caller passes empty or
nonsensical $tagIds.
Empty $tagIds add no tag filter at all and the component behaves as a plain list.
A tag without articles gives an empty $articleList, which ArticleListRenderer
renders as its usual empty state, not as an error.
Parameters
- $tagIds : array<int, int>
- $maxNumber : int = 5