poet

Specify route rules, and route to different components

≡放荡痞女 提交于 2019-12-11 09:56:14
问题 I know how to to specify routes for page components using Mason::Plugin::RouterSimple, for example given a url of: /archives/2015/07 I can create a component archives.mc as this: <%class> route "{year:[0-9]{4}}/{month:[0-9]{2}}"; </%class> Archives for the month of <% $.month %>/<% $.year %> and similarly I can create a news.mc component that will handle urls of: /news/2012/04 and that's fine (and very elegant!) but now what I want is to be able to handle urls like the following ones: /john