Manual menu
Classes
Interface
Useful links
Manual
To work with MyOOF, download it firstly and uncompress it in your workplace.
Once you get can see « myoof_v2.00 » directory, open it and take a look at files.
You could see these files:
- myoof_v2.00/
- api.zip
- classes/
- Element.php
- Input.php
- Optgroup.php
- Option.php
- OptionHandler.php
- Select.php
- Textarea.php
- LICENSE
- RELEASE_NOTE
MyOOF needs PHP >= 5.1.0.
Getting started
To start with a simple example, we are going to create an Input object because it is so far the most common form object.
Supposing, you moved the uncompressed directory in your workplace, before getting through MyOOF code, you have to create an index PHP file with this code :
<?php
// Sets the header for a bench test
header('Content-Type: text/plain');
// Sets class autoloading
function __autoload($className) {
// Includes called class
require_once('./myoof_v2.00/classes/' . $className . '.php');
}
?>
Once this function is defined, you don't have to require each class you instanciate. If you want more information about this magic function, read this page.
Now, look at the following example and see how it is easy to create a form object :
<?php
// Creates an Input default object
$input = new Input;
// Outputs the Input
echo $input;
/**
* Result
* <input dir="ltr" value="" />
*/
?>
Of course it's the most basic Input object but there are many ways to handle it.
Informations
This Website and it content was writen by myself. Please, be indulgent about the language quality you will find in these pages. I'm French and try to turn my sentences in the more suitable and professional way.
This project was started around end of 2007 and since this period, a lot of evolutions changed the source code.
I discovered Design Patterns and applied them as much as possible to make a very evolutive application base.
It has been designed to be improved and especially to add others class, decorators and factories.
Do not hesitate to give a try to this project, I'm sure it could help you out a lot for all your forms.