Directory Structure
Directory Structure
Perhaps I made a mistake initially with copying over the downloaded DT+Editor package and placing my application in the main DT folder. I'm pretty sure I've duplicated some folders and I question now whether some of the changes I thought I made were really on the right files.
So, I have DT-1-10.4, Editor-1.3.3, Editor-1.4.0-beta, and all the extensions although currently I may only be using TableTools.
In my other projects I typically create a media folder and within that I have a CSS, JS, and images directories. My directory structure looks like this:
DataTables-1.10.4
->[examples]
->[extensions]
->->[Editor-1.3.3]
->->[Editor-1.4.0-beta]
->->[other extension folders]
->->[TableTools]
->[media]
->->[css]
->->[images]
->->[js]
->[php]
->->[Database]
->->[Editor]
->->[Ext]
->->[lib]
Bootstrap.php
config.php
DataTables.php
my application php files
index.html
I need to trace through to see how all the file calls are but I thought it wouldn't hurt to post here first and see what others are doing or what I really should be doing when I release an app.
Thanks,
George
Answers
When you release an app, the best thing to do is to concatenate all of the CSS and JS files into a single file for each type so the browser only has a single file to load.
Beyond that, the file structure is really up to you! The DataTables distribution file structure isn't always ideal for deploying apps, like you I like a
media/css
andmedia/js
directory for the file types.I'm going to be creating a download builder for DataTables and its extensions later this year which will help to solve the problem of there being so many different DataTables files and extensions - just pick what you want, the styling base (Bootstrap, etc) and click a button - it will create the files for you. A few other things to do first, but that is very much on the roadmap.
Allan
I just wasn't too sure without digging into everything if other extensions had dependent directory structure. I see that when you include DataTables.php it expects Bootstrap.php to be in the same directory but then Bootstrap looked down 2 levels for other required files.
I just hadn't run across anything in the manual that said how files were organized.
Ah yes - the PHP file structure for the Editor libraries is fixed. It uses a PHP autoLoader based on the class name to load the files in a modular fashion. The Javascript, etc, however do not have that same requirement.
Allan