6fdigital/silverstripe-phone-field

使用libphonenumber进行验证的SilverStripe CMS电话号码字段

安装: 44

依赖项: 0

建议者: 0

安全性: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:silverstripe-vendormodule

v0.1.1 2024-02-16 23:39 UTC

This package is auto-updated.

Last update: 2024-09-17 01:03:18 UTC


README

使用libphonenumber进行验证的SilverStripe CMS电话号码字段。

需求

安装

composer require "6fdigital/silverstripe-phone-field"

使用

PhoneField可以在自定义表单中使用,也可以与SilverStripe Userforms模块一起使用。要在自定义表单中使用,只需将表单添加到字段列表中即可。

use SixF\PhoneField\PhoneField;

public function MyForm(): Form {
    return Form::create(
        $this,
        "MyForm",
        FieldList::create(
            ...
            PhoneField::create('PhoneNumber', 'Your Phone Number')
            ...
        ),
        FieldList::create(
            FormAction::create('doSubmit', 'Submit')
        ),
        RequiredFields::create('Phone')
        );
    }
}