聖杯布局
parent
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@yield('title','bootstrap學習網站')</title>
</head>
<style type="text/css">
body {
min-width: 550px;
}
body,html{
margin: 0;
}
header{
width: 100%;
background-color:lightyellow;
}
#container{
width: 100%;
background-color: yellow;
height: 200px;
padding-left: 200px;
padding-right: 200px;
box-sizing: border-box;
}
.column{
float: left;
height: 200px;
}
#center{
width: 100%;
background-color: lightblue;
}
#left{
position: relative;
width: 200px;
background-color:pink;
margin-left: -100%;
right: 200px;
}
#right{
width: 200px;
background-color: orange;
margin-right: -200px;
}
footer{
clear: both;
width: 100%;
background-color:lightyellow;
}
</style>
<body>
<header>header</header>
<div id="container">
<div id="center" class="column">
@section('content')
<h5>這是父模闆</h5>
@show
</div>
<div id="left" class="column">left</div>
<div id="right" class="column">right</div>
</div>
<footer >footer</footer>
</body>
</html>
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Controllers\Student;
class UserController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$name = "畢志慧";
$age =20;
// $students=$this->students;
$students = Student::$students;
return view('school')->with(compact('name','age','students'));
dd("hhh");
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
$message ="這是create,頁面提示資訊";
$type ="success";
$type ="error";
// return view('create',compact('message','type'));
return view('create',compact('message','type'));
dd("creat");
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
// dd($request->all());
$data = $request->except('_token');
// dd($data);
return view('store',compact('data'));
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
// $stu =null;
// $students=$this->students;
// $students = Student::$students;
// foreach($students as $value){
// if($value['xh']==$id){
// $stu =$value;
// }
// }
// return view('detail',compact('stu'));
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
return view('edit',compact('id'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
$data = $request->all();
dd($data,$id);
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
public function showSome(){
$names="畢志慧";
return view('admin.login')->with('name',$names)->with('age',20);
}
}
web
Route::resource('/user',UserController::class);
create
<link rel="stylesheet" type="text/css" href="{{asset('').'css/bootstrap.min.css'}}">
@extends('layout.parent')
@section('title','模闆')
@section('content')
<form action="{{url('user')}}">
<input type="hidden" name="_token" value="{{csrf_token()}}">
<label for="song">
<input type="text"name="song" id="song"placeholder="請輸入關鍵字">
</label>
<input type="submit" value="搜尋">
</form>
@parent
@endsection
bootstrap聖杯布局聖杯布局