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
Custom partials #1
Comments
I'll look into this when I start pushing cleanup for Template::Mustache in a week or two. Thanks! |
The closest recommendation I can make at this point is less direct, but functional:
I'm not sure if that's as concise as you'd like, though... |
Thanks, your solution is certainly helpful ... I'm trying to use some templates that worked with Mustache.js, to work with this module. In Mustache.js, using a partial with name foo also looks up the name foo in the current context, and if found, uses the object found as the context of the partial. By using the same partial under with different names, one can use it in different contexts, within the same template. |
Interesting... I've admittedly been out of the Mustache scene of late, so I'm not entirely sure what "correct" behavior is any more -- and Template::Mustache likely reflects an older standard. If I'm reading your comment correctly, you're saying that this:
would render as "value is 10", and not "value is ten". My understanding of Mustache (which, again, may be incorrect) is that the latter is actually the correct rendering, though the former can be achieved with:
|
I guess you're right, yours is probably the correct rendering. And that makes the question about accessing partials under different names less important. Thanks. |
Is there a way I can provide and manipulate my own partials, not using the mechanism to find them in a file on disk? E.g., I'd really like
(or something similar) to produce 'a string'. Thanks - Bart
The text was updated successfully, but these errors were encountered: