you can't use isset on the result of an expression
the error is telling you what is wrong with it.
What method can I uses to check the result of an expression is set to a certain value? Do i need to or should I just remove isset()?
This expression
($orderData['order']->source == 'Amazon.co.uk')
will return a boolean value.
If you want to check that $orderData['order']->source
is NOT amazon.co.uk or .de, then just remove both isset
s from your code. I'd also recommend lowercasing both strings when checking.
@extends('layouts.' .$orderData['order']->source == 'Amazon.co.uk' or $orderData['order']->source == 'Amazon.de' ? 'layout1' : 'layout.layout2')
I don't think this code works as I don't get an email. Although, I don't get any errors when running a cron job any ideas?
If I lower the case of the string when checking will it still work ? is == not case sensitive?
I am going to try this in the morning
@extends($orderData['order']->source == 'Amazon.co.uk' or $orderData['order']->source == 'Amazon.de' ? 'layout.layout1' : 'layout2')
@if ($var1 === '1' || $var2 === '1')
//Do my stuff
@endif
@if (count($records) === 1)
I have one record!
@elseif (count($records) > 1)
I have multiple records!
@else
I don't have any records!
@endif
hmm extends has to be on the first line
http://laravel.io/forum/08-12-2014-blade-if-else-and-extends
Do I need to use @endif If I am using ternaries?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community