public function actionIndex()
{
$blocks = QBlock::getAll();
$items = QItem::getAll();
return $this->render('index', compact('blocks', 'items'));
}
public function getAll()
{
return Block::find()->with('items')->orderBy('id')->indexBy('id')->all();
}
<?php $form = ActiveForm::begin(); ?>
<?php foreach ($blocks as $block): ?>
<h1>
<?= $block->name ?>
</h1>
<?php foreach ($block->qItems as $key => $item): ?>
<p>
<?= $form->field($item, "$item->name") ?>
</p>
<?php endforeach ?>
<?php endforeach ?>
<?php ActiveForm::end(); ?>
Или просто всем Nav разные id можно присвоить?