public function init() { $this->name = "Управление свойствами пользователя"; $this->modelShowAttribute = "name"; $this->modelClassName = CmsUserUniversalProperty::className(); parent::init(); }
public function init() { $this->name = \Yii::t('skeeks/cms', 'User control properties'); $this->modelShowAttribute = "name"; $this->modelClassName = CmsUserUniversalProperty::className(); parent::init(); }
/** * @return \yii\db\ActiveQuery */ public function getProperty() { return $this->hasOne(CmsUserUniversalProperty::className(), ['id' => 'property_id']); }
/** * @inheritdoc */ public function behaviors() { return array_merge(parent::behaviors(), [TimestampBehavior::className(), HasStorageFile::className() => ['class' => HasStorageFile::className(), 'fields' => ['image_id']], HasRelatedProperties::className() => ['class' => HasRelatedProperties::className(), 'relatedElementPropertyClassName' => CmsUserProperty::className(), 'relatedPropertyClassName' => CmsUserUniversalProperty::className()]]); }
/* @var $this yii\web\View */ /* @var $model \yii\db\ActiveRecord */ $form = ActiveForm::begin(); ?> <?php if ($form_id = \Yii::$app->request->get('property_id')) { ?> <?php echo $form->field($model, 'property_id')->hiddenInput(['value' => $form_id])->label(false); ?> <?php } else { ?> <?php echo $form->field($model, 'property_id')->widget(\skeeks\widget\chosen\Chosen::className(), ['items' => \yii\helpers\ArrayHelper::map(\skeeks\cms\models\CmsUserUniversalProperty::find()->all(), "id", "name")]); ?> <?php } ?> <?php echo $form->field($model, 'value')->textInput(['maxlength' => 255]); ?> <?php echo $form->field($model, 'code')->textInput(['maxlength' => 32]); ?> <?php echo $form->buttonsCreateOrUpdate($model); ?>