<?= $form->field($model, 'course_id')->textInput() ?>

	    <?= $form->field($model, 'task_type')->dropdownList(Task::typeList(), ['disabled' => 'true']) ?>

	    <?= $form->field($model, 'title')->widget(MarkdownEditor::classname(), ['height' => 260, 'encodeLabels' => true, 'smarty' => true, 'previewAction' => Url::to(['task/preview']),]); ?>

	    <?= $form->field($model, 'image')->textInput(['maxlength' => true]) ?>
		
		<?= $form->field($model, 'answer_json')->widget(MarkdownEditor::classname(), ['height' => 260, 'encodeLabels' => true, 'smarty' => true, 'previewAction' => Url::to(['task/preview']),]); ?>

	    <?= $form->field($model, 'score')->dropdownList(Task::scoreList()) ?>

	    <?= $form->field($model, 'is_timing')->dropdownList(Task::timingList()) ?>

		<span id="complete_time">
	    	<?= $form->field($model, 'complete_time')->dropdownList(Task::timeList()) ?>
		</span>
	    <div class="form-group">
	    	<label class="col-lg-2 control-label"></label>
	    	<div class="col-lg-4">
	        	<?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
	    	</div>
	    </div>

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

	</div>

</div>

<script type="text/javascript" src="http://cdn.bootcss.com/jquery/2.2.0/jquery.js"></script>
예제 #2
0
                },
                'headerOptions' => ['width' => '95px'],
            ],
            [
                'attribute' => 'is_timing',
                'format' => 'raw',
                'filter' => Html::activeDropDownList($searchModel, 'is_timing', Task::timingList(Task::INCLUDE_ALL), ['class' => 'form-control']),
                'value' => function ($model) {
                    $list = Task::timingList();
                    return $list[$model->is_timing];
                },
                'headerOptions' => ['width' => '95px'],
            ],
            [
                'attribute' => 'complete_time',
                'format' => 'raw',
                'filter' => Html::activeDropDownList($searchModel, 'complete_time', Task::timeList(Task::INCLUDE_ALL), ['class' => 'form-control']),
                'value' => function ($model) {
                    $list = Task::timeList();
                    return $list[$model->complete_time];
                },
                'headerOptions' => ['width' => '95px'],
            ],
            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
    
        

</div>