Skip to content

Commit fd57a1d

Browse files
committed
Renamed limit to max
1 parent 53b925a commit fd57a1d

14 files changed

+46
-39
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Yii2 multiple input change log
22
==============================
33

4+
2.0
5+
===
6+
7+
- Renamed `limit` option to `max`
8+
- Changed namespace from `unclead\widgets` to `yii\multipleinout`
9+
410
1.4.1
511
=====
612

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Yii2 widget for handle multiple inputs for an attribute of model and tabular inp
88
[![License](https://poser.pugx.org/unclead/yii2-multiple-input/license)](https://packagist.org/packages/unclead/yii2-multiple-input)
99

1010
##Latest release
11-
The latest stable version of the extension is v1.4.1 Follow the [instruction](./UPGRADE.md) for upgrading from previous versions
11+
The latest stable version of the extension is v2.0 Follow the [instruction](./UPGRADE.md) for upgrading from previous versions
1212

1313
##Installation
1414
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
@@ -41,10 +41,10 @@ use yii\multipleinput\MultipleInput;
4141

4242
<?php
4343
echo $form->field($model, 'emails')->widget(MultipleInput::className(), [
44-
'limit' => 6,
44+
'max' => 6,
45+
'min' => 2, // should be at least 2 rows
4546
'allowEmptyList' => false,
4647
'enableGuessTitle' => true,
47-
'min' => 2, // should be at least 2 rows
4848
'addButtonPosition' => MultipleInput::POS_HEADER // show add button in the header
4949
])
5050
->label(false);

UPGRADE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ for both A and B.
1111
Upgrade from 1.4 to 2.0
1212
-----------------------
1313

14+
- Rename option `limit` to `max`
1415
- Change namespace prefix `unclead\widgets\` to `yii\multipleinput\`.
1516

1617
Upgrade from 1.3 to 1.4

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Widget support the following options that are additionally recognized over and a
44

55
##Base options
66

7-
**limit** *integer*: rows limit. If not set will defaul to unlimited
7+
**max** *integer*: maximux number of rows. If not set will default to unlimited
88

99
**min** *integer*: minimum number of rows. Set to `0` if you need the empty list in case you don't have any data
1010

docs/multiple_input_multiple.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ use yii\helpers\Html;
5353
]);?>
5454

5555
<?= $form->field($model, 'schedule')->widget(MultipleInput::className(), [
56-
'limit' => 4,
56+
'max' => 4,
5757
'columns' => [
5858
[
5959
'name' => 'user_id',

docs/multiple_input_single.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ use yii\helpers\Html;
3939
]);?>
4040

4141
<?= $form->field($model, 'emails')->widget(MultipleInput::className(), [
42-
'limit' => 4,
42+
'max' => 4,
4343
]);
4444
?>
4545
<?= Html::submitButton('Update', ['class' => 'btn btn-success']);?>
4646
<?php ActiveForm::end();?>
4747
```
4848

49-
Options `limit` means that user able to input only 4 emails
49+
Options `max` means that user able to input only 4 emails
5050

5151
For validation emails you can use the following code
5252

docs/tips.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ how you can use those options:
1616
```php
1717

1818
echo $form->field($model, 'emails')->widget(MultipleInput::className(), [
19-
'limit' => 5,
19+
'max' => 5,
2020
'addButtonOptions' => [
2121
'class' => 'btn btn-success',
2222
'label' => 'add' // also you can use html code
@@ -36,7 +36,7 @@ In some cases you need to have the ability to delete all rows in the list. For t
3636
```php
3737

3838
echo $form->field($model, 'emails')->widget(MultipleInput::className(), [
39-
'limit' => 5,
39+
'max' => 5,
4040
'allowEmptyList' => true
4141
])
4242
->label(false);
@@ -53,7 +53,7 @@ In this case you can use `enableGuessTitle` option like in the example below:
5353
```php
5454

5555
echo $form->field($model, 'emails')->widget(MultipleInput::className(), [
56-
'limit' => 5,
56+
'max' => 5,
5757
'allowEmptyList' => true,
5858
'enableGuessTitle' => true
5959
])

docs/usage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use yii\multipleinput\MultipleInput;
2020

2121
<?php
2222
echo $form->field($model, 'emails')->widget(MultipleInput::className(), [
23-
'limit' => 6,
23+
'max' => 6,
2424
'allowEmptyList' => false,
2525
'enableGuessTitle' => true,
2626
'min' => 2, // should be at least 2 rows
@@ -46,7 +46,7 @@ use yii\multipleinput\MultipleInput;
4646
...
4747

4848
<?= $form->field($model, 'schedule')->widget(MultipleInput::className(), [
49-
'limit' => 4,
49+
'max' => 4,
5050
'columns' => [
5151
[
5252
'name' => 'user_id',

examples/views/multiple-input.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<h3>Single column</h3>
2525
<?php
2626
echo $form->field($model, 'emails')->widget(MultipleInput::className(), [
27-
'limit' => 6,
27+
'max' => 6,
2828
'allowEmptyList' => false,
2929
'columns' => [
3030
[
@@ -47,7 +47,7 @@
4747
<h3>Multiple columns</h3>
4848
<?php
4949
echo $form->field($model, 'schedule')->widget(MultipleInput::className(), [
50-
'limit' => 4,
50+
'max' => 4,
5151
'allowEmptyList' => true,
5252
'rowOptions' => function($model) {
5353
$options = [];

src/MultipleInput.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ class MultipleInput extends InputWidget
3939
public $columns = [];
4040

4141
/**
42-
* @var integer inputs limit
42+
* @var integer maximum number of rows
4343
*/
44-
public $limit;
44+
public $max;
4545

4646
/**
4747
* @var array client-side attribute options, e.g. enableAjaxValidation. You may use this property in case when
@@ -179,12 +179,12 @@ private function createRenderer()
179179
$config = [
180180
'id' => $this->options['id'],
181181
'columns' => $this->columns,
182-
'limit' => $this->limit,
182+
'min' => $this->min,
183+
'max' => $this->max,
183184
'attributeOptions' => $this->attributeOptions,
184185
'data' => $this->data,
185186
'columnClass' => $this->columnClass !== null ? $this->columnClass : MultipleInputColumn::className(),
186187
'allowEmptyList' => $this->allowEmptyList,
187-
'min' => $this->min,
188188
'addButtonPosition' => $this->addButtonPosition,
189189
'rowOptions' => $this->rowOptions,
190190
'context' => $this,

0 commit comments

Comments
 (0)