/**
  * @return array the list of attributes for this record
  */
 public static function getApiLangs($select = null)
 {
     if ($select !== null) {
         return Ref::find()->where(['gtype' => 'type,lang', 'select' => $select])->getList();
     } else {
         return Ref::find()->where(['gtype' => 'type,lang'])->getList();
     }
 }
 /**
  * @return null|integer
  */
 public function getTrashId()
 {
     $resultId = null;
     $ids = Ref::find(['gtype' => 'destination,trash', 'select' => 'full'])->all();
     foreach ($ids as $model) {
         if ($model->name === 'main') {
             $resultId = $model->id;
         }
     }
     return $resultId;
 }
<?php 
$form = ActiveForm::begin();
?>
    <?php 
echo $form->field($model, 'is_published')->widget(SwitchInput::class);
?>

    <?php 
echo $form->field($model, 'name');
?>
    <?php 
echo $form->field($model, 'post_date')->widget(DatePicker::class, ['value' => date('d-M-Y', strtotime('+2 days'))]);
?>

    <?php 
echo $form->field($model, 'type')->dropDownList(ArrayHelper::map(Ref::find()->where(['gtype' => 'type,article'])->getList(false), 'gl_key', function ($l) {
    return ucfirst($l->gl_value);
}));
?>

    <div role="tabpanel" style="margin-bottom: 25px;">

        <!-- Nav tabs -->
        <ul id="lang_tab" class="nav nav-tabs" role="tablist">
            <?php 
foreach ($langs as $code => $label) {
    ?>
                <?php 
    echo Html::beginTag('li', ['role' => 'presentation']);
    ?>
                    <?php