首页 > 其他 > 详细

Luci

时间:2021-06-25 22:18:39      阅读:29      评论:0      收藏:0      [点我收藏+]

depends

Examples:

- opt:depends("foo", "test")
    Require the value of `foo` to be `test`.

- opt:depends({ foo: "test" })
    Equivalent to the previous example.

- opt:depends({ foo: /test/ })
    Require the value of `foo` to match the regular expression `/test/`.

- opt:depends({ foo: "test", bar: "qrx" })
    Require the value of `foo` to be `test` and the value of `bar` to be `qrx`.

- opt:depends({ foo: "test" })
- opt:depends({ bar: "qrx" })
    Require either foo to be set to test, or the bar option to be qrx.

- opt:depends("test.section1.foo", "bar")
    Require the "foo" form option within the "section1" section to be set to "bar".

- opt:depends({ foo: "test", "!contains": true })
    Require the "foo" option value to contain the substring "test".

Luci

原文:https://www.cnblogs.com/thammer/p/14931905.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!