예제 #1
0
파일: _form.php 프로젝트: vetoni/toko
}
$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 
예제 #2
0
파일: Shop.php 프로젝트: vetoni/toko
 /**
  * @return Country[]
  */
 public function api_countries()
 {
     return Data::cache($this->makeCacheKey(), function () {
         return Country::find()->all();
     });
 }