Could someone please explain to me the correct file structure of a Symfony2 MVC and ExtJS4 MVC project? (When used together!)
-
For Symfony2 you can take a look at: symfony.com/doc/current/book/installation.html and symfony.com/doc/current/book/page_creation.html as well as the quick tour: symfony.com/doc/current/quick_tour/the_big_picture.htmligorw– igorw2011-06-06 11:14:29 +00:00Commented Jun 6, 2011 at 11:14
2 Answers
Your ExtJS files should be placed in the Resource/public folder of your Bundle
YourBundle/
Resources/
public/
images/
css/
js/
extjs/
app/
You can use the assets:install command-line command to install it in the web-folder afterwards. You can use Assetic thats included to the Symfony Standard Edition to take care of your JS-Files too.
2 Comments
Refer to the heading "Root Tree Structure" of The Definitive Guide to Symfony for the structure of an Symfony application. Quoting from the documentation:
Only the files and scripts located under the web root (the web/ directory in a symfony project) are available from the outside. The front controller scripts, images, style sheets, and JavaScript files are public. All the other files must be outside the server web root--that means they can be anywhere else.
So, you should put you ExtJS code in the web/ directory. You can have a folder structure like this:
web/
css/
images/
js/
extjs/ --> ExtJs Library
app/ --> ExtJs MVC application
uploads/
The app folder will contain the ExtJS MVC structure. Refer to MVC Architecture guide for the folder structure of an ExtJS MVC application.