このページの翻訳:
- 日本語 (ja)
- English (en)
最近の更新
Tag Cloud
このページへのアクセス
今日: 5 / 昨日: 4
総計: 368
- Dokuwiki.fl8.jp(86)
- DokuWiki(51)
- 13 CentOS6メール設定(29)
- 30 React-admin(21)
- FreeBSD カーネル再構築(21)
- tcで帯域制限(htb)(20)
最近の更新
このページへのアクセス
今日: 5 / 昨日: 4
総計: 368
$ 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>