对 Laravel 5 个刀片感到沮丧

Getting frustrated with Laravel 5 blades

在过去的几天里,我一直在尝试进入 Laravel 5 blade 系统。然而,出于某种荒谬的原因,我无法让事情正常进行。现在是这样的:

用户控制器 -> 索引

public function index()
{
    return view('app');
}

很明显我们得到了一个视图,所以我在名为 app.blade.php

的视图中创建了一个 blade 文件
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
</body>
</html>

好的,我们都准备好了,所以当我加载页面时,我得到的只是标题中的 "Document"。

难点在于:如果我将标题标签更改为其他内容,例如:

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Application</title>
</head>
<body>

</body>
</html>

并重新载入您希望看到标题更改的页面?你猜怎么着?没有。那没有发生。原标题"Document"还在

Someone want to tell me whats going on here and how to fix it?

你确定它不只是被缓存了吗?试试这个:转到 \storage\framework\views 并删除除 .gitignore 文件之外的所有内容,然后重试。

如果 laravel 正在缓存您的视图,清除浏览器缓存对您没有帮助,因为缓存是在服务器端完成的。

如果您实际使用的是 laravel 5.1,您可以在终端上输入 php artisan view:clear

更多信息:laravel.com/docs/5.0/缓存