Search code examples
templatesbackbone.jshandlebars.jshelper

Is it possible to nest helpers inside the options hash with handlebars?


For instance, is there a way to nest my "i18n" helper inside another helper's hash variable?

{{view "SearchView" placeholder="{{t 'search.root'}}" ref="search" url="/pages/search" className='home-search'  polyfill=true}}

Solution

  • Update: Handlebars now supports subexpressions, so you can just do:

    {{view "SearchView" (t 'search.root')}}