public function actionGetNavItemPath($navId)
    {
        $data = "";
        $node = NavItem::find()->where(['nav_id' => $navId])->one();
        if ($node) {
            $data .= $node->title;
            $parentNavId = $navId;
            while ($parentNavId != 0) {
                $parentNavIdModel = Nav::findOne($parentNavId);
                if ($parentNavIdModel) {
                    $parentNavId = $parentNavIdModel->parent_nav_id;
                    if ($parentNavId != 0) {
                        $node = NavItem::find()->where(['nav_id' => $parentNavId])->one();
                        if ($parentNavId) {
                            $data = $node->title . '/' . $data;
                        }
                    }
                }
            }
        }
        
        return $data;
    }
public function actionGetNavItemPath($navId)
    {
        $data = "";
        $node = NavItem::find()->where(['nav_id' => $navId])->one();
        if ($node) {
            $data .= $node->title;
            $parentNavId = $navId;
            while ($parentNavId != 0) {
                $parentNavIdModel = Nav::findOne($parentNavId);
                if ($parentNavIdModel) {
                    $parentNavId = $parentNavIdModel->parent_nav_id;
                    if ($parentNavId != 0) {
                        $node = NavItem::find()->where(['nav_id' => $parentNavId])->one();
                        if ($parentNavId) {
                            $data = $node->title . '/' . $data;
                        }
                    }
                }
            }
        }
        
        return $data;
    }
public function actionGetNavItemPath ( $ navId ) { $ data = "" ; $ node = NavItem :: find ( ) -> where ( [ 'nav_id' => $ navId ] ) -> one ( ) ; if ( $ node ) { $ data .= $ node -> title ; $ parentNavId = $ navId ; while ( $ parentNavId != 0 ) { $ parentNavIdModel = Nav :: findOne ( $ parentNavId ) ; if ( $ parentNavIdModel ) { $ parentNavId = $ parentNavIdModel -> parent_nav_id ; if ( $ parentNavId != 0 ) { $ node = NavItem :: find ( ) -> where ( [ 'nav_id' => $ parentNavId ] ) -> one ( ) ; if ( $ parentNavId ) { $ data = $ node -> title . '/' . $ data ; } } } } } return $ data ; }
Get full constructed path of a nav item.

@param $navId
@return string Path
Get full constructed path of a nav item .