Is there a way to set object parameter value to empty string or null if object does not exist instead of fatal error?
Lets say i have this in my view:
<div> <?php $car->name; ?> </div
And there is a chance that car is empty object in some cases. I just could write my own function that checks object and return object parameter or empty string, but i want to know if there is a default way to do this.
Another way would be use shorthand if statement, as in
($car) ? $car->name : "";
but it is too long to but in view IMHO.