Skip to content

Commit

Permalink
Reword and move note to the end, add headline
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksi Peebles <aleksi@iki.fi>
  • Loading branch information
aleksip committed May 2, 2020
1 parent 1cedb5a commit ea7ddb4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions docs/book/helpers/partial.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ The `Partial` view helper is used to render a specified template within its own
variable scope. The primary use is for reusable template fragments with which
you do not need to worry about variable name clashes.

> Note that it is also possible to render a template within its own variable
> scope by calling `RendererInterface::render()` with a `$values` argument.
> See the documentation for [`PhpRenderer`](../php-renderer.md#render) for
> more information.
A sibling to the `Partial`, the `PartialLoop` view helper allows you to pass
iterable data, and render a partial for each item.

Expand Down Expand Up @@ -80,6 +75,14 @@ Which would then render:
> access to your row objects within the view scripts, allowing you to call
> methods on them (such as retrieving values from parent or dependent rows).
> ### An alternative to using Partial
>
> Note that it is also possible to render a template within its own variable
> scope by directly calling `RendererInterface::render()` with a `$values`
> argument. You might prefer to do this if your model is an array, or an
> object that implements `ArrayAccess`. See the documentation for
> [`PhpRenderer`](../php-renderer.md#render) for more information.
## Using PartialLoop to Render Iterable Models

Typically, you'll want to use partials in a loop, to render the same content
Expand Down

0 comments on commit ea7ddb4

Please sign in to comment.