我是 laravel 的新手,想学习 BLADE,但有一个问题让我很震惊。我有一个
index.blade.php
@layout('master')
我也有一个
master.blade.php
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Laravel: A Framework For Web Artisans</title>
<meta name="viewport" content="width=device-width">
</head>
<body>
hi from body
</body>
</html>
问题是,当我尝试调用 index.blade.php 时,它会给我一个错误提示
Unhandled Exception
Message:
View [master] doesn't exist.
Location:
C:\xampp\htdocs\laravel-laravel2\laravel\view.php on line 170
Stack Trace:
#0 C:\xampp\htdocs\laravel-laravel2\laravel\view.php(107): Laravel\View->path('master')
#1 C:\xampp\htdocs\laravel-laravel2\laravel\view.php(218): Laravel\View- >__construct('master', Array)
#2 C:\xampp\htdocs\laravel-laravel2\laravel\helpers.php(526): Laravel\View::make('master', Array)
#3 C:\xampp\htdocs\laravel-laravel2\laravel\view.php(386) : eval()'d code(2): view('master')
#4 C:\xampp\htdocs\laravel-laravel2\laravel\view.php(386): eval()
#5 C:\xampp\htdocs\laravel-laravel2\laravel\blade.php(71): Laravel\View->get()
#6 [internal function]: Laravel\Blade::Laravel\{closure}(Object(Laravel\View))
#7 C:\xampp\htdocs\laravel-laravel2\laravel\event.php(199): call_user_func_array(Object(Closure), Array)
#8 C:\xampp\htdocs\laravel-laravel2\laravel\event.php(138): Laravel\Event::fire('laravel.view.en...', Array, true)
#9 C:\xampp\htdocs\laravel-laravel2\laravel\view.php(348): Laravel\Event::until('laravel.view.en...', Array)
#10 C:\xampp\htdocs\laravel-laravel2\laravel\view.php(590): Laravel\View->render()
#11 C:\xampp\htdocs\laravel-laravel2\laravel\response.php(268): Laravel\View->__toString()
#12 C:\xampp\htdocs\laravel-laravel2\laravel\laravel.php(180): Laravel\Response->render()
#13 C:\xampp\htdocs\laravel-laravel2\public\index.php(34): require('C:\xampp\htdocs...')
#14 {main}