Zend_Search_Lucene_Document_Html::highlight PHP Method

highlight() public method

Highlight text with specified color
public highlight ( string | array $words, string $colour = '#66ffff' ) : string
$words string | array
$colour string
return string
    public function highlight($words, $colour = '#66ffff')
    {
        return $this->highlightExtended($words, [$this, 'applyColour'], [$colour]);
    }

Usage Example

Ejemplo n.º 1
0
    /**
     * Highlight specified words
     *
     * @param string|array $words  Words to highlight. They could be organized using the array or string.
     */
    public function highlight($words)
    {
    	$color = $this->_highlightColors[$this->_currentColorIndex];
    	$this->_currentColorIndex = ($this->_currentColorIndex + 1) % count($this->_highlightColors);

    	$this->_doc->highlight($words, $color);
    }
All Usage Examples Of Zend_Search_Lucene_Document_Html::highlight