Can the name of view in laravel contain dots?
大家讲道理
大家讲道理 2017-05-16 16:56:02
0
1
318

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?

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(1)
某草草

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.

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