Пример #1
0
                    </div>
                    <div class="col-sm-6">
                        <?php 
echo $form->field($model, 'created_ip')->textInput(['maxlength' => true]);
?>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-6">
                        <?php 
echo $form->field($model, 'for_user_id')->widget(Select2::classname(), ['language' => 'ru', 'data' => User::getAll(), 'options' => ['placeholder' => '', 'id' => 'for_user_id'], 'pluginOptions' => ['allowClear' => true]]);
?>
                    </div>
                    <div class="col-sm-6">
                        <?php 
echo $form->field($model, 'for_document_id')->widget(Select2::classname(), ['language' => 'ru', 'data' => Document::getAll(), 'options' => ['placeholder' => '', 'id' => 'for_document_id'], 'pluginOptions' => ['allowClear' => true]]);
?>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-6">
                        <?php 
echo $form->field($model, 'parent_message_id')->textInput(['maxlength' => true]);
?>
                    </div>
                    <?php 
for ($i = 1; $i <= Message::OPTIONS_COUNT; $i++) {
    echo "<div class='col-sm-6'>" . $form->field($model, 'option_' . $i)->textInput(['maxlength' => true]) . "</div>";
}
?>
                 </div>
Пример #2
0
    }
}], ['attribute' => 'attachment', 'format' => 'raw', 'value' => function ($model) {
    if ($model->attachment) {
        return CFF::shortString($model->attachment, 200);
    } else {
        return null;
    }
}], ['attribute' => 'for_document_id', 'format' => 'raw', 'value' => function ($model) {
    if ($model->for_document_id) {
        $return = isset($model->for_document_id) ? Html::a($model->forDocument->name, ['/document/update', 'id' => $model->for_document_id]) : "";
        $return .= " (" . $model->for_document_id . ")";
        return $return;
    } else {
        return null;
    }
}, 'filterType' => GridView::FILTER_SELECT2, 'filter' => Document::getAll(), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => ' ', 'class' => 'form-control']], ['attribute' => 'for_user_id', 'value' => function ($model) {
    $return = '';
    if ($model->for_user_id) {
        if (isset($model->forUser)) {
            $user = $model->forUser;
            $return = $user->first_name;
            if ($user->last_name) {
                $return .= " " . $user->last_name;
            }
        }
        $return .= " (" . $model->for_user_id . ")";
        return $return;
    } else {
        return null;
    }
}, 'filterType' => GridView::FILTER_SELECT2, 'filter' => User::getAll(), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => ' ', 'class' => 'form-control'], 'format' => 'raw'], ['attribute' => 'parent_message_id', 'width' => '70px'], ['attribute' => 'created_at', 'value' => function ($model) {