Inheritance: extends skeeks\cms\relatedProperties\models\RelatedPropertyModel
 public function init()
 {
     $this->name = "Управление свойствами раздела";
     $this->modelShowAttribute = "name";
     $this->modelClassName = CmsTreeTypeProperty::className();
     parent::init();
 }
Example #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCmsTreeTypeProperties()
 {
     return $this->hasMany(CmsTreeTypeProperty::className(), ['tree_type_id' => 'id'])->orderBy(['priority' => SORT_ASC]);
 }
Example #3
0
/* @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\CmsTreeTypeProperty::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);
?>
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getProperty()
 {
     return $this->hasOne(CmsTreeTypeProperty::className(), ['id' => 'property_id']);
 }
Example #5
0
 /**
  *
  * @version > 2.4.9.1
  * Все возможные свойства связанные с моделью
  *
  * @return array|\yii\db\ActiveRecord[]
  */
 public function getRelatedProperties()
 {
     return $this->hasMany(CmsTreeTypeProperty::className(), ['tree_type_id' => 'id'])->via('treeType')->orderBy(['priority' => SORT_ASC]);
     //return $this->cmsContent->cmsContentProperties;
 }
Example #6
0
File: Tree.php Project: Liv1020/cms
 public function behaviors()
 {
     $behaviors = parent::behaviors();
     return ArrayHelper::merge(parent::behaviors(), [HasStorageFile::className() => ['class' => HasStorageFile::className(), 'fields' => ['image_id', 'image_full_id']], HasStorageFileMulti::className() => ['class' => HasStorageFileMulti::className(), 'relations' => ['images', 'files']], Implode::className() => ['class' => Implode::className(), "fields" => ["tree_menu_ids"]], "implode_tree" => ['class' => Implode::className(), "fields" => ["pids"], "delimetr" => self::PIDS_DELIMETR], HasRelatedProperties::className() => ['class' => HasRelatedProperties::className(), 'relatedElementPropertyClassName' => CmsTreeProperty::className(), 'relatedPropertyClassName' => CmsTreeTypeProperty::className()]]);
 }