Laravel 6.0未显示某个特定页面的CSS。其他页面工作顺利。 这是我的代码 “ satisekle.blade.php和edit.blade.php几乎在同一页面上。唯一的区别是某些变量。php代码正在运行,但未加载css。我的资产文件夹位于public / assets
<link rel="shortcut icon" href="assets/dist/img/ico/favicon.png" type="image/x-icon">
<!-- jquery-ui css -->
<link href="assets/plugins/jquery-ui-1.12.1/jquery-ui.min.css" rel="stylesheet" type="text/css"/>
<!-- Bootstrap -->
<link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<!-- Bootstrap rtl -->
<!--<link href="assets/bootstrap-rtl/bootstrap-rtl.min.css" rel="stylesheet" type="text/css"/>-->
<!-- Lobipanel css -->
<link href="assets/plugins/lobipanel/lobipanel.min.css" rel="stylesheet" type="text/css"/>
<!-- Pace css -->
<link href="assets/plugins/pace/flash.css" rel="stylesheet" type="text/css"/>
<!-- Font Awesome -->
<link href="assets/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
<!-- Pe-icon -->
<link href="assets/pe-icon-7-stroke/css/pe-icon-7-stroke.css" rel="stylesheet" type="text/css"/>
<!-- Themify icons -->
<link href="assets/themify-icons/themify-icons.css" rel="stylesheet" type="text/css"/>
<head>
@include('partials._head')
</head>
<body class="hold-transition sidebar-mini">
@include('partials.topbar')
<div class="container" id="contentall">
<div class="content">
@include('partials.leftbar')
@yield('content')
</div>
</div>
</body>
@include('partials.javascript')
刀片
@extends('main')
@section('content')
<form action="{{ route('satislar.store') }}" method="post">
{{ csrf_field() }}
<div class="form-group">
<label for="exampleInputEmail1">Satış Takip Numarası</label>
<input type="text" class="form-control" readonly value="{{$random}}" name="satis_takip_no">
<small id="emailHelp" class="form-text text-muted">Random Atanan Unique Takip Numarası</small>
</div>
<div class="form-group">
<label for="exampleInputEmail1">Ürün</label>
<input type="text" class="form-control" required id="exampleInputEmail1" aria-describedby="emailHelp"
name="urun" placeholder="Ürün">*
<small id="emailHelp" class="form-text text-muted">Ürün İsmini Giriniz</small>
</div>
<div class="form-group">
<label for="exampleInputEmail1">Birim</label>
<input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" name="birim"
placeholder="Birim">
<small id="emailHelp" class="form-text text-muted">Ürün Miktarını Giriniz</small>
</div>
<div class="form-group">
<label for="exampleInputEmail1">Firma Adı</label>
<input type="text" class="form-control" required id="exampleInputEmail1" aria-describedby="emailHelp"
name="firma" placeholder="Firma Adı">*
<small id="emailHelp" class="form-text text-muted">Firmanın Adını Giriniz</small>
</div>
<div class="form-group">
<label for="exampleInputEmail1">Yetkili</label>
<input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" name="yetkili"
placeholder="Yetkili">
<small id="emailHelp" class="form-text text-muted">Teslim Alacak Yetkilinin İsmini Giriniz</small>
</div>
<div class="form-group">
<label for="exampleInputEmail1">Telefon</label>
<input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" name="telefon"
placeholder="Telefon">
<small id="emailHelp" class="form-text text-muted">Ulaşılacak Kişinin Telefon Numarasını Giriniz</small>
</div>
<div class="form-group">
<label for="exampleInputEmail1">E-Posta</label>
<input type="email" class="form-control" id="exampleInputEmail1" required aria-describedby="emailHelp"
name="eposta" placeholder="E-Posta">*
<small id="emailHelp" class="form-text text-muted">Satışı Takip edecek Kişinin E-postasını Giriniz</small>
</div>
<button type="submit" class="btn btn-primary">Gönder</button>
</form>
@endsection
控制器
public function satisekle()
{
$number = mt_rand(1000000000, mt_getrandmax());
if ($this->sorgula($number) === "") {
return $this->satisekle();
}
return view('satislar.satisekle')->with('random', $number);
}
public function edit($id)
{
$satis = Satislar::find($id);
return view('satislar.edit')->with('satis', $satis);
}
和路线;
Route::get('/satisekle', 'satislarController@satisekle');
Route::get('/index', 'satislarController@index');
Route::get('/satislar/{$id}/edit', 'satislarController@edit');
Route::resource('satislar', 'satislarController');
,这不起作用。不显示CSS我完全疯了;
@extends('main')
@section('content')
<form action="{{ route('satislar.update',$satis->id)}}" method="post">
@method('PUT')
{{ csrf_field() }}
<div class="form-group">
<label for="exampleInputEmail1">Satış Takip Numarası</label>
<input type="text" class="form-control" value="{{$satis->takip_no}}" name="satis_takip_no" readonly>
<small id="emailHelp" class="form-text text-muted">Random Atanan Unique Takip Numarası</small>
</div>
<div class="form-group">
<label for="exampleInputEmail1">Ürün</label>
<input type="text" class="form-control" required id="exampleInputEmail1" value="{{$satis->urun}}" aria-describedby="emailHelp" name="urun" placeholder="Ürün">*
<small id="emailHelp" class="form-text text-muted">Ürün İsmini Giriniz</small>
</div>
<div class="form-group">
<label for="exampleInputEmail1">Birim</label>
<input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" value="{{$satis->birim}}" name="birim" placeholder="Birim">
<small id="emailHelp" class="form-text text-muted">Ürün Miktarını Giriniz</small>
</div>
<div class="form-group">
<label for="exampleInputEmail1">Firma Adı</label>
<input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" value="{{$satis->firma}}" name="firma" placeholder="Firma Adı" required>*
<small id="emailHelp" class="form-text text-muted">Firmanın Adını Giriniz</small>
</div>
<div class="form-group">
<label for="exampleInputEmail1">Yetkili</label>
<input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" name="yetkili" value="{{$satis->yetkili}}" placeholder="Yetkili">
<small id="emailHelp" class="form-text text-muted">Teslim Alacak Yetkilinin İsmini Giriniz</small>
</div>
<div class="form-group">
<label for="exampleInputEmail1">Telefon</label>
<input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" name="telefon" value="{{$satis->telefon}}" placeholder="Telefon">
<small id="emailHelp" class="form-text text-muted">Ulaşılacak Kişinin Telefon Numarasını Giriniz</small>
</div>
<div class="form-group">
<label for="exampleInputEmail1">E-Posta</label>
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" name="eposta" value="{{$satis->eposta}}" placeholder="E-Posta" required>*
<small id="emailHelp" class="form-text text-muted">Satışı Takip edecek Kişinin E-postasını Giriniz</small>
</div>
<button type="submit" class="btn btn-primary">Gönder</button>
</form>
@endsection
答案 0 :(得分:2)
恕我直言,最好使用asset()
helper来加载资产,例如:
<link rel="shortcut icon" href="{{ asset('dist/img/ico/favicon.png') }}" type="image/x-icon">
<!-- jquery-ui css -->
<link href="{{ asset('plugins/jquery-ui-1.12.1/jquery-ui.min.css') }}" rel="stylesheet" type="text/css"/>
<!-- Bootstrap -->
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet" type="text/css"/>
<!-- Bootstrap rtl -->
<!--<link href="{{ asset('bootstrap-rtl/bootstrap-rtl.min.css') }}" rel="stylesheet" type="text/css"/>-->
<!-- Lobipanel css -->
<link href="{{ asset('plugins/lobipanel/lobipanel.min.css') }}" rel="stylesheet" type="text/css"/>
<!-- Pace css -->
<link href="{{ asset('plugins/pace/flash.css" rel="stylesheet') }}" type="text/css"/>
<!-- Font Awesome -->
<link href="{{ asset('font-awesome/css/font-awesome.min.css') }}" rel="stylesheet" type="text/css"/>
<!-- Pe-icon -->
<link href="{{ asset('pe-icon-7-stroke/css/pe-icon-7-stroke.css') }}" rel="stylesheet" type="text/css"/>
<!-- Themify icons -->
<link href="{{ asset('themify-icons/themify-icons.css') }}" rel="stylesheet" type="text/css"/>
您可以在本SO question中阅读有关href=
的各种相对和绝对URL,最好使用它们。