Added new fields and forms
This commit is contained in:
parent
52d75b8029
commit
9db16a5edd
27 changed files with 832 additions and 34 deletions
34
src/CoreFields/PhoneField.php
Normal file
34
src/CoreFields/PhoneField.php
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Antonio de la Rosa <webmaster@web-t-sys.com>
|
||||
* @file
|
||||
* @package ExtraFields
|
||||
*
|
||||
*/
|
||||
|
||||
namespace PhangoApp\PhaModels\CoreFields;
|
||||
|
||||
class PhoneField extends CharField{
|
||||
|
||||
|
||||
public function check($value)
|
||||
{
|
||||
|
||||
if(!preg_match('/^[0-9]+$/', $value))
|
||||
{
|
||||
|
||||
return '';
|
||||
|
||||
}
|
||||
|
||||
return $value;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue