ICQ number validator
miValidatorIcq class performs sanity check over ICQ numbers. It can be mapped in the data manager, or created runtime.
* Mapped in the data manager class
<?php
class miUserDataManager extends miDataManager {
protected $_dataFields = array(
array(
'field' => 'miWebFormWidgetText',
'data' => 'UserIcq',
'validator' => 'miValidatorIcq'
)
);
}
?>
* Created runtime
<?php
class miUserDataManager extends miDataManager {
protected $_dataFields = array(
array(
'field' => 'miWebFormWidgetText',
'data' => 'UserIcq'
)
);
public function initWebForm(miWebForm $form)
{
parent::initWebForm($form);
$validator = new miValidatorIcq($form, 'UserIcq');
$form->addValidator('UserIcq', $validator);
}
}
?>