All Projects → kartik-v → yii2-widget-activeform

kartik-v / yii2-widget-activeform

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

Programming Languages

PHP
23972 projects - #3 most used programming language
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to yii2-widget-activeform

yii2-cropper
Yii2 Image Cropper InputWidget
Stars: ✭ 22 (-63.93%)
Mutual labels:  yii2-widgets
yii2-dropzone
This extension provides the Dropzone integration for the Yii2 framework.
Stars: ✭ 11 (-81.97%)
Mutual labels:  yii2-widgets
yii2-time-down-counter
Widget for yii2, to start count down timer with a lot of options, This widget build dependence of timeDownCounter JS library
Stars: ✭ 15 (-75.41%)
Mutual labels:  yii2-widgets
yii2-lock-form
disable the button when form submit
Stars: ✭ 37 (-39.34%)
Mutual labels:  yii2-widgets
yii2-fileapi-widget
Yii2 FileAPI widget.
Stars: ✭ 51 (-16.39%)
Mutual labels:  yii2-widgets
yii2-sweet-submit
sweet sumit using sweetalert
Stars: ✭ 26 (-57.38%)
Mutual labels:  yii2-widgets
yii2-querybuilder
Extension for Yii2 Framework to work with jQuery QueryBuilder
Stars: ✭ 41 (-32.79%)
Mutual labels:  yii2-widgets
yii2-modal-ajax
A wrapper around Yii2 Bootstrap Modal for using an ActiveForm via AJAX inside.
Stars: ✭ 48 (-21.31%)
Mutual labels:  yii2-widgets

Krajee Logo
yii2-widget-activeform
Donate       kartikv

Stable Version Unstable Version License Total Downloads Monthly Downloads Daily Downloads

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:

  • 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.

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.

To install, either run

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

or add

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

to the require section of your composer.json file.

Release Changes

NOTE: Refer the CHANGE LOG for details on changes to various releases.

Demo

You can refer detailed documentation and demos for understanding the usage of the extension at these links below:

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].