pat*_*cha 3 php laravel laravel-5
当我将.php文件更改为.blade.php时出错.在我改变它之前得到了这个错误.
Route::get('hello','HelloController@index');
Run Code Online (Sandbox Code Playgroud)
为HelloController
public function index()
{
$data = array(
'name' => 'Rakesh',
'email' => 'sharmarakesh395@gmail.com');
return View::make('hello.index')->with('data', $data);
}
Run Code Online (Sandbox Code Playgroud)
/public/hello/index.blade.php
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Laravel 5.3 - Home page</title>
</head>
<body>
<h1>Welcome Hello index </h1>
<h1>{!!$data!!}</h1>
<h1>{!!$data['email']!!}</h1>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
错误
The requested resource /hello was not found on this server.
Run Code Online (Sandbox Code Playgroud)
小智 14
当您在公用文件夹中创建与路由相同名称的文件夹时,会发生该错误,因此请更改放置在公用文件夹中的文件夹的名称,以使其与路由名称不同,这可能会解决您的错误
| 归档时间: |
|
| 查看次数: |
6450 次 |
| 最近记录: |