PHP Class Zend_Search_Lucene_Document_Html

Inheritance: extends Zend_Search_Lucene_Document
Afficher le fichier Open project: yupe/yupe Class Usage Examples

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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

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

Method Details

_highlightNodeRecursive() protected méthode

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 méthode

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 méthode

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

getHTML() public méthode

Get HTML
public getHTML ( ) : string
Résultat string

getHtmlBody() public méthode

Get HTML body
public getHtmlBody ( ) : string
Résultat string

highlight() public méthode

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

highlightExtended() public méthode

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)
Résultat string

loadHTML() public static méthode

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.
Résultat Zend_Search_Lucene_Document_Html

loadHTMLFile() public static méthode

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.
Résultat Zend_Search_Lucene_Document_Html