create.php 1.54 KB
<?php
    
    use artbox\catalog\models\Option;
    use artbox\catalog\models\OptionGroup;
    use artbox\catalog\models\OptionLang;
    use yii\helpers\Html;
    use yii\web\View;
    use yiister\gentelella\widgets\Panel;
    
    /**
     * @var OptionLang[] $modelLangs
     * @var Option       $model
     * @var OptionGroup  $group
     * @var View         $this
     */
    
    $this->title = Yii::t(
        'catalog',
        'Create Option for {group}',
        [
            'group' => $group->lang->title,
        ]
    );
    $this->params[ 'breadcrumbs' ][] = [
        'label' => \Yii::t('app', 'Variant option complementary groups'),
        'url'   => [
            '/variant-option-group-complementary/index',
        ],
    ];
    $this->params[ 'breadcrumbs' ][] = [
        'label' => $group->lang->title,
        'url'   => [
            '/variant-option-group-complementary/view',
            'id' => $group->id,
        ],
    ];
    $this->params[ 'breadcrumbs' ][] = [
        'label' => Yii::t('catalog', 'Options'),
        'url'   => [
            'index',
            'group_id' => $group->id,
        ],
    ];
    $this->params[ 'breadcrumbs' ][] = $this->title;
?>
<div class="option-create">
    
    <?php
        $xPanel = Panel::begin(
            [
                'header' => Html::encode($this->title),
            ]
        );
    ?>
    
    <?= $this->render(
        '_form',
        [
            'model'      => $model,
            'modelLangs' => $modelLangs,
        ]
    ) ?>
    
    <?php
        $xPanel::end();
    ?>

</div>