Bitrix Site Manager

CChapter::GetNavChain

CDBResult
CChapter::GetNavChain(
 int COURSE_ID,
 int CHAPTER_ID
);

The GetNavChain method returns the root path to the CHAPTER_ID chapter.

Parameters

ParameterDescription
COURSE_ID The course ID.
CHAPTER_ID The chapter ID.

Return Values

The method returns an instance of the CDBResult object.

See Also

  • CDBResult
  • CChapter::GetList
  • CChapter::GetByID
  • Chapter fields

    Example

    
    <?
    if (CModule::IncludeModule("learning"))
    {
    
        $COURSE_ID = 90;
        $CHAPTER_ID = 116;
    
        $nav = CChapter::GetNavChain($COURSE_ID, $CHAPTER_ID);
        $i = 1;
        while($arChain = $nav->GetNext())
        {
            if ($i > 1) echo " -> ";
            echo $arChain["NAME"];
            $i++;
        }
    
        /*
        The above example will output something similar to:
        
        Chapter 1 -> Chapter 1.1 -> Chapter 1.1.3 -> Chapter 1.1.2
        $CHAPTER_ID - ID of Chapter 1.1.2;
        */
    }
    ?>