public function parse($value, $sub)
    {
        $page = Nav::findOne($value);
        
        // verify if the page is of type content

        if ($page) {
            if ($page->activeLanguageItem->nav_item_type !== NavItem::TYPE_PAGE) {
                return null;
            }
            
            if (empty($sub)) {
                return $page->activeLanguageItem->getContent();
            } else {
                return $page->activeLanguageItem->type->renderPlaceholder($sub);
            }
        }
        
        return null;
    }
public function parse($value, $sub)
    {
        $page = Nav::findOne($value);
        
        // verify if the page is of type content

        if ($page) {
            if ($page->activeLanguageItem->nav_item_type !== NavItem::TYPE_PAGE) {
                return null;
            }
            
            if (empty($sub)) {
                return $page->activeLanguageItem->getContent();
            } else {
                return $page->activeLanguageItem->type->renderPlaceholder($sub);
            }
        }
        
        return null;
    }
public function parse ( $ value , $ sub ) { $ page = Nav :: findOne ( $ value ) ; // verify if the page is of type content if ( $ page ) { if ( $ page -> activeLanguageItem -> nav_item_type !== NavItem :: TYPE_PAGE ) { return null ; } if ( empty ( $ sub ) ) { return $ page -> activeLanguageItem -> getContent ( ) ; } else { return $ page -> activeLanguageItem -> type -> renderPlaceholder ( $ sub ) ; } } return null ; }
Get the content of Nav for the current active language with cmslayout or placeholder.

@param string $value The value of the Nav ID e.g 1 (hover the cms menu to see the ID).
@param string|null $sub If null this parameter will be ignored otherwise its the name of the placeholder inside this cmslayout.
@return string The content rendered with the cmslayout, or if $sub is provided and not null with its placeholder name.
@see \luya\tag\TagInterface::parse()
Get the content of Nav for the current active language with cmslayout or placeholder .