public function getAnchors()
    {
        $list = ArrayList::create();
        
        if ($page = $this->getCurrentPage(Page::class)) {
            
            $html = HTMLValue::create($page->Content);
            
            $anchors = $html->query("//*[@id]");
            
            foreach ($anchors as $anchor) {
                
                $list->push(
                    ArrayData::create([
                        'Link' => $page->Link(sprintf('#%s', $anchor->getAttribute('id'))),
                        'Text' => $anchor->textContent
                    ])
                );
                
            }
            
        }
        
        return $list;
    }
public function getAnchors()
    {
        $list = ArrayList::create();
        
        if ($page = $this->getCurrentPage(Page::class)) {
            
            $html = HTMLValue::create($page->Content);
            
            $anchors = $html->query("//*[@id]");
            
            foreach ($anchors as $anchor) {
                
                $list->push(
                    ArrayData::create([
                        'Link' => $page->Link(sprintf('#%s', $anchor->getAttribute('id'))),
                        'Text' => $anchor->textContent
                    ])
                );
                
            }
            
        }
        
        return $list;
    }
public function getAnchors ( ) { $ list = ArrayList :: create ( ) ; if ( $ page = $ this -> getCurrentPage ( Page :: class ) ) { $ html = HTMLValue :: create ( $ page -> Content ) ; $ anchors = $ html -> query ( "//*[@id]" ) ; foreach ( $ anchors as $ anchor ) { $ list -> push ( ArrayData :: create ( [ 'Link' => $ page -> Link ( sprintf ( '#%s' , $ anchor -> getAttribute ( 'id' ) ) ) , 'Text' => $ anchor -> textContent ] ) ) ; } } return $ list ; }
Answers an array list of anchors identified within the current page content.

@return ArrayList
Answers an array list of anchors identified within the current page content .