Tuesday, June 13, 2006

What is ActionForm? (1)

I started to edit cubson manual. It's remix of this blog. Old entries are never modified, but the manual is updated to cover latest informations. For example, Mr,gigamaster told me the correct guidance in English OS. I shall update the manual by such reports. So users should read not the archive of blog but the manual.

Well I'll have explained ActionForm in XCube to you until this weekend. If you don't have your myannounce module, go to manuals and create it.

Click "create new" in myannounce module at your control panel. Message input form of myannounce module requires subject and message. If you input nothing to the form, error messages show up and request to input again. Most of input forms in XOOPS Cube 2.1 does the same behavior. Input forms never allow error requests to pass to the next page.

These controls are brought by ActionForm. ActionForm works validity check. ActionForm is very popular in web programing. The core team created their ActionForm class as sample for developers. Developers who have no library should use library that is defined in core. This is not obligations but just library. So if a developer has useful libraries, he can select his libary.

XCube_ActionForm has the following purposes:

  • Get input values by $_REQUEST, and do stripslashes() if magic_quotes_gpc is on.
  • Type Safety. Cast values with following form property settings.
  • Do validity check with following field property settings.
  • Integrate one-time token into validation.
  • Remove the difference of creating and editing.
  • Implement interfaces that exchange values with data objects.

In other words, XCube_ActionForm manages input values at outside of data object, and checks it.

No comments: