Liquid in section
Last updated
Last updated
Interpolation is a way to print out the dynamic data inside the HTML structure.
The engine is built in Javascript, In some situations, it's useful to embed logic code into your views. You can use the blade @js directive to execute your logic code. It works similarly to <?php
and ?>
in PHP programming language.
You may construct if statements using the @if
, @elseif
, @else
, and @endif
directives. These directives function identically to their Javascript counterparts:
For convenience, Blade also provides an @unless
directive:
Switch statements can be constructed using the @switch
, @case
, @break
, @default
and @endswitch
directives:
In addition to conditional statements, Engine provides simple directives for working with Javascript's loop structures. Again, each of these directives functions identically to their Javascript counterparts:
If you love LayoutHub, could you consider posting an review? That would be awesome and really help us to grow our business, here is the link.
Syntax
Description
@print(variable)
Print out the variable
@lang(variable)
Print out the variable or string which will be supported multiple
@attr()
Print out the escaped of variable into attribute of HTML element
Name
Syntax
Start
@js
End
@endjs
Name
Syntax
if
@if (conditions)
else if
@elseif (conditions)
else
@else
endif
@endif
unless
@unless(!conditions)
Name
Syntax
switch
@switch (variable)
case
@case (value)
break
@break or @endcase
default
@default
endswitch
@endswitch
Name
Syntax
for
@for (contitional statements)
endfor
@endfor
elsefor
@elsefor // incase array has no items
endelse
@endelse
Name
Syntax
while
@while (conditions)
endwhile
@endwhile