Have you used php to write the phper interface on the app? I don't have any decent code. I can only write it myself. Have you ever used php to Develop interfaces and have written standardized and mature code, please read it and provide guidance. Thank you !!! I have written some tool methods. Is the code sharing address www. OS... used?
PhpWrite
App write InterfacePhper, I don't have decent code. I can only write it myself. Have you ever used php to Develop interfaces? Have you ever written standardized and mature code? Please read it and ask for guidance, thank you !!!
I wrote some tool methods, code sharing address http://www.oschina.net/code/snippet_2408014_49992 deficiencies, please point out...
Reply content:
Is it used?PhpWriteApp write InterfacePhper, I don't have decent code. I can only write it myself. Have you ever used php to Develop interfaces? Have you ever written standardized and mature code? Please read it and ask for guidance, thank you !!!
I wrote some tool methods, code sharing address http://www.oschina.net/code/snippet_2408014_49992 deficiencies, please point out...
User Logon
Function login (){
// Receives the equivalent username and password. Generally, the post request is used, and then the database is queried for judgment.
.....
....
// Determine based on the status. If the logon succeeds, or the account or password is incorrect, or the user has been disabled, if 1 is set to successful, or the account or password is incorrect
// If successful
$ Result ['status'] = 1;
$ Result ['msg '] = "Logon successful ";
// Else failed
$ Result ['status'] = 2;
$ Result ['msg '] = "account or password failed ";
Finally, return jsonecho json_encode ($ result, JSON_UNESCAPED_UNICODE );
}
// Then hand it over to the client to make a judgment based on the returned json value.
// It is not very good. It is for reference only.
The first pitfall: detailed tutorials will be provided later
Tentative is the use of Lumen: http://lumen.laravel.com/
The interface development style is restful.
YII2
Ofrestful
You deserve it.
======
I don't know how to use PHP. I recommend this php framework because the code can be generated with one click (of course, you need to modify it as needed ),resetful
Only four or five lines of code are required.curd
OfApi
It's coming out.
Recommended article: Understanding the RESTFul Architecture
With a good volume of APP developers, and clear development requirements
In my opinion, the interface for writing an app is not very different from the interface for writing a web. The server provides an address for the client to obtain, as long as the parameters from the client and the format of the data returned by the server are determined. Apps have stricter requirements than web applications. signature verification is required.
I have written some methods, source code sharing address, welcome to big brother guide http://www.oschina.net/code/snippet_2408014_49992