Play Framework 中的 ?= 运算符是什么?
What is the ?= operator in the Play Framework?
我看到 ?=
运算符用于在 Play 中定义路由时设置默认值。但是我在文档中找不到任何对它的引用。该运算符记录在哪里?这是 Scala 的东西还是 Play Framework 的东西?
用法示例:
GET /users controllers.Application.users(max:java.lang.Integer ?= 50, page:java.lang.Integer ?= 0)
(摘自:How to handle optional query parameters in Play framework)。
这是 Play Framework 特有的。它(简要地)记录在 routing section.
中
conf/routes
is the configuration file used by the router.
routes
文件不是 Scala;只是有点像。
我看到 ?=
运算符用于在 Play 中定义路由时设置默认值。但是我在文档中找不到任何对它的引用。该运算符记录在哪里?这是 Scala 的东西还是 Play Framework 的东西?
用法示例:
GET /users controllers.Application.users(max:java.lang.Integer ?= 50, page:java.lang.Integer ?= 0)
(摘自:How to handle optional query parameters in Play framework)。
这是 Play Framework 特有的。它(简要地)记录在 routing section.
中
conf/routes
is the configuration file used by the router.
routes
文件不是 Scala;只是有点像。