我正在与Laravel合作,并问我如何添加将我发送到可以显示数据的页面的按钮 我已经做到了,但是我不知道如何在Yajrabox表单中添加按钮 我在谈论这个:
<td>
<a href="{{ url('sujet/'.$sujet->id.'/afficher') }}" class="btn btn-info"> See the informations </a>
</td>
这是我的Yajrabox视图:
<html>
<head>
</head>
<body>
<!-- Static navbar -->
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{url('/accueil')}}"><span style="font-size:30px;font-family:'Cairo';color:silver">الغلبزوزي</span></a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li style="padding:5px"> <a href="{{url('archive')}}"> <strong style="font-size:15px;padding:5px">أرشيف</strong>   <span class="glyphicon glyphicon-folder-open pull-right"> </span> </a></li>
<li style="padding:5px" > <a href="{{url('/client')}}"> <strong style="font-size:15px;padding:5px"> الموكلون </strong>   <span class="glyphicon glyphicon-user pull-right"> </span> </span></a></li>
<li style="padding:5px"> <a href="{{url('sujet')}}"> <strong style="font-size:15px;padding:5px"> الملفات </strong>  <span class="glyphicon glyphicon-book pull-right"> </span></a></li>
<li style="padding:5px"> <a href="{{url('session')}}"> <strong style="font-size:15px;padding:5px"> الجلسات </strong>   <span class="glyphicon glyphicon-home pull-right"> </span> </a></li>
<li style="padding:5px"> <a href="{{url('facture')}}"> <strong style="font-size:15px;padding:5px">مصاريف</strong>   <span class="glyphicon glyphicon-euro pull-right"> </span> </a></li>
<li style="padding:5px" ><a href="{{url('sujet/recherche')}}" > <strong style="font-size:15px;padding:5px"> بحث </strong>  <span class="glyphicon glyphicon-search pull-right"></span></a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<div style="text-align: right" class=" container ">
<img class="responsive" style="width:100%" src="{{asset('img/projet-elghalbzouri.jpg')}}" />
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table class="table border" border="1" id="myTable" >
<thead>
<tr>
<th>رقم الملف بالمكتب</th>
<th>الموضوع</th>
<th>تاريخ فتح الملف</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
<script src="https://datatables.yajrabox.com/js/jquery.min.js"></script>
<script src="https://datatables.yajrabox.com/js/bootstrap.min.js"></script>
<script src="https://datatables.yajrabox.com/js/jquery.dataTables.min.js"></script>
<script src="https://datatables.yajrabox.com/js/datatables.bootstrap.js"></script>
<script type="text/javascript">
$(function() {
$('#myTable').DataTable({
processing: true,
serverSide: true,
ajax: '/sujet/data',
columns: [
{data: 'id'},
{data: 'nomsujet'},
{data: 'tarikhfathmilaf'},
]
});
});
</script>
</body>
</html>
此按钮将我发送到显示我的数据的视图,如何在Yajrabox中添加该数据?
答案 0 :(得分:0)
您应该尝试以下操作:
您的路线,如:
Route::get('sujet/{id}/afficher',"yourcontroller@yourfunction")->name('sujet.afficher');
<td>
<a href="{{ route('sujet.afficher', [$sujet->id]) }}" class="btn btn-info"> See the informations </a>
</td>