php - 如何在 Yajrabox 中添加显示数据按钮
问题描述
我正在与 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 中添加该视图?
解决方案
你应该试试这个:
您的路线如下:
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>
推荐阅读
- java - 在 Java 中将 Stream 转换为字符串
- javascript - 角度路由在手动刷新或直接输入 url 时进入主页
- java-11 - 无法在 gmaven-plugin 插件中加载 mojo 'execute'
- angular7 - Angular7 oidc 与 Identityserver4 的集成
- python - Matplotlib:y轴刻度上的图像网格不均匀
- azure - 如何在 Azure 中的密钥轮换后为存储 Blob 的客户端请求提供服务
- node.js - 使用 Dynamoose.js 和 Angular6 进行分页
- azure - 如何避免在附加字符串连接器逻辑应用程序中添加重复字符串
- python - 为什么不以 graphml 格式保存图形?
- java - 无法使用 processbuilder 运行 java 命令