Download the PHP package sateler/yii2-rut without Composer
On this page you can find all versions of the php package sateler/yii2-rut. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download sateler/yii2-rut
More information about sateler/yii2-rut
Files in sateler/yii2-rut
Download sateler/yii2-rut
More information about sateler/yii2-rut
Files in sateler/yii2-rut
Vendor sateler
Package yii2-rut
Short Description Add chilean RUT formatting and validation
License BSD 3-Clause
Package yii2-rut
Short Description Add chilean RUT formatting and validation
License BSD 3-Clause
Please rate this library. Is it a good library?
Informations about the package yii2-rut
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)
All versions of yii2-rut with dependencies
PHP Build Version
Package Version
Requires
yiisoft/yii2 Version
~2.0
The package sateler/yii2-rut contains the following files
Loading the files please wait ....