http://localhost/hello
に行くと
ReflectionException Class App\Http\Controllers\Response does not exist
このエラーが起きます、、、。
なぜエラーが起こるのでしょうか、、、。
これで2時間迷っています、、、。
どなたか助けてください。
HelloController.php
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; class HelloController extends Controller { public function hello(Request $request, Response $response){ $html = <<<EOF <html> <head> <title>Hello/Index</title> <style> body { font-size:16pt; color:#999; } h1 { font-size:120pt; text-align:right; color:#fafafa; margin:-50px 0px 120px 0px; } </style> </head> <body> <h1>Hello</h1> <h3>Request</h3> <pre>{$request}</pre> <h3>Response</h3> <pre>{$response}</pre> </body> </html> EOF; $response->setContent($html); return $response; } }
web.php
<?php /* |-------------------------------------------------------------------------- | Web Routes |-------------------------------------------------------------------------- | | Here is where you can register web routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | contains the "web" middleware group. Now create something great! | */ Route::get('/', function () { return view('welcome'); }); Route::get('hello', 'HelloController@hello');
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。