/** * Lists all Accountability models. * @return mixed */ public function actionIndex() { $dataProvider = new ActiveDataProvider(['query' => Accountability::find()]); return $this->render('index', ['dataProvider' => $dataProvider]); }
/* @var $model app\models\PositionType */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="position-type-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'name')->textInput(['maxlength' => true]); ?> <?php $list = ArrayHelper::map(Accountability::find()->all(), 'id', 'name'); $checked = ArrayHelper::getColumn($model->accountabilities, 'id'); echo Html::checkboxList('PositionType[accountability_list]', $checked, $list); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?> </div>