本文整理匯總了PHP中table::setValidationRules方法的典型用法代碼示例。如果您正苦於以下問題:PHP table::setValidationRules方法的具體用法?PHP table::setValidationRules怎麽用?PHP table::setValidationRules使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類table
的用法示例。
在下文中一共展示了table::setValidationRules方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct()
{
parent::__construct('buyer', array('id_buyer' => 'i', 'surname' => 's', 'name' => 's', 'middlename' => 's', 'address' => 's', 'number' => 's', 'hours' => 's', 'login' => 's', 'password' => 's'));
parent::setFormFields(array('surname' => array('text', 'Фамилия'), 'name' => array('text', 'Имя'), 'middlename' => array('text', 'Отчество'), 'address' => array('text', 'Адрес'), 'number' => array('text', 'Телефон'), 'hours' => array('text', 'Желаемое время доставки'), 'login' => array('text', 'Логин'), 'password' => array('password', 'Пароль')));
//'id_hours' => array('radio', 'C 6 00 до 12 00 ','C 12 00 до 18 00 ','C 18 00 до 21 00 ')));
parent::setValidationRules(array('surname' => '/[А-Яа-яЁё]{1,20}/', 'name' => '/[А-Яа-яЁё]{1,20}/', 'middlename' => '/[А-Яа-яЁё]{1,20}/', 'address' => '/[А-Яа-яЁё]{1,20}/', 'number' => '/\\b[0-9]{1,20}\\b/', 'hours' => '/\\b[0-9]{1,20}\\b/', 'login' => '/[A-Za-z]{1,20}/', 'password' => '/[A-Za-z]{1,20}/'));
}
示例2: __construct
public function __construct()
{
parent::__construct('buyer', array('login' => 's', 'password' => 's'));
parent::setFormFields(array('login' => array('text', 'Логин'), 'password' => array('password', 'Пароль')));
//'id_hours' => array('radio', 'C 6 00 до 12 00 ','C 12 00 до 18 00 ','C 18 00 до 21 00 ')));
parent::setValidationRules(array('login' => '/[A-Za-z]{1,20}/', 'password' => '/[A-Za-z]{1,20}/'));
}
示例3: __construct
public function __construct()
{
parent::__construct('buyer', array('id_buyer' => 'i', 'hours' => 's', 'address' => 's'));
parent::setTableSelect('buyer natural join product');
parent::setFormFields(array('id_buyer' => array('', ''), 'hours' => array('text', 'Желаемое время'), 'address' => array('text', 'Адрес')));
//'id_hours' => array('radio', 'C 6 00 до 12 00 ','C 12 00 до 18 00 ','C 18 00 до 21 00 ')));
parent::setValidationRules(array('hours' => '/\\b[0-9]{1,20}\\b/', 'address' => '/[А-Яа-яЁё]{1,20}/'));
}