} $items[count($items) - 1]['active'] = true; echo Nav::widget(['encodeLabels' => false, 'items' => $items, 'options' => ['class' => 'nav-pills']]); ?> <div class="order-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'currency_code')->widget(EntityDropDown::className(), ['items' => ArrayHelper::map(Currency::find()->all(), 'code', 'name')]); ?> <?php echo $form->field($model, 'country_id')->widget(EntityDropDown::className(), array('items' => ArrayHelper::map(Country::find()->all(), 'id', 'name'))); ?> <?php echo $form->field($model, 'user_id')->widget(EntityDropDown::className(), ['items' => ArrayHelper::map(User::find()->all(), 'id', 'name')]); ?> <?php echo $form->field($model, 'status')->widget(EntityDropDown::className(), ['items' => [Yii::t('app', 'New'), Yii::t('app', 'Closed'), Yii::t('app', 'Canceled')]]); ?> <?php echo $form->field($model, 'discount'); ?> <?php
/** * @return Country[] */ public function api_countries() { return Data::cache($this->makeCacheKey(), function () { return Country::find()->all(); }); }