PHP Class ElggAutoP, Elgg

In DIV elements, Ps are only added when there would be at least two of them.
ファイルを表示 Open project: elgg/elgg Class Usage Examples

Public Properties

Property Type Description
$encoding

Protected Properties

Property Type Description
$_alterList array Add Ps inside these elements
$_blocks
$_descendList array Descend into these elements to add Ps
$_doc DOMDocument
$_inlines array
$_unique string
$_xpath DOMXPath

Public Methods

Method Description
__construct ( ) Constructor
process ( string $html ) : string | false Create wrapper P and BR elements in HTML depending on newlines. Useful when users use newlines to signal line and paragraph breaks. In all cases output should be well-formed markup.

Protected Methods

Method Description
addParagraphs ( DOMElement $el ) : void Add P and BR elements as necessary

Method Details

__construct() public method

Constructor
public __construct ( )

addParagraphs() protected method

Add P and BR elements as necessary
protected addParagraphs ( DOMElement $el ) : void
$el DOMElement DOM element
return void

process() public method

In DIV, LI, TD, and TH elements, Ps are only added when their would be at least two of them.
public process ( string $html ) : string | false
$html string snippet
return string | false output or false if parse error occurred

Property Details

$_alterList protected_oe property

Add Ps inside these elements
protected array $_alterList
return array

$_blocks protected_oe property

protected $_blocks

$_descendList protected_oe property

Descend into these elements to add Ps
protected array $_descendList
return array

$_doc protected_oe property

protected DOMDocument $_doc
return DOMDocument

$_inlines protected_oe property

protected array $_inlines
return array

$_unique protected_oe property

protected string $_unique
return string

$_xpath protected_oe property

protected DOMXPath $_xpath
return DOMXPath

$encoding public_oe property

public $encoding