Sencha Touch&桌面和移动设备的ExtJS配置文件在一个Web项目/ vhost中? [英] Sencha Touch & ExtJS profiles for desktop and mobile in one web project/vhost?

查看:67
本文介绍了Sencha Touch&桌面和移动设备的ExtJS配置文件在一个Web项目/ vhost中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ExtJS和Sencha Touch创建一个包含桌面和移动版本的Web应用程序。

I'm creating a web application with desktop and mobile versions using ExtJS and Sencha Touch.

ExtJS 4和Sencha Touch 2使用MVC方法和Sencha Touch 2包含不同设备(iPhone,平板电脑等)的配置文件。

ExtJS 4 and Sencha Touch 2 use an MVC approach, and Sencha Touch 2 incorporates "profiles" for different devices (iPhone, tablet, etc.).

然而,ExtJs 4没有配置文件的概念。在同一个应用程序目录层次结构中,桌面,iPhone和iPad版本的应用程序依赖于一个虚拟主机是否真的可行?

ExtJs 4, however, has no notion of profiles. Is it realistically feasible to for dependencies for desktop, iPhone, and iPad versions of the app to live under one vhost, in the same app directory hierarchy?

或者,是吗?在处理Sencha框架时,通常更容易为桌面(app.com)和移动网站(m.app.com)使用不同的虚拟主机吗?

Or, is it generally more acceptable to use different vhosts for desktop (app.com) and mobile sites (m.app.com) when dealing with the Sencha frameworks?

推荐答案

我最近遇到了同样的情况。我有一个c#控制器,它根据useragent返回桌面或移动index.html。它全部显示为 http://www.mydomain.tld 并在单个IIS站点下运行。由于所有调用都是AJAX到REST,因此它们共享相同的服务器代码。这只是改变的观点。任何其他服务器和语言也可以这样做。

I recently had the same situation. I have a single c# controller that returns the desktop or mobile index.html based on useragent. It all appears as http://www.mydomain.tld and runs under a single IIS site. Since all the calls are AJAX to REST, they share the same server code. It's only the view that changes. The same could be done with any other server and language.

我的结构是:


Root
 |_desktop
 |   |_app
 |   |_lib
 |   |_resources
 |_mobile
 |   |_app
 |   |_lib
 |   |_resources
 |_shared
     |_localization.js (generic JS objects)
     |_proto.js (my generic prototype functions)

这篇关于Sencha Touch&桌面和移动设备的ExtJS配置文件在一个Web项目/ vhost中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆