vulcandigital / silverstripe-birthdayfield
为 SilverStripe 定制的行内生日字段
1.1.1
2018-02-01 06:05 UTC
Requires
- silverstripe/framework: ^4.0
Requires (Dev)
- phpunit/phpunit: ^5.7
README
要求
- silverstripe/silverstripe-framework: ^4.0
安装
composer require vulcandigital/silverstripe-birthdayfield
用法
class BirthdayForm extends Form { public function __construct(RequestHandler $controller = null, $name = self::DEFAULT_NAME) { $fields = FieldList::create([ $birthday = BirthdayField::create('Birthday', 'Birthday') ]); $actions = FieldList::create([ FormAction::create('process', 'Submit Birthday') ]); $validator = RequiredFields::create([ 'Birthday' ]); parent::__construct($controller, $name, $fields, $actions, $validator); } }
如果你希望它随列行内渲染(需要 Bootstrap v3)
$birthday->setBootstrapRender(true);
如果你想要禁用每个字段的单独标签并仅保留主标签
$birthday->disableTitles();
配置
Vulcan\BirthdayField\Forms\BirthdayField: # Change the output/read-only format display of the field format: 'Y-m-d'
许可证
BSD 3-Clause © Vulcan Digital Ltd