_main_tab.php 1.66 KB
<?php
    
    use artbox\core\admin\widgets\ImageInput;
    use common\models\Settings;
    use yii\bootstrap\ActiveForm;
    use yii\web\View;
    
    /**
     * @var View       $this
     * @var Settings   $model
     * @var ActiveForm $form
     */
    echo '<div class="wrapp-blocks-edit-page">';
    echo $form->field($model, 'name')
              ->textInput();


    echo '</div>';
    echo '<div class="wrapp-blocks-edit-page">';
    echo $form->field($model, 'logo')
              ->widget(
                  ImageInput::className(),
                  [
                      'showPreview'                  => true,
                      'showDeletePickedImageConfirm' => false,
                  ]
              );
    echo '</div>';
    echo '<div class="style">';
        foreach ($model->getVariationModels() as $index => $variationModel){
            echo '<div style="display: none" class="">';
            echo $form->field($variationModel, '[' . $index . ']' . 'language_id')
                      ->hiddenInput()->label(false);

            echo $form->field($variationModel, '[' . $index . ']' . 'settings_id')
                ->hiddenInput()->label(false);


            echo $form->field($variationModel, '[' . $index . ']' . 'id')
                      ->hiddenInput(['value' => $index])->label(false);
            echo '</div>';
            echo '<div class="tabs-lang" '.($index > 0 ? 'style="display:none"' : '').'>';
            echo $form->field($variationModel, '[' . $index . ']' . 'about')
                      ->textarea()->label(\Yii::t('core', 'About us' ).' ('.$variationModel->language->url.')');
            echo '</div>';
        }
     echo '</div>';
    
?>