jquery - Laravel returning view -


what difference between,

return view::make('hello'); 

and

return view('hello'); 

and

return 'hello'; 

they produce same output why 3 syntaxes?

actually, examples bit different.

view() helper function operating view::make(). doing way, don't have use view; @ top of controller (or service class) in manner. behind scenes laravel make view instance , populate arguments passed in. in example, hello.blade.php.

returning 'hello' different because there no blade file involved , passed string passed response object directly.

check out these links, api. can helpful.

https://laravel.com/docs/5.1/helpers#method-view

https://laravel.com/api/5.1/illuminate/view/view.html


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -