Laravel的观点并不奏效

时间:2017-07-03 15:46:05

标签: php laravel routes

这些天我学习Laravel,我的路线不显示观点!!

这是我的代码:

web.php

 Route::get('/', function () {
   return view('welcome');
});
Route::get('/about','PagesController@about');
Route::get('/services','PagesController@services');

PagesController

class PagesController extends Controller
{
    public function about()
    {
        return view('pages.about');
    }

    public function services()
    {
        return view('pages.services');
    }
}

about.blade.php

<!doctype html>
<html lang="{{ config('app.locale') }}">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <title>{{config('app.name','LSAPP')}}</title>

    </head>
    <body> 
        <h1>About</h1>
        <p>This is my About page</p>
    </body>
</html>

PS:我正在使用kubunto和Lamp

感谢你们提前

1 个答案:

答案 0 :(得分:-1)

<!doctype html>
<html lang="{{ config('app.locale') }}">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>{{config('app.name','LSAPP')}}</title>
    <h1>About</h1>
</head>
<body>
 <p>This is my About page</p>
</body>

在您的代码中我没有发现错误尝试将<p>标记放在body标记中...如果不起作用请分享错误你得到的内容..