Esempio n. 1
0
        <!--Title-->
        <td>
            <?php 
echo $form->field($priceTranslationModel, 'title')->label(false);
?>
        </td>
        <!--Price-->
        <td>
            <?php 
echo $form->field($priceModel, 'price')->textInput(['type' => 'number', 'step' => '0.01'])->label(false);
?>
        </td>
        <!--Sale type-->
        <td>
            <?php 
echo $form->field($priceModel, 'sale_type_id')->dropDownList(['' => '--none--'] + ArrayHelper::map(SaleType::find()->asArray()->all(), 'id', 'title'))->label(false);
?>
        </td>
        <!--Sale-->
        <td>
            <?php 
echo $form->field($priceModel, 'sale')->textInput(['type' => 'number', 'step' => '0.01'])->label(false);
?>
        </td>
        <td>
            <?php 
echo Html::submitButton(\Yii::t('shop', 'Add'), ['class' => 'btn btn-primary']);
?>
        </td>
    </tr>
    </tbody>
Esempio n. 2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getType()
 {
     return $this->hasOne(SaleType::className(), ['id' => 'sale_type_id']);
 }