Last active
June 11, 2019 10:20
-
-
Save robozavri/5490580552ce4c836aebad0222840278 to your computer and use it in GitHub Desktop.
laraadmin laravel organize language by prefix to the tab, wrap in tabs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@php | |
$fields = []; | |
$moduleFields = $module->fields; | |
foreach ( $moduleFields as $key => $field) | |
{ | |
if(in_array(substr($field['colname'],-3),['_en','_ka','_az','_ru','_hy'])) | |
{ | |
$fields[ substr($field['colname'],-2) ][] = $field; | |
unset( $moduleFields[ $key ] ); | |
} | |
} | |
@endphp | |
@foreach($moduleFields as $field) | |
@la_input($module, $field['colname']) | |
@endforeach | |
<!-- Nav tabs --> | |
<ul id="myTab" class="nav nav-tabs"> | |
@foreach( $fields as $key => $item) | |
<li><a href="#{{ $key }}" data-toggle="tab">{{ $key }}</a></li> | |
@endforeach | |
</ul> | |
<!-- Tab panes --> | |
@foreach( $fields as $key => $items) | |
<div class="tab-content"> | |
<div class="tab-pane tabcontent" id="{{ $key }}"> | |
@foreach( $items as $key => $fild) | |
@la_input($module, $fild['colname']) | |
@endforeach | |
</div> | |
</div> | |
@endforeach | |
@push('scripts') | |
<script> | |
$('#myTab a').click(function (e) { | |
e.preventDefault(); | |
$('.tabcontent').removeClass('active'); | |
$(this).tab('show'); | |
}) | |
</script> | |
@endpush |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment