Tutorial: Adding categories page
Let's start by checking where files are located in Tequila, then we will add one page at a time, manually so you really get familiar with it, later on we will show you how to make it automatically (final release only)
Files location
First thing I like knowing when I use any platform or framework is where to find the files and resources that I need, so here you go:
- 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 . .
Ok, that was quite exhausting, so what makes a complete page?
Files
A normal page is made of.
For each database table:
Very important: To allow drag and drop of classes the name of the file and the name of the class must be the same
Do i have to follow this structure?
You can actually drag and drop the classes anywhere you want, but keeping this structure will help you work and exchange code. When you detect more than one application uses the same classes you can create a package and move the code to the packages folder, then you can decide if you keep the files split in model, view, controller or just put them all in the package root.
Categories functionality
For this example we are making full CRUD pages, Create, Read, Update and Delete, we will of course add Browse and other usefull methods