search

Home  >  Q&A  >  body text

laravel5 template variables cannot be parsed

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:

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

某草草某草草2772 days ago514

reply all(1)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-16 16:52:17

    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?

    reply
    0
  • Cancelreply