1WebCommon.__t_incomingData(3kaKyaay)a module referWeenbcCeommon.__t_incomingData(3kaya)
2
3
4
6 WebCommon::__t_incomingData - Returns all values for the specified key
7 from user-supplied data
8
10 [Builtins::Tainted<String> ] __t_incomingData( String key, WebCom‐
11 mon::DataSource ds )
12
14 key The key to retrieve data for
15
16 ds The source for user-supplied data
17
19 Returns an array of all values for the key from the specified data
20 source, or throws a WebCommon.NotIncoming (3kaya) Exception if no such
21 key exists.
22
23
24 // GET /example.cgi?a=1;b=3;b=5;z=;z;z
25 vals = incomingData("a",DataGet);
26 // vals = ["1"]
27 vals = incomingData("b",DataGet);
28 // vals = ["3","5"]
29 vals = incomingData("c",DataGet);
30 // NotIncoming exception thrown
31 vals = incomingData("z",DataGet);
32 // vals = ["","",""]
33
34 This is useful for processing the output from forms containing check‐
35 boxes with the same name or multiple selects.
36
37
38 <form action='example.cgi' method='get'>
39 <fieldset><legend>Example form</legend>
40 <select multiple='multiple' name='a'>
41 <option value='1'>Option 1</option>
42 <option value='2'>Option 2</option>
43 <option value='3'>Option 3</option>
44 <option value='4'>Option 4</option>
45 </select>
46 <input type='submit' value='Test!'>
47 </fieldset>
48 </form>
49
51 Kaya standard library by Edwin Brady, Chris Morris and others
52 (kaya@kayalang.org). For further information see http://kayalang.org/
53
55 The Kaya standard library is free software; you can redistribute it
56 and/or modify it under the terms of the GNU Lesser General Public
57 License (version 2.1 or any later version) as published by the Free
58 Software Foundation.
59
61 WebCommon.DataSource (3kaya)
62 WebCommon.incomingExists (3kaya)
63 WebCommon.incomingKeys (3kaya)
64 WebCommon.incomingValue (3kaya)
65
66
67
68Kaya December 2010WebCommon.__t_incomingData(3kaya)