What does a dd give you?
Apr 15, 2021
15
Level 1
Undefined array key 1, ErrorException while trying to pass a variable to view
sorry for bothering, I was expected to get some results after passing $wordsset to the view with compact. Similar things work in other parts of the project. But here it doesn't
I would be very pleased to hear from you if you have any idea?
in the function
$wordsset = [[1],[[["1"],["1"],["scaun"]]],[[["2"],["1"],["stuhl"]]],[[["3"],["1"],["chair"]],[["4"],["2"],["seat"]]],[[["5"],["la"],["chaise"]]]];
return view('back.editword', compact('wordsset'));
in the blade php
{{var_export($wordsset,true)}}
Level 75
I even tried:
$wordsset = [[1],[[["1"],["1"],["scaun"]]],[[["2"],["1"],["stuhl"]]],[[["3"],["1"],["chair"]],[["4"],["2"],["seat"]]],[[["5"],
echo $wordsset[0][0];
die;
Which gives:
1
See if it works in blade
{{ $wordsset[0][0] }}
edit, I just tryed and this workded:
$wordsset = [[1],[[["1"],["1"],["scaun"]]],[[["2"],["1"],["stuhl"]]],[[["3"],["1"],["chair"]],[["4"],["2"],["seat"]]],[[["5"],["la"],["chaise"]]]];
return view('testarray.atest', compact('wordsset'));
And in view, just a quick setup:
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
{{ $wordsset[0][0] }}
</body>
</html>
And got 1.
Make sure you are calling the correct view, works on my end.
Please or to participate in this conversation.