我有以下代碼,我想知道如何將數(shù)據(jù)從表傳遞到模態(tài)這是我在 edit.blade.php 中的代碼。模式確實(shí)有效,但我不知道如何使數(shù)據(jù)顯示在模式中,我會(huì)自己 POST 到數(shù)據(jù)庫(kù),但我只想知道如何顯示該數(shù)據(jù),以便我可以編輯它。我想在模態(tài)中顯示的數(shù)據(jù)是 ID、姓名和電子郵件。這是我在 editar.blade.php 中的代碼<script src="{{ url('/js/vendor/jquery-1.12.4.min.js') }} "></script><script src="{{ url('/js/bootstrap.min.js') }} "></script><link rel="stylesheet" href="{{ url('/css/bootstrap.min.css') }} "><script src="{{ url('/js/jquery.dataTables.min.js') }} "></script><div class="container"> <h2>Editar estudiante</h2><div class="container"> <h2>Laravel DataTables Tutorial Example</h2> <table id="user_table" class="table table-bordered table-striped"> <thead> <tr> <th width="35%" id="name">Name</th> <th width="35%" id="email">Email</th> <th width="30%">Action</th> </tr> </thead> </table></div><div class="modal fade" id="edit-modal" tabindex="-1" role="dialog" aria-labelledby="edit-modal-label" aria-hidden="true"> <div class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="edit-modal-label">Edit Data</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span> </button> </div> <div class="modal-body" id="attachment-body-content"> <form id="edit-form" class="form-horizontal" method="POST"> <div class="card text-white bg-dark mb-0"> <div class="card-header"> <h2 class="m-0">Edit</h2> </div>
將數(shù)據(jù)從數(shù)據(jù)表添加到 Laravel 中的模式
尚方寶劍之說(shuō)
2023-10-01 16:10:22