-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kohana_Layout renders the content partial twice #55
Comments
I'm really lost about what the problem is here. :) |
If you change your delimiter using |
Place the following inside a content template (not the layout template):
The previous code example should render the mustache tags into the HTML sent to the browser, but that is not what is happening. |
@dolfelt, I was facing a similar issue: I had a variable public $foo = 'These {{brackets}} should appear.'; which I wanted to place in a page which used Kostache_Layout. Stepping through the code showed that it would render twice, causing the I came to the solution of using:
which properly rendered the brackets. I think the same solution can address your issue if you were to put your code section:
within a variable, possibly even a partial. |
Sounds like a bug in the mustache renderer? I know this used to work in mustache v1. |
Yes, Kostache_Layout::CONTENT_PARTIAL => parent::render($class, $template) is not needed as partials get rendered anyway. |
@zsoerenm is right. The The content partial should be set to the source mustache file, NOT the rendered mustache file. |
We only have a filesystem partial loader. I'm busy for the next week, so if there's a patch you have, let's see it :) |
Could the patch be applied anytime soon? I stumbled upon this bug too, shot me in the foot. I manually applied the patch provided by EvanPurkhiser and it works fine now. Thanks. |
I was having difficulty getting some lambda functions working until I realized that the
$m->setPartials()
function takes unrendered content. The current code inKohana_Layout
renders the partial before it is set, then Mustache renders it again. Normally this wouldn't be a big deal, but if you attempt to change the delimiter, it matters. I ended up extending theKohana_Layout
and changing the render function.The text was updated successfully, but these errors were encountered: