Skip to content

Latest commit

 

History

History
48 lines (39 loc) · 1.13 KB

widgets_inputs.md

File metadata and controls

48 lines (39 loc) · 1.13 KB

Usages

PublishWidget, BooleanWidget, CssClassWidget

Widgets for inputs

use kartik\widgets\ActiveForm;
use claudejanz\toolbox\widgets\inputs\PublishWidget
use claudejanz\toolbox\widgets\inputs\BooleanWidget
use claudejanz\toolbox\widgets\inputs\CssClassWidget
use claudejanz\toolbox\widgets\inputs\DateTimePicker

/* @var $form ActiveForm */

$form = ActiveForm::begin(['type' => ActiveForm::TYPE_VERTICAL]);
echo Form::widget([
    'model' => $model,
    'form' => $form,
    'columns' => 2,
    'attributes' => [
        'published' => [
            'type' => Form::INPUT_WIDGET,
            'widgetClass' => PublishWidget::className(),
        ],
        'home_page' => [
            'type' => Form::INPUT_WIDGET,
            'widgetClass' => BooleanWidget::className(),
        ],
        'css_class' => [
            'type' => Form::INPUT_WIDGET,
            'widgetClass' => CssClassWidget::className(),
        ],
        'date_time' => [
            'type' => Form::INPUT_WIDGET,
            'widgetClass' => DateTimePicker::className(),
        ],

       
    ]
]);
ActiveForm::end();

Back to Menu