作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
这是我的路线文件...
Route::group(['middleware' => ['auth']], function(){ Route::get('/profile/{username}', 'ProfileControllers@getProfile'); });
“ProfileControllers”是这个...
namespace App\Http\Controllers; use DB; use App\User; use Illuminate\Http\Request; class ProfileControllers extends Controller { public function getProfile($username) { $user = DB::table('users')->where('username','=', $username)->get(); return view('web.profile'); } }
这是 View 文件...
@extends('layout') @section('content') This is your profile @stop
布局文件的头部是这个...
link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" link rel="stylesheet" type="text/css" href="css/app.css"
当我转到 url "localhost:8000/profile/username" 时,显示了一个没有任何 css 网页的丑陋 html...当我从路由文件中删除“/{username}”,并将其设为“/profile/username”并转到“localhost:8000/profile/username”(并删除 $username 部分形成 Controller )时,然后是 css 和 Bootstrap 完美加载....
最佳答案
我通过简单地在链接前面加上'/'解决了这个问题
link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css"
link rel="stylesheet" type="text/css" href="/css/app.css"
关于php - 为什么 css 和 bootstrap 没有在 Laravel 5.3 中加载?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39944299/
我是一名优秀的程序员,十分优秀!