CDBResult CChapter::GetNavChain( int COURSE_ID, int CHAPTER_ID );
The GetNavChain method returns the root path to the CHAPTER_ID chapter.
| Parameter | Description |
|---|---|
| COURSE_ID | The course ID. |
| CHAPTER_ID | The chapter ID. |
The method returns an instance of the CDBResult object.
<?
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;
*/
}
?>| © 2001-2007 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |