View problems encountered when using the Lumen framework

Source: Internet
Author: User
Recently, I downloaded the Lumen package and used {code...} in the controller ...} it is displayed, but {code...} is used in the controller ...} the project is displayed as normal. In resourcesviews, there is a user. balde. php. I wonder if anyone is reading Lumen recently...

Recently, I downloaded the Lumen package and used it in the controller.

return view('user');

Show

But in controller

return view()->file('..\resources\views\user.blade.php');

The project is displayed as normal.
In

Resources \ views contains user. balde. php

I wonder if anyone is reading Lumen recently. Could you tell me why this View can be used only when I specify a path?

Reply content:

Recently, I downloaded the Lumen package and used it in the controller.

return view('user');

Show

But in controller

return view()->file('..\resources\views\user.blade.php');

The project is displayed as normal.
In

Resources \ views contains user. balde. php

I wonder if anyone is reading Lumen recently. Could you tell me why this View can be used only when I specify a path?

I think the landlord should have switched from laravel4 [L4 for short.
What is written on L4?View::make('user').
On lumen, view () is a help function,
If no parameter exists, the system returns the newly created instance of the View class.
So you can writereturn view()->make('user').
Then, in the official manual,return view('user'),
This statement is also supported, so it should be a BUG,
Install the latest version ~composer update

First Choice statement, I have not actually used this lumen ha

I'm curious where you can see the file name in the form of "user. blade. php ".view("user")Insteadview("user.blade")

You can try echoview()->exists('user.blade')See if you can find

The namespace does not seem to be provided in lumen.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.