19 Dec 2011 4:44 PM #1
Unanswered: Different App directory For different pages or use the same directory structure
I am currently converting a page to the new MVC architecture. I am wondering the best practice for different pages. The MVC tutorial has a top namespace that refers to that one page. Does that mean that I should create a new MVC directory structure for each different page or can I use the same directories. If it is the latter, how do I deal with namespace issues when I want to reuse components from a different page.
20 Dec 2011 5:07 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
This is more about code organization as the filesystem should follow your class names exactly (case sensitive).
Lets say we are making an email program with an email list screen, a contact list screen and a compose screen. You could organize your code like this (class names):
Then your filesystem for these would be like:
------List.jsMitchell Simoens @LikelyMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services firstname.lastname@example.org
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
20 Dec 2011 12:02 PM #3
Actually it's a bit different of a problem. So the source files are mapped to servername/static. However, I am getting 404s because the library files are being requested at the servername/beta/advertiser/ which is the root of this particular application. How do I get the libraries to be requested at servername/static?
21 Dec 2011 2:59 PM #4
Okay, I have been looking at this problem a little more and can articulate it better. My problem is that my libraries do not map to a subdirectory of the url that is called.
So if I have the url mapped to /x/y/z/application,
but my static files are mapped to /static/x/y/z/application how can I get the libraries included.
22 Dec 2011 11:06 PM #5
If I've understood your question correctly, perhaps these might help?
You can use them to specify exactly which URL (absolute or relative) is the root URL for a particular package.