Notice: Undefined offset: 8192 in /home/miphpf/domains/ on line 499

Notice: Undefined offset: 8192 in /home/miphpf/domains/ on line 506
Web Form Widgets | MIPHPF - Your Open Source RAD PHP Framework
Skip navigation.

Web Form Widgets

: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/miphpf/domains/ on line 291.

Widgets are PHP wrappers of web form input fields. They process data from a single (rarely multiple) HTML input field(s). Widgets can be explicitly created in the source, but preferred approach is to map them in a miDataManager subclass.

In template widgets represent the whole input box (including HTML).
For simple widgets in the templates is used this construct:
    <input type="text" name="UserLogin" value="%%USERLOGIN%%" />
For ordinary widgets:

* Map widgets

class wsProductsDataManager extends miDataManager  {
protected $_dataFields = array(
'field' => 'miWebFormFieldText',
'data' => 'ProductID'
'field' => 'miWebFormWidgetSelect',
'data' => 'ProductColor'
'field' => 'miWebFormWidgetText',
'data' => 'ProductName',
* Create widget at runtime
class wsProductsDataManager extends miDataManager  {
public function initWebForm(miWebForm $form)
$productOptions = miUtil::getDBArray('SELECT ProductOptionID, ProductOptionName FROM ProductOptions', 'ProductOptionID', 'ProductOptionName');
$productOptionsSelect = new miWebFormWidgetSelect($form);
$form->addMainPageElements(array('%%PRODUCTOPTIONS%%' => $productOptionsSelect->getEditableControl()));