render_partial
The render_partial function will render a template outside of the current context.
Consider the following template:
This would work fine if you normally use this template directly from php like so:
Now imagine that you want to render this template inside a loop:
The variables you would want to use in the template would now be bound to "article" and link
would in this case be located on article.link
.
But the render_partial function will, behind the scenes, use View::render()
to render the template:
This would be equivalent to:
Last updated
Was this helpful?