API Documentation

Search/Lucene/Document/Html.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Search_Lucene
subpackage
Document
version
$Id: Html.php 21946 2010-04-19 08:21:02Z alexander $
Classes
Zend_Search_Lucene_Document_Html

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_Search_Lucene_Document_Html

Extends from
Zend_Search_Lucene_Document
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Search_Lucene
subpackage
Document
Properties
$_links
$_headerLinks
$_doc
$_excludeNoFollowLinks
$_inlineTags
Methods
__construct
setExcludeNoFollowLinks
getExcludeNoFollowLinks
_retrieveNodeText
getLinks
getHeaderLinks
loadHTML
loadHTMLFile
_highlightTextNode
_highlightNodeRecursive
applyColour
highlight
highlightExtended
getHTML
getHtmlBody

Description

HTML document.

Properties

$_doc

DOMDocument $_doc = ''

Stored DOM representation

Details

$_doc
DOMDocument
visibility
private
default
final
false
static
false

$_excludeNoFollowLinks

boolean $_excludeNoFollowLinks = 'false'

Exclud nofollow links flag

If true then links with rel='nofollow' attribute are not included into document links.

Details

$_excludeNoFollowLinks
boolean
visibility
private
default
false
final
false
static
true

$_headerLinks

array $_headerLinks = 'array'

List of document header links

Details

$_headerLinks
array
visibility
private
default
array
final
false
static
false

$_inlineTags

array $_inlineTags = 'array'

List of inline tags

Details

$_inlineTags
array
visibility
private
default
array
final
false
static
false

$_links

array $_links = 'array'

List of document links

Details

$_links
array
visibility
private
default
array
final
false
static
false

Methods

__construct

__construct( string $data, boolean $isFile, boolean $storeContent, string $defaultEncoding ) :

Object constructor

Arguments
$data
string
HTML string (may be HTML fragment, )
$isFile
boolean
$storeContent
boolean
$defaultEncoding
string
HTML encoding, is used if it's not specified using Content-type HTTP-EQUIV meta tag.
Details
visibility
private
final
false
static
false

_highlightNodeRecursive

_highlightNodeRecursive( DOMNode $contextNode, array $wordsToHighlight, callback $callback, array $params ) :

highlight words in content of the specified node

Arguments
$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)
Details
visibility
protected
final
false
static
false

_highlightTextNode

_highlightTextNode( DOMText $node, array $wordsToHighlight, callback $callback, array $params ) :

Highlight text in text node

Arguments
$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)
Details
visibility
protected
final
false
static
false
throws

_retrieveNodeText

_retrieveNodeText( DOMNode $node, string $text ) :

Get node text

We should exclude scripts, which may be not included into comment tags, CDATA sections,

Arguments
$node
DOMNode
$text
string
&$text
Details
visibility
private
final
false
static
false

applyColour

applyColour( string $stringToHighlight,  $colour ) : string

Standard callback method used to highlight words.

Arguments
$stringToHighlight
string
$colour
Output
string
Details
visibility
public
final
false
static
false
internal

getExcludeNoFollowLinks

getExcludeNoFollowLinks( ) : boolean

Get exclude nofollow links flag

Output
boolean
Details
visibility
public
final
false
static
true

getHTML

getHTML( ) : string

Get HTML

Output
string
Details
visibility
public
final
false
static
false

getHeaderLinks

getHeaderLinks( ) : array

Get document header links

Output
array
Details
visibility
public
final
false
static
false

getHtmlBody

getHtmlBody( ) : string

Get HTML body

Output
string
Details
visibility
public
final
false
static
false

getLinks

getLinks( ) : array

Get document HREF links

Output
array
Details
visibility
public
final
false
static
false

highlight

highlight( string|array $words, string $colour = #66ffff ) : string

Highlight text with specified color

Arguments
$words
stringarray
$colour
string
Output
string
Details
visibility
public
final
false
static
false

highlightExtended

highlightExtended( string|array $words, callback $callback, array $params = array ) : string

Highlight text using specified View helper or callback function.

Arguments
$words
stringarray
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)
Output
string
Details
visibility
public
final
false
static
false
throws

loadHTML

loadHTML( string $data, boolean $storeContent = false, string $defaultEncoding ) : Zend_Search_Lucene_Document_Html

Load HTML document from a string

Arguments
$data
string
$storeContent
boolean
$defaultEncoding
string
HTML encoding, is used if it's not specified using Content-type HTTP-EQUIV meta tag.
Details
visibility
public
final
false
static
true

loadHTMLFile

loadHTMLFile( string $file, boolean $storeContent = false, string $defaultEncoding ) : Zend_Search_Lucene_Document_Html

Load HTML document from a file

Arguments
$file
string
$storeContent
boolean
$defaultEncoding
string
HTML encoding, is used if it's not specified using Content-type HTTP-EQUIV meta tag.
Details
visibility
public
final
false
static
true

setExcludeNoFollowLinks

setExcludeNoFollowLinks( boolean $newValue ) :

Set exclude nofollow links flag

Arguments
$newValue
boolean
Details
visibility
public
final
false
static
true
Documentation was generated by DocBlox.