File Structure

Tequila uses and recommend you to keep a simple file structure

- Not required (We store the DB script here)

<- Your application and packages

<- Your application (The PHP part)

<- Code that handle user interaction

<- Data Access Objects (one per table) <- Your model

<- All the views, not templates but PHP pages that manage them

<- Value objects, think of them as data structures (one per table)

<- Reusable code, login, etc.. (Can download, exchange, make..)

<- Container for language resources

<- English language files, add any you need <- Container for your templates

<- Default template

<- Resources of your template . .

Where do I need to place my files or register them so they work?

Anywhere, In Tequila you can drag and drop files in any folder and thanks to the fantastic script c_square by Tobias Demuth (under includes/) files are automatically located.

However we strongly recommend you to follow the directory structured to keep your application clean and organized.

Where is the right location to place my files?

app/filetype , place them according to type to make it easier for you and your team.

I made a set of classes that I use all the time, where shall I put them?

We recommend you to create a package, if you require any configuration move it to config.php and place all your files inside includes/packages/yourownpackage

Shall I create all folders inside my package or put them together?

It depends on you, we like organized applications so we recommend to create the controllers/dao/model etc.. folders

I'm maintaining a Tequila application and cannot find the class I need, how to do it?

If a PHP class was misplaced or put in a package you can try the last way of finding it, Open cache.inc.php in the root of your application, there is an array that caches the location of every class.

What about 0F3_common?

To reuse code modifications and avoid file duplication we tweak c_square class to be able to locate classes in an alternative secondary location. This directory contains all the Core classes of the framework, you can also place your packages under this directory to avoid the need of copying and maintaining many locations