2017 © Pedro Peláez
 

yii2-extension yii2-widget-activeform

Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).

image

kartik-v/yii2-widget-activeform

Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).

  • Saturday, March 17, 2018
  • by kartik-v
  • Repository
  • 4 Watchers
  • 45 Stars
  • 981,173 Installations
  • PHP
  • 41 Dependents
  • 0 Suggesters
  • 26 Forks
  • 5 Open issues
  • 15 Versions
  • 10 % Grown

The README.md

Krajee Logo
yii2-widget-activeform
Donate       kartikv

Stable Version Unstable Version License Total Downloads Monthly Downloads Daily Downloads, (*1)

Extends and enhances the Yii ActiveForm widget. Facilitates all three form layouts available in Bootstrap i.e. vertical, horizontal, and inline. Allows options for offsetting labels and inputs for horizontal form layout. Works closely with the extended ActiveField component. In addition, this extension enhances and extends the Yii ActiveField component. Allows Bootstrap styled input group addons to be prepended or appended to textInputs. Implements feedback icons within inputs based on contextual states. Automatically adjusts checkboxes and radio input offsets for horizontal forms. Allows, flexibility to control the labels and placeholders based on form layout style (e.g. hide labels and show them as placeholder for inline forms). The extended ActiveField functionalities available are:, (*2)

  • Addons
    • Prepend Addon
    • Append Addon
    • Icon Addon
    • Input Addon
    • Button Addon
    • Button Dropdown Addon
    • Segmented Button Addon
    • Prepend & Append
    • Input Group Settings
    • Multiple Addons Configuration (_new_ since v1.4.9)
  • Input Feedback Icons
  • Input Hints Management
  • Inputs
    • Checkbox
    • Radio
    • Checkbox List
    • Radio List
    • Static Input
    • HTML 5 Input
    • Checkbox Button Group
    • Radio Button Group
  • Multi Select
    • Vertical Form
    • Horizontal Form
    • Radio List
    • Display Options

NOTE: This extension is a sub repo split of yii2-widgets. The split has been done since 08-Nov-2014 to allow developers to install this specific widget in isolation if needed. One can also use the extension the previous way with the whole suite of yii2-widgets., (*3)

Installation

The preferred way to install this extension is through composer. 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., (*4)

To install, either run, (*5)

$ php composer.phar require kartik-v/yii2-widget-activeform "@dev"

or add, (*6)

"kartik-v/yii2-widget-activeform": "@dev"

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

Release Changes

NOTE: Refer the CHANGE LOG for details on changes to various releases., (*8)

Demo

You can refer detailed documentation and demos for understanding the usage of the extension at these links below:, (*9)

Usage

ActiveForm

// add this in your view
use kartik\form\ActiveForm;

// Vertical Form
$form = ActiveForm::begin([
    'id' => 'form-signup',
    'type' => ActiveForm::TYPE_VERTICAL
]);

// Inline Form
$form = ActiveForm::begin([
    'id' => 'form-login', 
    'type' => ActiveForm::TYPE_INLINE,
    'fieldConfig' => ['autoPlaceholder'=>true]
]);

// Horizontal Form Configuration
$form = ActiveForm::begin([
    'id' => 'form-signup', 
    'type' => ActiveForm::TYPE_HORIZONTAL,
    'formConfig' => ['labelSpan' => 3, 'deviceSize' => ActiveForm::SIZE_SMALL]
]);

ActiveField

// Implement a feedback icon
echo $form->field($model, 'email_2', [
    'feedbackIcon' => [
        'default' => 'envelope',
        'success' => 'ok',
        'error' => 'exclamation-sign',
        'defaultOptions' => ['class'=>'text-primary']
    ]
])->textInput(['placeholder'=>'Enter a valid email address...']);

// Prepend an addon text
echo $form->field($model, 'email', ['addon' => ['prepend' => ['content'=>'@']]]);

// Append an addon text
echo $form->field($model, 'amount_paid', [
    'addon' => ['append' => ['content'=>'.00']]
]);

// Formatted addons (like icons)
echo $form->field($model, 'phone', [
    'addon' => [
        'prepend' => [
            'content' => '<i class="fas fa-phone"></i>'
        ]
    ]
]);

// Formatted addons (inputs)
echo $form->field($model, 'phone', [
    'addon' => [
        'prepend' => [
            'content' => '<input type="radio">'
        ]
    ]
]);

// Formatted addons (buttons)
echo $form->field($model, 'phone', [
    'addon' => [
        'prepend' => [
            'content' => Html::button('Go', ['class'=>'btn btn-primary']),
            'asButton' => true
        ]
    ]
]);

License

yii2-widget-activeform is released under the BSD-3-Clause License. See the bundled LICENSE.md for details., (*10)

The Versions

17/03 2018

dev-master

9999999-dev https://github.com/kartik-v/yii2-widget-activeform

Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 form widget field activeform activefield

05/03 2018

v1.4.9

1.4.9.0 https://github.com/kartik-v/yii2-widget-activeform

Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 form widget field activeform activefield

27/04 2016

v1.4.8

1.4.8.0 https://github.com/kartik-v/yii2-widget-activeform

Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 form widget field activeform activefield

11/12 2015

v1.4.7

1.4.7.0 https://github.com/kartik-v/yii2-widget-activeform

Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 form widget field activeform activefield

05/12 2015

v1.4.6

1.4.6.0 https://github.com/kartik-v/yii2-widget-activeform

Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 form widget field activeform activefield

22/10 2015

v1.4.5

1.4.5.0 https://github.com/kartik-v/yii2-widget-activeform

Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 form widget field activeform activefield

08/07 2015

v1.4.4

1.4.4.0 https://github.com/kartik-v/yii2-widget-activeform

Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 form widget field activeform activefield

17/06 2015

v1.4.3

1.4.3.0 https://github.com/kartik-v/yii2-widget-activeform

Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 form widget field activeform activefield

10/05 2015

v1.4.2

1.4.2.0 https://github.com/kartik-v/yii2-widget-activeform

Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 form widget field activeform activefield

14/02 2015

v1.4.1

1.4.1.0 https://github.com/kartik-v/yii2-widget-activeform

Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 form widget field activeform activefield

28/01 2015

v1.4.0

1.4.0.0 https://github.com/kartik-v/yii2-widget-activeform

Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 form widget field activeform activefield

04/12 2014

v1.3.0

1.3.0.0 https://github.com/kartik-v/yii2-widget-activeform

Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 form widget field activeform activefield

26/11 2014

v1.2.0

1.2.0.0 https://github.com/kartik-v/yii2-widget-activeform

Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 form widget field activeform activefield

17/11 2014

v1.1.0

1.1.0.0 https://github.com/kartik-v/yii2-widget-activeform

Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 form widget field activeform activefield

09/11 2014

v1.0.0

1.0.0.0 https://github.com/kartik-v/yii2-widget-activeform

Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).

  Sources   Download

BSD 3-Clause

The Requires

 

extension yii2 form widget field activeform activefield