In this tutorial we will review how to create a really fast applications using Tequila framework, we will use the same DB as in First tutorial, but you can use the following techniques with any other DB We assume:
If you haven't done all this, just follow the installation page instructions Let's get started 1. Add application tables to the DB.Using your favorite db tool (PHPmyAdmin, SqlYog, command line) execute this script. DROP TABLE IF EXISTS T_RECIPES; DROP TABLE IF EXISTS T_CATEGORIES; CREATE TABLE T_CATEGORIES ( I_IDCATEGORY int NOT NULL AUTO_INCREMENT, I_NAME varchar(100) NOT NULL DEFAULT '', PRIMARY KEY(I_IDCATEGORY) ) engine=InnoDB;; CREATE TABLE T_RECIPES ( I_IDRECIPE int NOT NULL AUTO_INCREMENT, I_IDCATEGORY int NOT NULL, I_TITLE varchar(100) NOT NULL DEFAULT '', I_DESCRIPTION varchar(255) NULL, I_DATE date NULL, I_INSTRUCTIONS text NULL, CONSTRAINT fk_r_c foreign key (I_IDCATEGORY) references T_CATEGORIES(I_IDCATEGORY), PRIMARY KEY(I_IDRECIPE) ) engine=InnoDB; 2. Browse to addpageURL: yourproject/Project1/index.php?task=addpage * If you give write permissions to the Project1 folder the application should show no errors. This is the welcome page of Tequila generator "sunrise". *If you want to edit the details of each page keep reading, if you want to generate the application in one click go to the end of this document On this page:
* You don't need to push any button to save this is a session setting Click on the Table relations link at the top Menu. On this tab you can see the relation between categories and recipes. For this tutorial we don't need to change anything. * You can also modify and add relations on this page, this will not modify the DB definition but inform Sunrise of the data relation. We strongly recommend you to capture all your data relations in this page. 4. Create Recipes PageFollow steps as shown in the illustration.
5. Create Categories PageCategories page it's easier, just:
6. Review your hard work!At this time, your pages have been generated and all the settings you changed saved, if you need to make further changes to this pages, just repeat steps 1,2View your results:
Using RIA's Mashups, XML, Json?Try adding this "rrt" (requested response types) to the url in any method (view, Browse are nicer to test)
Regenerating your pages?Don't worry, the generator makes an MD5 check of all the files, if there is any changes in between the page you are generating and the one stored it will backup the existing file adding the date and time to the name. Faster? You don't need details?Maybe you just need a mockup or you don't need to select controls and extra validation.
|




