User Interface Templates
From FreemedDeveloperWiki, the FreeMED developers' Wiki.
'User Interface Templates are XML which are meant to represent the UI logic of modules and other forms in FreeMED, so that they can be both used on third party (handhelds, etc) devices as well as abstracted from the main PHP code.
| |
Flow
- A module or page calls the UiFormTemplate class, which starts the form build.
- Determine the name of the template which would be used. This would be in the format (lowercase): modulename_action.xml or pagename_action.xml
- Get the MD5 sum for the file
- Determine if the PHP for this has already been built. If it has, skip all building steps.
- If there is no preexisting PHP cached for this, use the FormGeneration class to build the local PHP, with a single class representing:
- The Controller (equivalent to the legacy PHP.notebook object/class)
- The Pages (each page has its own class)
- The Actions (each action also has its own class, but this will simply be a "callback" to set that we have finished the form and are ready to procede)
- (Note that all of these will occupy a single PHP file, named after the MD5 sum of its XML source in data/cache/ui)
- Page form is rendered if it is deemed necessary, otherwise page/module execution continues to next step.