zidivo/multiple-input

Widget for handle multiple inputs for an attribute of Yii2 framework model

Installs: 18

Dependents: 0

Suggesters: 0

Security: 0

Type:yii2-extension

1.1.2 2018-11-01 14:36 UTC

This package is not auto-updated.

Last update: 2024-09-28 09:28:45 UTC


README

Yii2 widget for handle multiple inputs for an attribute of model and tabular input for batch of models.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require  zidivo/multiple-input "~1.1"

or add

"zidivo/multiple-input": "~1.1"

to the require section of your composer.json file.

Basic usage

Single column example

For example you want to have an ability of entering several emails of user on profile page. In this case you can use multiple-input widget like in the following code

use zidivo\widgets\MultipleInput;

...

<?php
    echo $form->field($model, 'emails')->widget(MultipleInput::className(), [
        'limit'             => 6,
        'allowEmptyList'    => false,
        'enableGuessTitle'  => true,
        'min'               => 2, // should be at least 2 rows
        'addButtonPosition' => MultipleInput::POS_HEADER // show add button in the header
    ])
    ->label(false);
?>

You can find more examples of usage here

Documentation

License

Released under the BSD 3-Clause License. See the bundled LICENSE.md for details.