Closed johnbintz closed 11 years ago
@johnbintz Nice catch :+1:
I prefered to use a dup
on cache templates for 2 reasons : it avoids to create useless hashes if template caching is not used. And merge!
(or any in place methods) can be used elsewhere in the source code (like you miss the one in extends
) so this way we are sure that cached templates are never modified.
Thank you for the PR !
You're welcome! :)
When using a partial template from a child using this syntax:
The orignal compiled template is polluted with the
_data
attribute from the first call tochild
. This prevents the template from being reused as the now stored on template_data
method may not be accessible on other objects, causing method not found exceptions. This small change only adds the_data
attribute to the copy of the template being used for rendering, preventing the template from becoming corrupted for reuse.