简体   繁体   English

在Symfony2中创建移动应用

[英]Creating mobile app in Symfony2

I read that there is an option to create a mobile app in symfony2 and I don't really understand how to create it. 我读到可以在symfony2中创建移动应用程序,但我不太了解如何创建它。 As much as I do understand the concepct of emulating HTML5 to native app I don't know HOW to do the same thing with symfony. 尽管我确实了解将HTML5模仿为本地应用程序的概念,但我不知道如何用symfony做同样的事情。

Lets say that we created the app in html5. 可以说我们是用html5创建的应用程序。 We just go through the process with PhoneGap and it creates the native app ( yeah, I know, very simplified ). 我们只是使用PhoneGap进行了整个过程,它创建了本机应用程序(是的,我知道,非常简化)。 But how should I do it with Symfony? 但是我应该如何用Symfony做到这一点? I mean.. is there any similar emulator for php and...all the files that symfony contains or.. or what? 我的意思是..是否有适用于php的类似模拟器以及... symfony包含的所有文件或..或什么? How to make it work on iOS, how on Android, how on Windows Phone and BlackBerry.. 如何使其在iOS上运行,如何在Android上,在Windows Phone和BlackBerry上运行。

Sorry for dumb question but I couldn't find proper answer. 抱歉,您的问题很愚蠢,但我找不到正确的答案。

No questions are dumb when it's asked in real sense :) 当被真正问到时,没有问题是愚蠢的:)

Web App is different from Mobile App. Web App与Mobile App不同。

Symfony is a PHP framework and its no where realted to Phonegap/Cordova. Symfony是一个PHP框架,不适用于Phonegap / Cordova。 PhoneGap/Cordova uses HTML, CSS and some javascript. PhoneGap / Cordova使用HTML,CSS和一些javascript。 You can use some PHP for some backend services but not for the app itself. 您可以将PHP用于某些后端服务,但不能用于应用程序本身。

So my final point would be you can not use Symfony to create a phonegap app. 所以我的最后一点是,您不能使用Symfony创建一个phonegap应用程序。

IMHO, symfony provides a solid framework for HTTP and restful API through which jQuery mobile can be configured and then if you extend TWIG for a template, then Symfony acts as the bundler and composer through with routing can take place. 恕我直言,symfony为HTTP和Restful API提供了一个可靠的框架,通过它可以配置jQuery mobile,然后如果您为模板扩展TWIG,则Symfony可以充当捆绑器和作曲者,并可以进行路由。 While Symfony does not run native apps, they need to retrieve and store data and on that front a framework such as Symfony works well. 尽管Symfony不运行本机应用程序,但它们需要检索和存储数据,并且在此方面,像Symfony这样的框架可以很好地工作。 So one could argue that one could use APIs for multiple clients (iOS, Android and more) and then reuse controllers and use formats to generate XML/JSON thus theoretically it should work with Phonegap too. 因此,有人可能会争辩说可以将API用于多个客户端(iOS,Android等),然后重用控制器并使用格式来生成XML / JSON,因此从理论上讲,它也应与Phonegap一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM