Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
$router->get('catalog/{path}', ...)
$router->get('{path}', ...)
$descendants->push($this)->linkNodes()->pop();parent category (parent-category)
----child (parent-category-child)
--------descendant (parent-category-child-descendant)
parent cat (parent-cat)
----child (parent-cat-child)
--------descendant (parent-category-child-descendant) // не правильное значение
parent (parent)
----child (parent-child)
--------descendant (parent-cat-child-descendant) // не правильное значение
// Получаем всех потомков в древовидном порядке
$descendants = $this->descendants()->defaultOrder()->get();
// Данный метод заполняет отношения parent и children
$descendants->push($this)->linkNodes()->pop(); // Но сбиваем порядок! Надо убрать.
Дерево разделов неограниченной вложенности и URL