Noctua
1
Hello,
I’m trying to create an order form and used the following example from @bastianallgeier: Plain contactform example for Kirby 2 · GitHub.
I want to compare a city name with an array of valid city names and want to use the ‘in-validator’ (Kirby 2 Docs) like this:
$invoice_address_delivery_rules = array('City' => array('required', 'match' => '/[A-Za-z0-9]+/', 'in' => ['City1','City2','City3']));
Unfortunately I get the following error message after submitting the form and can’t find a solution yet.
Whoops \ Exception \ ErrorException (E_WARNING)
in_array() expects parameter 2 to be array, string given
Any ideas or solutions?
Thank you!
Is there are stack trace?
Noctua
3
I hope this will help!
Whoops\Exception\ErrorException
…/vendor/getkirby/toolkit/lib/v.php:88
12
in_array
…/vendor/getkirby/toolkit/lib/v.php:88
11
{closure}
…/vendor/getkirby/toolkit/lib/v.php:41
10
V __callStatic
…/vendor/getkirby/toolkit/helpers.php:282
9
call
…/vendor/getkirby/toolkit/helpers.php:353
8
invalid
/Users/noctua/www/projekt1/site/controllers/shopping_cart.php:254
7
Kirby\Registry\Controller {closure}
…/core/page.php:1515
6
PageAbstract controller
…/kirby/component/template.php:35
5
Kirby\Component\Template data
…/kirby/component/template.php:87
4
Kirby\Component\Template render
…/kirby.php:681
3
Kirby template
…/kirby.php:669
2
Kirby render
…/kirby/component/response.php:29
1
Kirby\Component\Response make
…/kirby.php:751
0
Kirby launch
/Users/noctua/www/projekt1/index.php:16