A Yii 2 extension that allows you to easily setup ActiveField range fields with Bootstrap 3 addons markup and more. This allows you to setup the attributes joined together like a single field with a bootstrap addon separating the two. In addition, it enables you to display the field validation error messages as one single block instead of separate validation errors for two fields.
NOTE:
- The FieldRange validation routine displays only the first error encountered in validation of either of the attributes.
- To understand setting up your model validation rules for the attributes when using this extension, refer this wiki
The key features supported by this widget extension are:
\kartik\widgets\ActiveField
that allows you to add custom addons to prepend and append to your inputs.\kartik\widgets
. Special enhanced support for \kartik\widgets\DatePicker
to render date ranges.You can see detailed documentation and demos on usage of the extension.
NOTE: Refer the CHANGE LOG for details on changes to various releases.
The preferred way to install this extension is through composer.
Note: Check the composer.json for this extension's requirements and dependencies. Read this web tip /wiki on setting the
minimum-stability
settings for your application's composer.json.
Either run
$ php composer.phar require kartik-v/yii2-field-range "dev-master"
or add
"kartik-v/yii2-field-range": "dev-master"
to the require
section of your composer.json
file.
use kartik\field\FieldRange;
use kartik\widgets\ActiveForm;
$form = ActiveForm::begin();
echo FieldRange::widget([
'form' => $form,
'model' => $model,
'label' => 'Enter start and end points',
'attribute1' => 'start_point',
'attribute2' => 'end_point',
'type' => FieldRange::INPUT_TEXT,
]);
ActiveForm::end();
yii2-field-range is released under the BSD-3-Clause License. See the bundled LICENSE.md
for details.
yii2-field-range
Date: 25-May-2019
Date: 09-Oct-2018
Date: 25-Aug-2018
src
directory.Date: 06-Sep-2017
addInputCss
to override default form-control
style.separator
config for both form and non-inputs.yii2-helpers
and `yii2-widgets-activeform.Date: 03-Sep-2016
Date: 25-Nov-2014
Date: 15-Nov-2014
Date: 16-Sep-2014
Date: 14-Jul-2014
Comments