简体   繁体   中英

Getting frustrated with Laravel 5 blades

For the past couple of days I have been trying to get into Laravel 5 blade system. Yet for some absurd reason I cannot get things to work. Here's how things look now:

UserController -> index

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

So obviously we are getting a view so I create a blade file in views called app.blade.php

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

Alright so we are all set so when I load the page all I get is "Document" in the title.

Here's the rub: if I change the title tag to something else like so:

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

</body>
</html>

And reload the page one would expect to see the title change? Well guess what? Nope. That didn't happen. The original title "Document" is still there.

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

Are you sure it's not just cached? Try this: go to your \\storage\\framework\\views and delete everything except .gitignore file, and try again.

If laravel is caching your view, clearing the browser cache won't help you as the caching is done server-side.

If you are actually using laravel 5.1, you can type on your terminal php artisan view:clear

More info: laravel.com/docs/5.0/cache

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM