Welcome Guest, Not a member yet? Register   Sign In
Invalid argument supplied for foreach() when using parser
#4

hello.
is there already a solution here? i have the same problem. in the ci4 documentation the example does not work either.

greeting, mike


https://codeigniter4.github.io/userguide...ight=parse

the following example from the documentation sends folgwenden error: CRITICAL - 2020-02-19 14:50:57 --> Invalid argument supplied for foreach()

$template = '{name} lives in {location}{city} on {planet}{/location}.';

$data = [
        'name'    => 'George',
        'location' => [ 'city' => 'Red City', 'planet' => 'Mars' ]
];

echo $parser->setData($data)->renderString($template);
// Result: George lives in Red City on Mars.
Reply


Messages In This Thread
RE: Invalid argument supplied for foreach() when using parser - by MikiStoni - 02-19-2020, 02:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB