Introduction
This tutorial is a continuous to [Tutorial] Pakai framework v6I assume you already have the default project successfully running on development.
In this tutorial, we will continue to work with 2 libraries, MiniHtml and MiniORMUtils.
Let's Start
- So far, we have 2 entities or I will call them models. They are Categories and Products.
- Let's leave Categories as it is.
- We will remove Products and create a new model call Articles.
- You can name it as Posts if you like but I don't want to confuse with the HTTP POST method.
- Right click on the ProductsHandler and click Remove.
- Then we right click on the Handlers group and add a Server Handler.
- Give it a name ArticlesHandler and click Ok.
- You will see a new handler class is created.
- Inside Class_Globals sub, start typing pakai until you see a dialog pops up showing the (code snippets) Pakai handler Globals v6.00.
- Press enter and you will get the code added as showed below.
- Now delete the code after line #9.
- Start typing pakai again and this time we select the second code snippet.
- Now there are more code added for you and the word plural is highlighted in amber colour.
- Press Backspace and type the word articles. Press Tab to go to next highlighted word.
- Press Tab and now it is highlighting on the word Model.
- Change it to Articles and press Tab.
- Press Tab to skip on the word SERVER_URL.
- Similarly, change the dbtable to tbl_articles and singular to article.
- When the cursor returns to top of page, you know you can confirm the changes by pressing Enter.
- Now you have a new server handler for Articles.