是否有可能到选项里窝佣工车把哈希? [英] Is it possible to nest helpers inside the options hash with handlebars?

查看:79
本文介绍了是否有可能到选项里窝佣工车把哈希?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,有没有办法窝我的国际化另一位助手的散列变量里面帮手?

  {{视图搜索查看占位符={{T'search.root'}}REF =搜索URL =/网页/搜索的className ='首页搜索填充工具=真}


解决方案

更新:把手现在支持SUBEX pressions(见的 http://handlebarsjs.com/ex$p$pssions.html ),所以你可以这样做:

  {{视图搜索查看(T'search.root')}}

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}}

解决方案

Update: Handlebars now supports subexpressions (see http://handlebarsjs.com/expressions.html), so you can just do:

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

这篇关于是否有可能到选项里窝佣工车把哈希?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆