-
Notifications
You must be signed in to change notification settings - Fork 132
Possible to use dot / paths with registered helper? #131
Comments
The @ symbol has no special meaning in the handlebras syntax as fa as I know. could you please provide a sample code for you use case? |
Thanks for getting back to me so fast. I've tried a couple of different ways. One was just sending an array of data straight into the template rendering without a helper, e.g.:
But then when attempting to use the expression So I then attempted to do the same thing via registering a helper. I tried this first inline in my My attempt at doing it via implementing the Helper class was:
and
With this I can get the title to output with With I'm sure it's just my not knowing how to properly setup helpers, so any help would be very greatly appreciated. Thanks! |
Is this perhaps the reason? To let you know, basically I'm trying to allow for the same functionality you see in Ghost, which runs on Express using Handlebars.js: |
@JustBlackBird could you please check this one too? |
Variables that starts with I've created a JS Fiddle for you: http://jsfiddle.net/wtmgnd2w/6/ |
Ah ok, thanks for going to so much trouble to explain. In a nutshell, is this correct? Right now I can't use @blog because there's no support for custom private variables in Handlebars.php. If in the future this feature was added, I'd have to add my private variables into the "data" option for any context I wanted them available in. |
Correct.
Incorrect. |
Thanks very much for the clarification. :) |
Hi, first thanks for this awesome project. It's allowing me to work on a project I've been wanting to do for ages.
What I'm trying to do at the moment is register the helper "@blog" to emulate something done in express.
I'd like to be able to use it like so:
However I can't figure out how to go about it.
I can get this working:
And without the @ symbol:
Could anyone give me any advice?
Thanks!
The text was updated successfully, but these errors were encountered: