Use php to develop app interfaces !!!

Source: Internet
Author: User
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.

YII2OfrestfulYou 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 ),resetfulOnly four or five lines of code are required.curdOfApiIt'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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.