LoginSignup
0
0

More than 5 years have passed since last update.

【Laravelメモ③】ビュー第一歩

Posted at

前提

【Laravelメモ②】ルーティング/コントローラ第一歩が終わっていること

動作確認

http://localhost:8000/test
でテストページが表示される

手順

コントローラ修正

[PJ]\app\Http\Controllers
<?php

namespace App\Http\Controllers;

use App\User;
use App\Http\Controllers\Controller;

class testController extends Controller
{
    public function test()
    {
-        return 'test';
+        return view('test');
    }
}

ビューファイル作成

[PJ]\resources\views\test.blade.php
<html>
    <head>
        <title>test</title>
        </head>
        <body>
        testbody
        </body>
</html>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0