Router(sinartra)
Router()所属R语言包:sinartra
Router object.
路由器的对象。
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Router object. The router object coordinates matching urls to functions.
路由器的对象。路由器对象的坐标匹配的URL的功能。
Details
详细信息----------Details----------
Add possible route using the appropriate http verb (get, post, put, delete). Currently only get is implemented. These methods have two arguments: route, the description of the url to match, and the callback to run when the route is matched.
添加使用相应的HTTP动词(GET,POST,PUT,DELETE)的可能的途径。目前,只有得到实施。这些方法有两个参数:route,URL匹配的描述,和callback运行时的路线被匹配。
Route urls have a special syntax. They are basically paths but with two special keywords: :param which matches a single component and * which will match anything.
路线网址有一种特殊的语法。他们基本上是路径,但有两个特殊的关键字::param匹配一个单一的组件和*这将匹配任何内容。
hello.html matches hello.html only
hello.html匹配hello.html only
packages/:package.html will match packages/a.html, packages:/my-package.html and so on, and the callback will be called with an argument named package containing "a" and "my-package" respectively.
packages/:package.html将匹配packages/a.html,packages:/my-package.html“等,回调函数将会被调用,一个参数叫做包,其中包含”A“和”我的包“。
*.html will match anything ending in .html and callback will be called with a "splat" argument </ul>
*.html将匹配任何结尾的.html和回调函数将会被调用的“图示”的说法</ ul>
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|