定制 sateler/yii2-rut 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sateler/yii2-rut

最新稳定版本:2.0.5

Composer 安装命令:

composer require sateler/yii2-rut

包简介

Add chilean RUT formatting and validation

README 文档

README

Build Status

Rut Formatting

Load the behavior in the config/web.php:

'formatter' => [
    'class' => \yii\i18n\Formatter::className(),
    'as rutFormatter' => \sateler\rut\RutFormatBehavior::className(),
],

Or if you use another formatter class, add the behavior:

public function behaviors() {
    return [ \sateler\rut\RutFormatBehavior::className() ];
}

Then you can use Yii::$app->formatter->asRut(), or specify the rut format in GridView or DetailView.

Rut Validator

In your model rules, add:

['property', \sateler\rut\RutValidator::className()]

Rut Widget

To format input data in textInputs, in your app assets, add:

public $depends = [
    ...,
    'sateler\rut\RutWidgetAsset',
];

And activate the text input using:

$form->field($model, "rut")->textInput(['data-rut' => 'true'])

Upgrade from 1.x to 2.x:

Just replace references to RutValidator::trimValue($value) to the new function Rut::normalize($value)

统计信息

  • 总下载量: 3.46k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: BSD
  • 更新时间: 2014-12-22