0
0
Laravelframework~10 mins

Echoing data with {{ }} in Laravel - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to echo the variable $name inside a Blade template.

Laravel
<p>Hello, {{ [1] }}!</p>
Drag options to blanks, or click blank then click option'
A{{$name}}
Bname
C$name
Decho $name
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting the $ sign before the variable name.
Trying to use PHP echo inside {{ }}.
Including extra curly braces inside the {{ }}.
2fill in blank
medium

Complete the code to safely echo the variable $title in a Blade template.

Laravel
<h1>{{ [1] }}</h1>
Drag options to blanks, or click blank then click option'
A$title
Becho $title
Ctitle
D{!! $title !!}
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the $ sign.
Using {!! !!} which outputs raw HTML.
Trying to write PHP echo inside {{ }}.
3fill in blank
hard

Fix the error in echoing the variable $count inside a Blade template.

Laravel
<span>Count: {{ [1] }}</span>
Drag options to blanks, or click blank then click option'
Acount
B{!! $count !!}
Cecho $count
D$count
Attempts:
3 left
💡 Hint
Common Mistakes
Leaving out the $ sign.
Using raw echo syntax inside {{ }}.
Using {!! !!} unintentionally.
4fill in blank
hard

Fill both blanks to echo the uppercase version of $username safely in Blade.

Laravel
<p>{{ [1]([2]) }}</p>
Drag options to blanks, or click blank then click option'
Astrtoupper
B$username
Cusername
Decho
Attempts:
3 left
💡 Hint
Common Mistakes
Using the variable without $.
Trying to use echo inside {{ }}.
Using the function name without parentheses.
5fill in blank
hard

Fill both blanks to echo the length of $message safely in Blade.

Laravel
<p>Length: {{ [1]([2]) }}</p>
Drag options to blanks, or click blank then click option'
Astrlen
B$message
Cmessage
Dcount
Attempts:
3 left
💡 Hint
Common Mistakes
Using count() which is for arrays.
Omitting the $ sign on the variable.
Trying to echo inside {{ }}.