【发布时间】:2013-11-30 18:21:36
【问题描述】:
为了获得易于理解的共享链接,我不想只将._id 放在网址中,而是将.name 也放在网址中。
Router.map(function () {
this.route('here', {
path: 'here/:_id/:name/',
template: 'here'
})
})
问题在于.name 条目可以包含特殊字符,例如/。
www.example.com/here/1234/name_with special-characters like / (<-this slash) /
有没有办法替换 Iron-router 中的斜杠(和其他特殊字符)?
(如果有很好的方法来处理这个问题,也许在某些情况下我什至不需要 id。)
如果我想使用<a href="{{pathFor 'showCourse'}}">
我不能使用通配符path: 'here/:_id/*
谢谢
【问题讨论】:
-
为什么允许在名称中使用斜杠作为
url的一部分?你这样做有什么特别的原因吗?
标签: meteor meteorite iron-router