ContentHtmlRenderer
Paints {@see ContentComponent}: one `<article>` per entry, read through the roles the declaration named (greenhouse decisions/0464). The title is a heading, the lead a lead paragraph, the body paragraphs, the metadata a list of field and value. Every value is escaped — the body is text, and a title a stranger typed is still only text. The heading level follows the page: with a `heading` the entries sit one level below it. Its only words are the empty state, read from the component's catalogue in the page's language: an entry list with nothing in it says so, instead of painting a blank region that reads as broken.
ContentHtmlRenderer::__construct()
public function __construct(string $locale = Milpa\Live\Assets\ComponentMessages::DEFAULT_LOCALE, Milpa\Live\Assets\ComponentMessages $words = new ComponentMessages()):Parameters
| Name | Type | Description |
|---|---|---|
| $locale | string | |
| $words | Milpa\Live\Assets\ComponentMessages |
ContentHtmlRenderer::supportsTarget()
public function supportsTarget(Milpa\Live\ValueObjects\RenderTarget $target): boolHTML only: articles and headings are this renderer's whole vocabulary.
Parameters
| Name | Type | Description |
|---|---|---|
| $target | Milpa\Live\ValueObjects\RenderTarget |
ContentHtmlRenderer::render()
public function render(Milpa\Live\Contracts\Component\ComponentDefinitionInterface $component, Milpa\Live\ValueObjects\RenderRequest $request): Milpa\Live\ValueObjects\RenderResultThe entries as articles, or the empty state — refused by name when the roles do not fit the rows.
Parameters
| Name | Type | Description |
|---|---|---|
| $component | Milpa\Live\Contracts\Component\ComponentDefinitionInterface | |
| $request | Milpa\Live\ValueObjects\RenderRequest |