Why in laravel, return "xxx"; will directly return xxx and output it to the current page. And return "xxxx" in php will not output anything on the page. Are they the same method? How can I use PHP's original return method in Laravel without outputting content on the page?
In Laravel, the page is not output just because you return, the returned things need to be sent out through the
Response
,再通过它的send
method.
composer intasll can download half of the Internet
Looking at the Laravel source code, the answer lies in the SymfonyComponentHttpFoundationResponse class
The entry file calls a $response->send() method
Then look at the sendContent() method
I see here that echo is still used