コード例 #1
0
ファイル: _form.php プロジェクト: riros/tests
echo $form->field($model, 'sn')->textInput(['maxlength' => 255]);
?>

    <?php 
echo $form->field($model, 'creation_date')->widget(\kartik\widgets\DateTimePicker::className(), $params);
?>

    <?php 
echo $form->field($model, 'deactivation_date')->widget(\kartik\widgets\DateTimePicker::className(), $params);
?>

    <?php 
echo $form->field($model, 'sum')->textInput(['maxlength' => 20]);
?>

    <?php 
echo $form->field($model, 'status')->dropDownList([Card::StatusArray()]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>
コード例 #2
0
ファイル: index.php プロジェクト: riros/tests
echo Html::a(Yii::t('app', 'Создать карту', ['modelClass' => 'Card']), ['create'], ['class' => 'btn btn-success']);
?>
    </p>
    <?php 
\yii\widgets\Pjax::begin();
?>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'no', 'format' => 'html', 'value' => function ($model) {
    /**
     * @var app\models\SearchCard $model
     */
    return "<a href='/card/view?id={$model->no}'>{$model->no}</a>";
}], ['attribute' => 'sn', 'format' => 'html', 'value' => function ($model) {
    /**
     * @var app\models\SearchCard $model
     */
    return "<a href='/card/?SearchCard[sn]={$model->sn}'>{$model->sn}</a>";
}], 'creation_date', 'deactivation_date', 'activity_date', 'sum', ['attribute' => 'status', 'value' => function ($model) {
    /**
     * @var Card $model;
     */
    return $model->StatusName;
}, 'filterInputOptions' => ['class' => 'form-control'], 'filter' => Card::StatusArray()], ['class' => 'yii\\grid\\ActionColumn']]]);
?>
    <?php 
\yii\widgets\Pjax::end();
?>


</div>