Integrate Ext JS 4.1 MVC application into the rewrite URL (mod_rewrite) during development and production

Creating a new Ext JS 4.1.1 application based on the file structure section in Sencha MVC Application Architecture Guide As a result, I get this structure:

/wwwroot
    /myapplication
        /app
            /controller
            /view
        app.js
    /extjs-4.1.1

The app.js file contains:

Ext.Loader.setConfig({
    enabled: true
});

Ext.application({
    appFolder: '/myapplication/app',
    autoCreateViewport: true,
    name: 'MyApplication',
    controllers: [
        ...
    ]
});

All perfectly. Then I include app.js for output to my server-side MVC application (not to be confused with the client-side structure of external MVS JS). The language used and the structure of the server application do not matter for this question, but the result of the output. In development, the application URL:

http://servername/someidentifier1/someidentifier2

, mod_rewrite , URL- . "" . URL-:

<!DOCTYPE html>
<html>
<head>
<title>MyApplication</title>
<link href="/extjs-4.1.1/resources/css/ext-all-debug.css" media="screen" rel="stylesheet" type="text/css" >
<script type="text/javascript" src="/extjs-4.1.1/ext-debug.js"></script>
<script type="text/javascript" src="/myapplication/app.js"></script>
</head>
<body>
</body>
</html>

Ext JS , /wwwroot/myapplication/extjs -4.1.1, , . app.js , , appFolder , " " URL-.

, "" Sencha SDK Tools ( 2.0.0 Beta 3 Windows). . :

  • /wwwroot/myapplication.
  • sencha create jsb -a http://servername/someidentifier1/someidentifier2 -p myapplication.jsb3, jsb3.
  • sencha build -p myapplication.jsb3 -d .

. , , . c: \...\myapplication\myapplication\app\controller: + appFolder. , , (shared) extjs-4.1.1.

, Ext JS MVC SDK Tools , . , : Ext JS 4.x(Ext JS MVC) URL (mod_rewrite) ?

/ .

:

  • jsb3.
  • extjs-4.1.1 .
  • app.html, MVC .
  • app.js HTML, .
+5
3

.

ExtJs .

...
appFolder: 'app' // should be enough
...

- - - .html - index.html index-dev.html. ( ), .

index-dev.html , , . .

index.html .js .

0

mod rewrite, .htaccess Symfony

<IfModule mod_rewrite.c>
    RewriteEngine On

    #<IfModule mod_vhost_alias.c>
    #    RewriteBase /
    #</IfModule>

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>

  • , (css, js, images ..).
  • URL- , .

, app.php

, , :

0

Creating an index.html file to create a project file will be a way. I also found that Sancha's architect is very tough and easy to use. The most annoying thing is that I cannot use an external editor to edit the generated code. Everything should be done in the designer, and it’s great if the designer can provide any functionality I need. But he cannot.

0
source

All Articles