-
Notifications
You must be signed in to change notification settings - Fork 121
Template logic
Jorge Castro edited this page Apr 22, 2020
·
2 revisions
Tag | Note |
---|---|
@if (boolean) | if logic-conditional |
@elseif (boolean) | else if logic-conditional |
@else | else logic |
@endif | end if logic |
@unless(boolean) | execute block of code is boolean is false |
@switch | switch logic-conditional |
Example:(the indentation is not required)
@switch($countrySelected)
@case(1)
first country selected<br>
@break
@case(2)
second country selected<br>
@break
@defaultcase()
other country selected<br>
@endswitch()
-
@switch
The first value is the variable to evaluate. -
@case
Indicates the value to compare. It should be run inside a @switch/@endswitch -
@default
(optional) If not case is the correct then the block of @defaultcase is evaluated. -
@break
Break the case -
@endswitch
End the switch.
Copyright Jorge Castro Castillo
- BladeOne Manual
- Template tags (views)
- Custom control
- Methods of the class
- Injecting logic before the view (composer)
- Extending the class
- Using BladeOne with YAF Yet Another Framework
- Differences between Blade and BladeOne
- Comparision with Twig (May-2020)
- Changelog
- Changes between 2.x and 3.0 and TODO
- Code Protection (Sourceguardian and similars)