bminer / node-blade

Blade - HTML Template Compiler, inspired by Jade & Haml
Other
320 stars 28 forks source link

in handlebars we can use helper, how to use helper with blade ? #117

Closed crapthings closed 11 years ago

crapthings commented 11 years ago
Template.foo.something = ->
    return 'something'

<div>{{something}}</div>

blade ?

#{something} ???
bminer commented 11 years ago

No. In Blade, all helpers are called before the template is rendered. So you should just do:

div= something

At runtime, Template.foo.something is called and the output of that helper is merged into the local variable something