PDA

View Full Version : Using absolute Path to include Controller (.js File)



mik3e
20 Jan 2012, 11:30 PM
Hi there,

I'm using ExtJS together with Zend Framework. In the framework I´m using a route where the requested language is included (eg. http://www.domain.com/en/content).

For that reason I have to include all my Javascripts and CSS with an absolute path, otherwise (cause of the routing rules), the client would look in /en, /de etc. for the files and can´t find them.

That was not a big problem at all, till I started to integrate ExtJS in the project.

The problem:
How am I able to definde, that all classes (especially controller) should be loaded via an absolute path!?

Here is my example from the ExtJS Tutorial - the bootstrap file (app.js):

/**
* ExtJS Bootstrap
*/
Ext.application({
name: 'LT',

appFolder: 'app',

controllers: [
'Users'
],

This results in the following client side output:

<script type="text/javascript" src="en/app/controller/Users.js?_dc=1327131001512"></script>

But what I need that it works is the following reference:

<script type="text/javascript" src="http://www.domain.com/app/controller/Users.js?_dc=1327131001512"></script>

So is there a chance to declare a "Root URL" in the bootstrap and that ExtJS should use absolute pathes for loading external files?

Thank you in advance for your help guys,
Cheers,
Mike

mitchellsimoens
23 Jan 2012, 12:01 PM
Check out the appFolder config in Ext.application. You can set it to 'http://www.domain.com/app'

mik3e
23 Jan 2012, 12:15 PM
Hi,

Thanks - that´s it! :)

Cheers,
Mike