Example #1
0
}
$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 
Example #2
0
File: Shop.php Project: vetoni/toko
 /**
  * @return Country[]
  */
 public function api_countries()
 {
     return Data::cache($this->makeCacheKey(), function () {
         return Country::find()->all();
     });
 }