PHP Class Facebook\InstantArticles\Elements\Element

This class is the meta each tag element that contains rendering code for the tags.
Show file Open project: facebook/facebook-instant-articles-sdk-php Class Usage Examples

Public Methods

Method Description
disableEmptyValidation ( ) Marks this Paragraph to *not* be ignored on isValid if it is empty.
enableEmptyValidation ( ) Marks this Paragraph to be ignored on isValid if it is empty.
getClassName ( ) : string Auxiliary method to extract all Elements full qualified class name.
isEmptyValidationEnabled ( ) : boolean Method that checks if empty element will warn on InstantArticleValidator.
isValid ( ) : boolean Method that checks if the element is valid, not empty. If !valid() it wont be rendered.
render ( string $doctype = '', boolean $formatted = false ) : string Renders the Element content
toDOMElement ( $document = null )

Protected Methods

Method Description
emptyElement ( DOMDocument $document ) Method to create an empty fragment if isValid() is false in toDOMElement()

Method Details

disableEmptyValidation() public method

Marks this Paragraph to *not* be ignored on isValid if it is empty.

emptyElement() protected method

Method to create an empty fragment if isValid() is false in toDOMElement()
protected emptyElement ( DOMDocument $document )
$document DOMDocument the document that will contain the empty element.

enableEmptyValidation() public method

Marks this Paragraph to be ignored on isValid if it is empty.

getClassName() public static method

Auxiliary method to extract all Elements full qualified class name.
public static getClassName ( ) : string
return string The full qualified name of class.

isEmptyValidationEnabled() public method

Method that checks if empty element will warn on InstantArticleValidator.
See also: InstantArticleValidator
public isEmptyValidationEnabled ( ) : boolean
return boolean true for ignore, false otherwise.

isValid() public method

Method that checks if the element is valid, not empty. If !valid() it wont be rendered.
public isValid ( ) : boolean
return boolean true for valid element, false otherwise.

render() public method

Renders the Element content
public render ( string $doctype = '', boolean $formatted = false ) : string
$doctype string the doctype will be applied to document. I.e.: ''.
$formatted boolean Whether to format output.
return string with the content rendered.

toDOMElement() abstract public method

abstract public toDOMElement ( $document = null )