私はナビゲーションバーを持つウェブサイトを持っています(main.blade.phpにあります)。私はjQueryテーブルを作成しましたが、ブレードビューではなく単純な.phpとして作成しました。コンテンツセクションを設定してブレードに追加するにはどうすればよいですか?ありがとう!簡単な.phpから.blade.phpにjQueryテーブルを追加するLaravel5
ルート:
web.php
古い(ブレードからの単純なページ):
Route::get('/manageclasses', ['as' => 'manageclasses', 'uses' => 'UserView\[email protected]']);
新しいもの(テーブルと単純なページ):
Route::get('/manageclasses',['as' => 'manageclasses',function(){
$manageclasa = App\Elevi::all();
return View::make('table')->with('manageclasa', $manageclasa);
}]);
テーブルを追加するブレードレイアウト
@extends('layouts.master')
@extends('layouts.navbar')
@extends('layouts.sidebar')
@section('content')
<h3 class="white-text">Manage Page</h3>
@endsection
テーブル
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Manage Clasa</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js"></script>
<link rel="stylesheet" type="text/css" href="//ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css">
</head>
<body>
<h1>Elevi clasa</h1>
<table>
<thead>
<tr>
<th>Nume</th>
<th>Prenume</th>
</tr>
</thead>
<tbody>
<?php foreach ($manageclasa as $elev): ?>
<tr>
<td><?php echo $elev['nume'] ?></td>
<td><?php echo $elev['prenume'] ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<script>
$(function(){
$("table").dataTable();
});
</script>
</body>
</html>
問題はここ何ですか? –
テーブルにブレードを追加できません。私はいくつかの方法で試しましたが、成功しませんでした –
私はそれを作る方法をsugestionが必要です –