我在 Meteor 应用上使用铁路径,我想知道使用正则表达式来定义路径路径是可能?
目前,我定义了这样的路径:
path: '/article/:slug-:_id'
但Iron路由器找不到该页面,因为slug
也包含破折号......所以Iron路由器不知道如何识别slug
和id
是否有更精确定义路径的解决方案?就像在Symfony或Spring等中一样:
@Route("/article/{id}-{slug}", requirements={"id"="([0-9]+)", "slug"="([a-z0-9\-]+)"}, name="article_view")
非常感谢!
雅尼斯。