$nav = [
'items' => Yii::$app->user->isGuest ? '' : (
['label' => 'Главная', 'url' => ['/site/index']]
),
Yii::$app->user->isGuest ? "" : (
['label' => 'Сотрудники', 'url' => ['/site/about']]),
Yii::$app->user->isGuest ? "" : (
['label' => 'Лиды', 'url' => ['/site/contact']]),
Yii::$app->user->isGuest ? "" : (
['label' => 'Заказы', 'url' => ['/site/contact']]),
Yii::$app->user->isGuest ? "" : (
['label' => 'Настройки', 'url' => ['/site/contact']]),
];
if (Yii::$app->user->isGuest) {
$nav = [
'items' => [],
];
} else {
$nav = [
'items' => [
['label' => 'Главная', 'url' => ['/site/index']] ,
['label' => 'Сотрудники', 'url' => ['/site/about']],
['label' => 'Лиды', 'url' => ['/site/contact']],
['label' => 'Заказы', 'url' => ['/site/contact']],
['label' => 'Настройки', 'url' => ['/site/contact']],
],
];
}
{%- block form_widget_simple -%}
{%- set type = type|default('text') -%}
{%- if attr.class is not defined -%}
{%- set attr = attr|merge({'class': 'my-class'}) -%}
{%- endif -%}
<input type="{{ type }}" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}" {% endif %}/>
{%- endblock form_widget_simple -%}
{%- block form_widget_simple -%}
{%- set type = type|default('text') -%}
{%- set attr = attr|merge({'class': (attr.class|default ~ ' my-class')|trim}) -%}
<input type="{{ type }}" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}" {% endif %}/>
{%- endblock form_widget_simple -%}