PHP Class Zend_Search_Lucene_Document_Html

Inheritance: extends Zend_Search_Lucene_Document
Show file Open project: yupe/yupe Class Usage Examples

Public Methods

Method Description
applyColour ( string $stringToHighlight, $colour ) : string Standard callback method used to highlight words.
getExcludeNoFollowLinks ( ) : boolean Get exclude nofollow links flag
getHTML ( ) : string Get HTML
getHeaderLinks ( ) : array Get document header links
getHtmlBody ( ) : string Get HTML body
getLinks ( ) : array Get document HREF links
highlight ( string | array $words, string $colour = '#66ffff' ) : string Highlight text with specified color
highlightExtended ( string | array $words, callback $callback, array $params = [] ) : string Highlight text using specified View helper or callback function.
loadHTML ( string $data, boolean $storeContent = false, string $defaultEncoding = '' ) : Zend_Search_Lucene_Document_Html Load HTML document from a string
loadHTMLFile ( string $file, boolean $storeContent = false, string $defaultEncoding = '' ) : Zend_Search_Lucene_Document_Html Load HTML document from a file
setExcludeNoFollowLinks ( boolean $newValue ) Set exclude nofollow links flag

Protected Methods

Method Description
_highlightNodeRecursive ( DOMNode $contextNode, array $wordsToHighlight, callback $callback, array $params ) highlight words in content of the specified node
_highlightTextNode ( DOMText $node, array $wordsToHighlight, callback $callback, array $params ) Highlight text in text node

Private Methods

Method Description
__construct ( string $data, boolean $isFile, boolean $storeContent, string $defaultEncoding = '' ) Object constructor
_retrieveNodeText ( DOMNode $node, &$text ) Get node text

Method Details

_highlightNodeRecursive() protected method

highlight words in content of the specified node
protected _highlightNodeRecursive ( DOMNode $contextNode, array $wordsToHighlight, callback $callback, array $params )
$contextNode DOMNode
$wordsToHighlight array
$callback callback Callback method, used to transform (highlighting) text.
$params array Array of additionall callback parameters (first non-optional parameter is a text to transform)

_highlightTextNode() protected method

Highlight text in text node
protected _highlightTextNode ( DOMText $node, array $wordsToHighlight, callback $callback, array $params )
$node DOMText
$wordsToHighlight array
$callback callback Callback method, used to transform (highlighting) text.
$params array Array of additionall callback parameters (first non-optional parameter is a text to transform)

applyColour() public method

Standard callback method used to highlight words.
public applyColour ( string $stringToHighlight, $colour ) : string
$stringToHighlight string
return string

getHTML() public method

Get HTML
public getHTML ( ) : string
return string

getHtmlBody() public method

Get HTML body
public getHtmlBody ( ) : string
return string

highlight() public method

Highlight text with specified color
public highlight ( string | array $words, string $colour = '#66ffff' ) : string
$words string | array
$colour string
return string

highlightExtended() public method

Highlight text using specified View helper or callback function.
public highlightExtended ( string | array $words, callback $callback, array $params = [] ) : string
$words string | array Words to highlight. Words could be organized using the array or string.
$callback callback Callback method, used to transform (highlighting) text.
$params array Array of additionall callback parameters passed through into it (first non-optional parameter is an HTML fragment for highlighting)
return string

loadHTML() public static method

Load HTML document from a string
public static loadHTML ( string $data, boolean $storeContent = false, string $defaultEncoding = '' ) : Zend_Search_Lucene_Document_Html
$data string
$storeContent boolean
$defaultEncoding string HTML encoding, is used if it's not specified using Content-type HTTP-EQUIV meta tag.
return Zend_Search_Lucene_Document_Html

loadHTMLFile() public static method

Load HTML document from a file
public static loadHTMLFile ( string $file, boolean $storeContent = false, string $defaultEncoding = '' ) : Zend_Search_Lucene_Document_Html
$file string
$storeContent boolean
$defaultEncoding string HTML encoding, is used if it's not specified using Content-type HTTP-EQUIV meta tag.
return Zend_Search_Lucene_Document_Html