<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model common\modules\rubrication\models\TaxOption */

$this->title = $model->valueRenderFlash;
$this->params['breadcrumbs'][] = ['label' => Yii::t('rubrication', 'Groups'), 'url' => ['tax-group/index']];
$this->params['breadcrumbs'][] = ['label' => Yii::t('rubrication', $group->name), 'url' => ['index', 'group' => $group->tax_group_id]];
$this->params['breadcrumbs'][] = ['label' => Yii::t('rubrication', Yii::t('rubrication', 'Options of {name}', ['name' => $group->name])), 'url' => ['index', 'group' => $group->tax_group_id]];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="tax-option-view">

    <h1><?= Html::encode($this->title) ?></h1>

    <p>
        <?= Html::a(Yii::t('rubrication', 'Update'), ['update', 'id' => $model->tax_option_id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a(Yii::t('rubrication', 'Delete'), ['delete', 'id' => $model->tax_option_id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => Yii::t('rubrication', 'Are you sure you want to delete this item?'),
                'method' => 'post',
            ],
        ]) ?>
        <?= Html::a(Yii::t('rubrication', 'Create Option'), ['tax-option/create?group='. $model->tax_group_id], ['class' => 'btn btn-success']) ?>
        <?php if (!empty($model->parent_id)) :?>
        <?= Html::a(Yii::t('rubrication', 'Create Option By {name}', ['name' => $model->parent->ValueRenderFlash]), ['tax-option/create?group='. $model->tax_group_id .'&parent='. $model->parent->tax_option_id], ['class' => 'btn btn-success']) ?>
        <?php endif?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'tax_option_id',
            'ValueRenderFlash',
            'alias',
            'parent.ValueRenderFlash',
            'group.name',
            'sort',
        ],
    ]) ?>

</div>
