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.
* 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\ActiveFieldthat allows you to add custom addons to prepend and append to your inputs.
\kartik\widgets. Special enhanced support for
\kartik\widgets\DatePickerto render date ranges.
Note: This extension depends on the kartik-v/yii2-widgets extension which in turn depends on the yiisoft/yii2-bootstrap extension. Check the composer.json for this extension's requirements and dependencies. Note: Yii 2 framework is still in active development, and until a fully stable Yii2 release, your core yii2-bootstrap packages (and its dependencies) may be updated when you install or update this extension. You may need to lock your composer package versions for your specific app, and test for extension break if you do not wish to auto update dependencies.
Note: This extension mandatorily requires Yii Framework 2. The framework is under active development and the first stable release of Yii 2 is expected in early 2014.
The preferred way to install this extension is through composer.
$ php composer.phar require kartik-v/yii2-field-range "dev-master"
require section of your
You can see detailed documentation and demos on usage of the extension.
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.