Please kindly advise how the process is. if TP5 is straight in the method and return is used, relevant content will be output on the interface. how can this be achieved?, and ask for advice. Note: You may think the problem is very simple, but I really don't know, so please. I want to know the execution process and method behind it. Please kindly advise how the process is. if TP5 is straight in the method and return is used, relevant content will be output on the interface. how can this be achieved?, and ask for advice.
Note: You may think the problem is very simple, but I really don't know, so please. I want to know the execution process and method behind it.
Reply content:
Please kindly advise how the process is. if TP5 is straight in the method and return is used, relevant content will be output on the interface. how can this be achieved?, and ask for advice.
Note: You may think the problem is very simple, but I really don't know, so please. I want to know the execution process and method behind it.
Previously usedTP3.2, Changed5.xLater, I also found this and briefly looked at the source code.
The execution process is as follows:
-
index.php
require __DIR__ . '/../thinkphp/start.php';
-
start.php
App::run()->send();
-
App.php
$type = $isAjax ? Config::get('default_ajax_return') : Config::get('default_return_type');$response = Response::create($data, $type);
-
Json.php(Assume thatdefault_ajax_returnIsjson)
$data = json_encode($data, $this->options['json_encode_param']);
-
Respone.php
Send ()-> call $ this. output ();-> call the output method of Json. php.
I have not read the source code. I guess it is to call a method, get the return value, and then output ......