このページの翻訳:
- 日本語 (ja)
- English (en)
最近の更新
Tag Cloud
このページへのアクセス
今日: 3 / 昨日: 4
総計: 366
- Dokuwiki.fl8.jp(26)
- DokuWiki(22)
- FreeBSD カーネル再構築(12)
- 30 React-admin(11)
- 29 Next.js(11)
最近の更新
このページへのアクセス
今日: 3 / 昨日: 4
総計: 366
$ php artisan make:controller HelloWorld $ ll app/Http/Controllers/HelloWorld.php -rw-r--r-- 1 matsui users 117 Mar 19 16:36 app/Http/Controllers/HelloWorld.php
app/Http/Controllers/HelloWorld.php
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; class HelloWorld extends Controller { public function hello() { $hello = 'Hello World.'; $hello_array = ['aaa','bbb','ccc']; return view('hello', compact('hello', 'hello_array')); } }
routes/web.php
Route::get('/hello','HelloWorld@hello');
resources/views/hello.blade.php
<!-- resources/view/contact.blade.php -->
<!DOCTYPE HTML>
<html>
<head>
<title>contact</title>
</head>
<body>
<h1>{{$hello}}</h1>
@foreach ($hello_array as $h)
{{$h}}
@endforeach
</body>
</html>