Bird
0
0

Which of the following is the correct Blade directive to start a conditional statement?

easy📝 Syntax Q12 of 15
Laravel - Views and Blade Templates
Which of the following is the correct Blade directive to start a conditional statement?
A<code>@if(condition)</code>
B<code>#if(condition)</code>
C<code>if(condition):</code>
D<code>@@if(condition)</code>
Step-by-Step Solution
Solution:
  1. Step 1: Recall Blade directive syntax

    Blade uses directives starting with @ for control structures like conditionals.
  2. Step 2: Identify correct conditional start

    The correct syntax to start an if statement is @if(condition).
  3. Final Answer:

    @if(condition) -> Option A
  4. Quick Check:

    Blade if start = @if(condition) [OK]
Quick Trick: Blade directives always start with @ symbol [OK]
Common Mistakes:
  • Using # instead of @ for directives
  • Using raw PHP if syntax inside Blade
  • Double @ signs which are for escaping

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Laravel Quizzes