Home  >  Q&A  >  body text

The default output type is json, how to output html

If 'default_return_type' => 'html', use the json() function in the return of the controller method to specify the output type as json,

Otherwise, 'default_return_type' => 'json', How does the controller specify html as the output type?

jasen_1jasen_11702 days ago985

reply all(1)I'll reply

  • jasen_1

    jasen_12020-03-15 15:12:09

    I just took a closer look at the document and asked myself some questions. public function hello() {         $data = 'Hello,ThinkPHP!';         return response($data);   },

    See the response output chapter.

    reply
    0
  • Cancelreply