haml 语法 - 嵌套部分属性
我想要的是一种嵌套部分属性的方法,这似乎有点啰嗦:
= partial('frames/tabs_a', :locals => {:tabs_title => 'semi-dynamic-tabs',
:tabs_id => 'p001',
:panel_a => 'views/article-highlights_a',
:a_id => 'p_002_0',
:a_ft => '123 More in highlights',
:a_tt => 'panel a',
:a_c => 'magazine',
:panel_b => 'views/thumbnail-list_a',
:b_id => 'b_id',
:b_ft => 'testing tt',
:b_tt => 'panel b',
:b_c => 'opportunities',
:b_c => 'opportunities',
:panel_c => 'views/thumbnail-list_a',
:c_id => 'b_id',
:c_ft => 'testing tt',
:c_tt => 'panel c',
:c_c => 'community',
:panel_d => 'views/article-highlights_a',
:d_id => 'p_002_0',
:d_ft => '123 More in highlights',
:d_tt => 'panel d',
:d_c => 'magazine'
})
我正在使用静态。
what i want is a way of nesting partial properties, this seems a tad long winded:
= partial('frames/tabs_a', :locals => {:tabs_title => 'semi-dynamic-tabs',
:tabs_id => 'p001',
:panel_a => 'views/article-highlights_a',
:a_id => 'p_002_0',
:a_ft => '123 More in highlights',
:a_tt => 'panel a',
:a_c => 'magazine',
:panel_b => 'views/thumbnail-list_a',
:b_id => 'b_id',
:b_ft => 'testing tt',
:b_tt => 'panel b',
:b_c => 'opportunities',
:b_c => 'opportunities',
:panel_c => 'views/thumbnail-list_a',
:c_id => 'b_id',
:c_ft => 'testing tt',
:c_tt => 'panel c',
:c_c => 'community',
:panel_d => 'views/article-highlights_a',
:d_id => 'p_002_0',
:d_ft => '123 More in highlights',
:d_tt => 'panel d',
:d_c => 'magazine'
})
I'm using staticmatic.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是编写助手的好地方。
This is a great place to write a helper.
谢谢nex3,你是对的,我可能最终会这样做,但是为了以防万一这对任何人有帮助,我确实找到了将数组添加到哈希的语法。
Thanks nex3, you are right, I'll probably end up doing that, however just in case this helps anybody, I did find the syntax for adding arrays to a hash.