public function init()
 {
     $this->name = \Yii::t('skeeks/measure', 'Units of measurement');
     $this->modelShowAttribute = "code";
     $this->modelClassName = Measure::className();
     parent::init();
 }
示例#2
0
文件: edit.php 项目: BMOTech/cms-shop
echo $form->fieldSetEnd();
?>

<?php 
echo $form->fieldSet(\skeeks\cms\shop\Module::t('app', 'The number and account'));
?>

    <?php 
echo $form->field($model, 'quantity')->textInput();
?>
    <?php 
echo $form->field($model, 'quantity_reserved')->textInput();
?>

    <?php 
echo $form->fieldSelect($model, 'measure_id', \yii\helpers\ArrayHelper::map(\skeeks\cms\measure\models\Measure::find()->all(), 'id', 'name'));
?>

    <?php 
echo $form->field($model, 'measure_ratio')->textInput();
?>


<?php 
echo $form->fieldSetEnd();
?>

<?php 
echo $form->fieldSet(\skeeks\cms\shop\Module::t('app', 'Weight and size'));
?>
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getMeasure()
 {
     return $this->hasOne(Measure::className(), ['id' => 'measure_id']);
 }