PHP Class Facebook\InstantArticles\Elements\Element

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

Méthodes publiques

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

Méthodes protégées

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

Method Details

disableEmptyValidation() public méthode

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

emptyElement() protected méthode

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

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

getClassName() public static méthode

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

isEmptyValidationEnabled() public méthode

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

isValid() public méthode

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

render() public méthode

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.
Résultat string with the content rendered.

toDOMElement() abstract public méthode

abstract public toDOMElement ( $document = null )