S
S
Sergey Bard2018-02-09 17:31:12
Yii
Sergey Bard, 2018-02-09 17:31:12

Why doesn't activateItems work?

Hello. I can not understand why the activation of the element on which I am not working

$menuItems = [
  ['label' => 'Пункт 1', 'url' => ['/pynkt1'], 'linkOptions' => ['class' => 'list-group-item list-group-item-action']],
  ['label' => 'Пункт 2', 'url' => ['/pynkt2'], 'linkOptions' => ['class' => 'list-group-item list-group-item-action']],
  ['label' => 'Пункт 3', 'url' => ['/pynkt3'], 'linkOptions' => ['class' => 'list-group-item list-group-item-action']],
  ['label' => 'Пункт 4', 'url' => ['/pynkt4'], 'linkOptions' => ['class' => 'list-group-item list-group-item-action']],
  ['label' => 'Пункт 5', 'url' => ['/pynkt5'], 'linkOptions' => ['class' => 'list-group-item list-group-item-action']],
];
echo Nav::widget([
  'options' => ['class' => 'list-group'],
  'items' => $menuItems,
  'activateItems' => true,
]);

For example, I go to the first item, and nothing happens, as if activateItems = false, I have already tried everything I found (, please tell me what could be the reason?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2018-02-09
@slo_nik

Good afternoon.
Because the default value of this parameter is just " true ".
And it works if:

Whether to activate items automatically based on whether their route setting matches the current route.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question