Php in phone gap application

喜欢而已 提交于 2020-01-30 08:18:04

问题


We have to develop an application with more plattform. We would use the framework PhoneGap. For our application we need services of backend, the question is: Does PhoneGap support PHP?

If it doesn't support PHP. In which way we can solve the problem?

The most important thing is: make call server (Get and Post), parsing a json and other functions that PHP gives.


回答1:


Phonegap does not have a server. You need to call via Ajax to remote servers.




回答2:


The backend can be in any language which supports HTTP calls, as PhoneGap is an independent client.

You can use PHP to write an API for use within your Javascript PhoneGap application.

I can recommend the Laravel framework to accomplish this.




回答3:


Yes...you can use PHP or any PHP framework to give backend for mobile app made using phonegap/cordova....point is phonegap/cordova app will be on client mobile which won't understand PHP embedded in phonegap html files....so write an API amd place it on a server and then make AJAX calls to server to do database and other backed operations

Try to return JSON data from the PHP API.....it's a famous data structure and supported by many applications



来源:https://stackoverflow.com/questions/22785948/php-in-phone-gap-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!