Contents:
how do you pass the person variable?
when person is empty run the first part of condition?
use this to see what will be the result?
why doesnt even check the other condition?
problem solved?
And what you call new?
Any suggestions?
how do you pass the person variable?
when person is empty run the first part of condition?
use this to see what will be the result?
why doesnt even check the other condition?
problem solved?
And what you call new?
Any suggestions?
duruiz 2020-06-03 22:54:52
natghi2010 2020-06-03 22:54:03
it returns an array
so, I’m not with time to check in PHP now, but as a front end I’ll go with empty arrays being true.
duruiz 2020-06-03 22:55:11
If I remember right, you can check if array is empty with empty() function in php.
natghi2010 2020-06-03 22:56:17
duruiz 2020-06-03 22:55:11
If I remember right, you can check if array is empty with empty() function in php.
$person is completely not there
natghi2010 2020-06-03 22:56:27
its not just an empty array
duruiz 2020-06-03 22:56:54
natghi2010 2020-06-03 22:54:03
it returns an array
oh, I thought it was an empty array.
Roham0010 2020-06-03 22:57:11
natghi2010 2020-06-03 22:54:03
it returns an array
maybe it’s an object and should be called like $person->info…
natghi2010 2020-06-03 22:57:13
when i do pass it to the view it is an array
natghi2010 2020-06-03 22:57:37
Roham0010 2020-06-03 22:57:11
maybe it’s an object and should be called like $person->info…
it works when person is passed
natghi2010 2020-06-03 22:57:48
but when the person is not passed, it crashes
natghi2010 2020-06-03 22:57:59
even if I put an isset to check
Roham0010 2020-06-03 22:58:25
natghi2010 2020-06-03 22:57:59
even if I put an isset to check
how do you pass the person variable?
natghi2010 2020-06-03 22:58:43
I pass it from the controller
natghi2010 2020-06-03 22:58:55
“person”=>$person
Roham0010 2020-06-03 22:59:14
when you don’t pass it by what condition?
Roham0010 2020-06-03 22:59:40
if person is empty ok it’s empty but it’s setted to empty or null or…
Roham0010 2020-06-03 22:59:54
if you want to check empty don’t use isset
natghi2010 2020-06-03 22:59:57
Roham0010 2020-06-03 22:59:40
if person is empty ok it’s empty but it’s setted to empty or null or…
still err
natghi2010 2020-06-03 23:00:17
because $person[‘info’] is undefined
natghi2010 2020-06-03 23:00:38
even if code knows the array is empty
Roham0010 2020-06-03 23:00:59
{{ $person ?…
when person is empty run the first part of condition?
when person is empty run the first part of condition?
natghi2010 2020-06-03 23:01:26
and it still goes over the second condition
natghi2010 2020-06-03 23:01:41
and finds the $person[‘info’] is undefined
natghi2010 2020-06-03 23:02:37
<div style=”width: 60%;float: right; padding: 0px”>: <i>{{ isset($person) ? $person[‘info’][‘name’] : ”}}</i> </div>
Roham0010 2020-06-03 23:03:08
<div style=”width: 60%;float: right; padding: 0px”>: <i>{{ $person ? $person[‘info’][‘name’] : ”}}</i> </div>
natghi2010 2020-06-03 23:03:19
i missed the ”
natghi2010 2020-06-03 23:03:32
when i was copyiny
Roham0010 2020-06-03 23:03:33
use this to see what will be the result?
Roham0010 2020-06-03 23:04:12
Roham0010 2020-06-03 23:03:08
<div style=”width: 60%;float: right; padding: 0px”>: <i>{{ $person ? $person[‘info’][‘name’] : ”}}</i> </div>
does this work?
natghi2010 2020-06-03 23:04:37
error
natghi2010 2020-06-03 23:05:05
why doesnt even check the other condition?
Roham0010 2020-06-03 23:05:35
place a screenshot of person dump(dd) plz..
DesolatorMagno 2020-06-03 23:05:36

natghi2010 2020-06-03 23:06:04
mmh
DesolatorMagno 2020-06-03 23:08:16

Just so you know that it work if the variable is not set and is not null.
natghi2010 2020-06-03 23:08:42
DesolatorMagno 2020-06-03 23:08:16
Just so you know that it work if the variable is not set and is not null.
this wont work on older php versions
natghi2010 2020-06-03 23:09:02
i mean laravel version*
DesolatorMagno 2020-06-03 23:09:12
PHP
DesolatorMagno 2020-06-03 23:09:26
that is simple PHP, not Laravel.
Roham0010 2020-06-03 23:09:39
natghi2010 2020-06-03 23:09:02
i mean laravel version*
it’s a php operator
natghi2010 2020-06-03 23:10:06
Roham0010 2020-06-03 23:09:39
it’s a php operator
I mean php version :)))
Roham0010 2020-06-03 23:10:23
natghi2010 2020-06-03 23:10:06
I mean php version :)))
problem solved? 🤔
natghi2010 2020-06-03 23:10:28
Roham0010 2020-06-03 23:10:23
problem solved? 🤔
definitly
DesolatorMagno 2020-06-03 23:10:37
And what you call new? php 7.0?
natghi2010 2020-06-03 23:12:38
DesolatorMagno 2020-06-03 23:10:37
And what you call new? php 7.0?
for some reason I misread laravel instead of php. laravel needs 7.2php or higher
natghi2010 2020-06-03 23:12:59
so all is good
DesolatorMagno 2020-06-03 23:16:06
Well, Laravel 5.3 can work with 5.6.4, but i don’t even take that in account because it can work with max 7.1
natghi2010 2020-06-03 23:26:43
DesolatorMagno 2020-06-03 23:16:06
Well, Laravel 5.3 can work with 5.6.4, but i don’t even take that in account because it can work with max 7.1
It wouldn’t let me install on it on 5.6
duruiz 2020-06-03 23:28:22
nullish coalescing, cool 🙂
jkwya 2020-06-04 00:03:05
I have a form with one input and one select fields. I wanna be able to show the result without submitting the form. When user type in a value in input field and choose an option from select, it should automatically give the result. Any suggestions?
DesolatorMagno 2020-06-04 00:04:59
Ajax.