Support the ongoing development of Laravel.io →
Views Blade Laravel.io
Last updated 2 years ago.
0

you can't use isset on the result of an expression

the error is telling you what is wrong with it.

Last updated 2 years ago.
0

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()?

Last updated 2 years ago.
0

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 issets from your code. I'd also recommend lowercasing both strings when checking.

Last updated 2 years ago.
0

@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?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.