Unverified Commit 0d276f2d authored by alexpott's avatar alexpott

Issue #2848367 by mlncn, jp.stacey, kunalkursija: Render API overview example...

Issue #2848367 by mlncn, jp.stacey, kunalkursija: Render API overview example of placeholders either incorrect or misleading

(cherry picked from commit 323a808b)
parent 749984b9
...@@ -414,13 +414,16 @@ ...@@ -414,13 +414,16 @@
* render array contained: * render array contained:
* @code * @code
* $build['my_element'] = [ * $build['my_element'] = [
* '#attached' => ['placeholders' => ['@foo' => 'replacement']], * '#markup' => 'Something about @foo',
* '#markup' => ['Something about @foo'], * '#attached' => [
* 'placeholders' => [
* '@foo' => ['#markup' => 'replacement'],
* ],
* ]; * ];
* @endcode * @endcode
* then #markup would end up containing 'Something about replacement'. * 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 * rendered, and any cache tags generated during rendering will be added to the
* cache tags for the markup. * cache tags for the markup.
* *
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment