Skip to content

Commit

Permalink
Issue #2848367 by mlncn, jp.stacey, kunalkursija: Render API overview…
Browse files Browse the repository at this point in the history
… example of placeholders either incorrect or misleading

(cherry picked from commit 323a808bd0b7c7fd45921f4c2575fcc9109c40c1)
  • Loading branch information
alexpott committed Jul 9, 2020
1 parent 256d548 commit 8944535
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/Drupal/Core/Render/theme.api.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,13 +414,16 @@
* render array contained:
* @code
* $build['my_element'] = [
* '#attached' => ['placeholders' => ['@foo' => 'replacement']],
* '#markup' => ['Something about @foo'],
* '#markup' => 'Something about @foo',
* '#attached' => [
* 'placeholders' => [
* '@foo' => ['#markup' => 'replacement'],
* ],
* ];
* @endcode
* then #markup would end up containing 'Something about replacement'.
*
* Note that each placeholder value can itself be a render array, which will be
* Note that each placeholder value *must* itself be a render array. It will be
* rendered, and any cache tags generated during rendering will be added to the
* cache tags for the markup.
*
Expand Down

0 comments on commit 8944535

Please sign in to comment.