search

Home  >  Q&A  >  body text

Can the name of view in laravel contain dots?

I have seen many tutorials. When naming the view, they all use a writing method similar to user.index. I have a view. The file name is user.index.blade.php. In the controller, I use return view('user. index'); prompts View [user.index] not found.

If you change it to user_index.blade.php and call it using return view('user_index');, there will be no problem.

Is there any way to use dots to separate names?

大家讲道理大家讲道理2756 days ago320

reply all(1)I'll reply

  • 某草草

    某草草2017-05-16 16:58:02

    Okay, I’ve done it myself, return view('user.index'); There is no problem with this syntax, but it does not mean that the file name should be written as user.index.blade.php, but index.blade.php, and It should be placed in the resources/views/user directory.

    reply
    0
  • Cancelreply