[SOLVED] Using Blade @if , @elseif directives - some advice needed
Hi folks,
Hoping I can get some advice on how to use the @if and @elseif directives within Blade or if there is a better way of implementing what I'm trying to do.
The scenario: I have about 100 menu navigations items that depending on their "Type" (A value kept in the DB) will need to be wrapped with certain row elements plus their own HTML tags.
So for example:
If it's Type is "1" it would be a Main Header and presented like so:
<li class="{{ $navigation->classL }}">{{ $navigation->main_Header }}</li>
If it's Type is "2" it would be a Title and presented like so:
<li class="treeview">
<a href="{{ $navigation->link }}">
<i class="{{ $navigation->classL }}"></i> <span>{{ $navigation->title }}</span>
<i class="{{ $navigation->classR }}"></i>
</a>
If it's Type is "3" it would be a Menu Item and presented like so:
<ul class="treeview-menu">
<li><a href="{{ $navigation->link }}"><i class="{{ $navigation->classR }}"></i>{{ $navigation->title }}</a></li>
</ul>
Use a good ide, even just copy pasting view code showed me to errors regarding directives not being closed, first if and foreach.

Please or to participate in this conversation.