Devguide
From No3wiki
This is a draft
[edit]
An introduction to the code
- Handling Pages - describes how pages and functions are handled by the page-handler.
- About Page Handles
- Rendering Pages describes how actuall html-code is generated.
- Basic framework of a page function
- Common Page Elements
- Handling Data - database / form parsing
- submit page function
- adding fields excellent tutorial by Dominic
[edit]
What is necessary to create a form page
- add a new add two pagesHandles to _handles.inc: "testForm" and "testFormSubmit"
- add an appropriate function to the required source-file in pages/
- add a basic framework of a page function "testForm"
- probable add some authentication checks
- add a formBlock with the field-definitions
- define a second submit page function "testFormSubmit" the get the requestData, modifies objects and either jumps back to the from-page, renders it's own page or jumps to another page like "home"
[edit]
Some other hints
- in the submit function your could call printFormVars() to get a overview of the passed fields
- the input-names should start with a meaningfull identifier like "test_"
- prefer new Field_XXX instead of hard coded html-code (this will make your code open for upcomming additional security and consistency-checks)
