Home  >  Q&A  >  body text

Why can laravel directly display the content of the controller without a view?

TP3.2 I remember that if I want to display something, I need a view, but laravel can display it without a controller. How did this happen?

Route::get('/', function () {
    return 222;
});
天蓬老师天蓬老师2713 days ago247

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-05-16 16:48:30

    display and view have nothing to do with each other.

    Don’t think about Laravel in terms of TP.

    are all PHP frameworks, as long as echoprintprintfdieexit,... can be output.

    reply
    0
  • Cancelreply