2017 © Pedro Peláez
 

yii2-extension yii2-widget-inputsaddon

A Widget for Yii 2 with a simple way to group fields with bootstrap components

image

dersonsena/yii2-widget-inputsaddon

A Widget for Yii 2 with a simple way to group fields with bootstrap components

  • Monday, July 24, 2017
  • by dersonsena
  • Repository
  • 1 Watchers
  • 0 Stars
  • 58 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 2 % Grown

The README.md

Yii 2 - Widget for the Boostrap Inputs Addon

A Widget for Yii 2 with a simple way to group fields with bootstrap components, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

$ php composer.phar require dersonsena/yii2-widget-inputsaddon "dev-master"

or add, (*4)

"dersonsena/yii2-widget-inputsaddon": "dev-master"

to the require section of your composer.json file., (*5)

Properties

This widget supports all the parameters similar to the \yii\widgets\InputWidget widget. The following additional properties are important for the plugin configuration:, (*6)

side

string the side of the Group Addon. Possibles values: - AddonAbstract::RIGHT_SIDE (default value); - AddonAbstract::LEFT_SIDE., (*7)

size

string the size css class of the Group Addon. See more in: http://getbootstrap.com/components/#input-groups-sizing. Possibles values: - AddonAbstract::SIZE_DEFAULT (default value); - AddonAbstract::SIZE_LARGE; - AddonAbstract::SIZE_SMALL;, (*8)

icon

string the icon css class or text of the Group Addon;, (*9)

useIconText

boolean if true, the widget will render a text instead of a HTML icon, (*10)

Usage Input Addon's

The implementations below can be done by widgets: AreaAddon, EmailAddon, MoneyAddon, PercentAddon and PhoneAddon:, (*11)

// the widget usege WITH ActiveForm and model. Minimal configuration
echo $form->field($model, 'IMO_VAL_ARE')
    ->widget(EmailAddon::className());

// the widget usege WITHOUT ActiveForm or model
echo EmailAddon::widget([
    'name' => 'person_email',
    'value' => 'username@email.com.br'
]);

// the example for costumization
echo $form->field($model, 'email_field')
    ->widget(EmailAddon::className(), [
        'side' => EmailAddon::RIGHT_SIDE,
        'size' => EmailAddon::SIZE_LARGE,
        'icon' => 'fa fa-envelope' // default is: glyphicon glyphicon-envelope
        'forceEmailType' => true, // Force the input field to be email type. Available only for EmailAddon
        'options' => [
            'placeholder' => 'Type your email...'
        ]
    ])

// Text instead icon
echo $form->field($model, 'email_field')
    ->widget(EmailAddon::className(), [
        'icon' => '@'
        'useIconText' => true
    ])

Usage Buttons Addon

The bootstrap Button Addons. Please, for more details, see the http://getbootstrap.com/components/#input-groups-buttons., (*12)

echo $form->field($model, 'person_id')
    ->widget(ButtonsAddon::className(), [
        'buttons' => [
            Html::button("<i class='glyphicon glyphicon-search'></i>", ['class' => 'btn btn-primary']),
            Html::button("Add", ['class' => 'btn btn-default', 'onclick' => 'alert("Add")']),
            Html::button("Remove", ['class' => 'btn btn-danger'])
        ]
    ])

The Versions

24/07 2017

dev-master

9999999-dev

A Widget for Yii 2 with a simple way to group fields with bootstrap components

  Sources   Download

BSD-3-Clause

The Requires

 

by Kilderson Sena

yii2 input-addon boostrap add on bootstrap group

24/07 2017

1.0.3

1.0.3.0

A Widget for Yii 2 with a simple way to group fields with bootstrap components

  Sources   Download

BSD-3-Clause

The Requires

 

by Kilderson Sena

yii2 input-addon boostrap add on bootstrap group

24/07 2017

1.0.2

1.0.2.0

A Widget for Yii 2 with a simple way to group fields with bootstrap components

  Sources   Download

BSD-3-Clause

The Requires

 

by Kilderson Sena

yii2 input-addon boostrap add on bootstrap group

24/07 2017

1.0.1

1.0.1.0

A Widget for Yii 2 with a simple way to group fields with bootstrap components

  Sources   Download

BSD-3-Clause

The Requires

 

by Kilderson Sena

yii2 input-addon boostrap add on bootstrap group

24/07 2017

1.0.0

1.0.0.0

A Widget for Yii 2 with a simple way to group fields with bootstrap components

  Sources   Download

BSD-3-Clause

The Requires

 

by Kilderson Sena

yii2 input-addon boostrap add on bootstrap group