Skip to content
docsv0.31.1

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

Parameters of __construct()
NameTypeDescription
$localestring
$wordsMilpa\Live\Assets\ComponentMessages

ContentHtmlRenderer::supportsTarget()

public function supportsTarget(Milpa\Live\ValueObjects\RenderTarget $target): bool

HTML only: articles and headings are this renderer's whole vocabulary.

Parameters

Parameters of supportsTarget()
NameTypeDescription
$targetMilpa\Live\ValueObjects\RenderTarget

ContentHtmlRenderer::render()

public function render(Milpa\Live\Contracts\Component\ComponentDefinitionInterface $component, Milpa\Live\ValueObjects\RenderRequest $request): Milpa\Live\ValueObjects\RenderResult

The entries as articles, or the empty state — refused by name when the roles do not fit the rows.

Parameters

Parameters of render()
NameTypeDescription
$componentMilpa\Live\Contracts\Component\ComponentDefinitionInterface
$requestMilpa\Live\ValueObjects\RenderRequest