laravel5 template variables cannot be parsed
某草草
某草草 2017-05-16 16:50:17
0
1
491

I just installed laravel 5.3, set a template variable, and displayed it in the template, but it doesn't work. The code is as follows:

  • routing

Route::get('/', function () {
    return view('index',['msg'=>'hello world']);
});
  • template

{{ $msg }}
  • Web page effect

  • Question
    Where is the problem? I followed the documentation, but it just doesn’t work. But using native PHP code in the template works: <?php echo $msg; ?>

某草草
某草草

reply all(1)
过去多啦不再A梦

It seems like your template file is not parsed using the Blade engine.
Are you sure your template file has .blade.php as the extension?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template