1WebCommon.incomingExists(3kayaK)aya module referenWceebCommon.incomingExists(3kaya)
2
3
4
6 WebCommon::incomingExists - Checks a key exists in user-supplied data
7
9 Bool incomingExists( String key, DataSource ds )
10
12 key The key to check
13
14 ds The source for user-supplied data
15
17 Returns true if the key exists in the data source, and false otherwise.
18
19
20 // GET /example.cgi?a=1;b=3;b=5;z=;z;z
21 val = incomingExists("a",DataGet);
22 // val = true
23 val = incomingExists("b",DataGet);
24 // val = true
25 val = incomingExists("c",DataGet);
26 // val = false
27 val = incomingExists("z",DataGet);
28 // val = true
29
30 This is useful for avoiding Exceptions when using WebCommon.incomingā
31 Data (3kaya) or WebCommon.incomingValue (3kaya) , or for checking if a
32 checkbox has been selected.
33
35 Kaya standard library by Edwin Brady, Chris Morris and others
36 (kaya@kayalang.org). For further information see http://kayalang.org/
37
39 The Kaya standard library is free software; you can redistribute it
40 and/or modify it under the terms of the GNU Lesser General Public
41 License (version 2.1 or any later version) as published by the Free
42 Software Foundation.
43
45 WebCommon.DataSource (3kaya)
46 WebCommon.incomingData (3kaya)
47 WebCommon.incomingKeys (3kaya)
48 WebCommon.incomingValue (3kaya)
49
50
51
52Kaya December 2010 WebCommon.incomingExists(3kaya)