示例#1
0
 public function afterDelete()
 {
     parent::afterDelete();
     Yii::$app->db->createCommand()->delete('{{%zoo_elements_categories}}', ['element_id' => $this->id])->execute();
 }
示例#2
0
 public function getElements()
 {
     return $this->hasMany(Elements::className(), ['app_id' => 'id'])->indexBy('name');
 }
示例#3
0
<?php

$fields = \worstinme\zoo\models\Elements::find()->where(['app_id' => Yii::$app->controller->application->id, 'type' => 'textfield'])->all();
$fields = \yii\helpers\ArrayHelper::map($fields, 'id', 'title');
?>

<?php 
echo $form->field($model, 'related_fields')->dropDownList($fields, ['multiple' => 'multiple']);