PHP Class Facebook\InstantArticles\Elements\InstantArticle

...
...

...

Inheritance: extends Element, implements Facebook\InstantArticles\Elements\Container, implements Facebook\InstantArticles\Elements\InstantArticleInterface
ファイルを表示 Open project: facebook/facebook-instant-articles-sdk-php Class Usage Examples

Public Methods

Method Description
addChild ( Element $child ) Adds new child elements to this InstantArticle
addMetaProperty ( string $property_name, string $property_content ) Adds a meta property for the of Instant Article.
create ( ) : InstantArticle Factory method
disableAutomaticAdPlacement ( ) Use the strategy of manual ad placement
disableRTL ( ) Updates article to use LTR orientation (default), disabling RTL.
enableAutomaticAdPlacement ( ) Use the strategy of auto ad placement
enableRTL ( ) Updates article to use RTL orientation.
getCanonicalURL ( ) : string
getChildren ( ) : array
getContainerChildren ( )
getFooter ( ) : Facebook\InstantArticles\Elements\Footer
getHeader ( ) : Facebook\InstantArticles\Elements\Header
isValid ( )
render ( $doctype = '<!doctype html>', $format = false )
toDOMElement ( $document = null )
unshiftChild ( $child ) Adds new child elements to the front of this InstantArticle
withCanonicalURL ( string $url ) Sets the canonical URL for the Instant Article. It is REQUIRED.
withCharset ( string $charset ) Sets the charset for the Instant Article. utf-8 by default.
withFooter ( Facebook\InstantArticles\Elements\Footer $footer ) Sets the footer content to this InstantArticle
withHeader ( Facebook\InstantArticles\Elements\Header $header ) Sets the header content to this InstantArticle
withStyle ( string $style ) Sets the style to be applied to this Instant Article

Private Methods

Method Description
__construct ( ) : InstantArticle Private constructor. It must be used the Factory method
createMetaElement ( $document, $property_name, $property_content )

Method Details

addChild() public method

Adds new child elements to this InstantArticle
public addChild ( Element $child )
$child Element to be added to this Article.

addMetaProperty() public method

Adds a meta property for the of Instant Article.
public addMetaProperty ( string $property_name, string $property_content )
$property_name string name of meta attribute
$property_content string content of meta attribute

create() public static method

Factory method
public static create ( ) : InstantArticle
return InstantArticle object.

disableAutomaticAdPlacement() public method

Use the strategy of manual ad placement

disableRTL() public method

Updates article to use LTR orientation (default), disabling RTL.
public disableRTL ( )

enableAutomaticAdPlacement() public method

Use the strategy of auto ad placement

enableRTL() public method

Updates article to use RTL orientation.
public enableRTL ( )

getCanonicalURL() public method

public getCanonicalURL ( ) : string
return string canonicalURL from the InstantArticle

getChildren() public method

public getChildren ( ) : array
return array

getContainerChildren() public method

getFooter() public method

public getFooter ( ) : Facebook\InstantArticles\Elements\Footer
return Facebook\InstantArticles\Elements\Footer footer element from the InstantArticle

getHeader() public method

public getHeader ( ) : Facebook\InstantArticles\Elements\Header
return Facebook\InstantArticles\Elements\Header header element from the InstantArticle

isValid() public method

public isValid ( )

render() public method

public render ( $doctype = '<!doctype html>', $format = false )

toDOMElement() public method

public toDOMElement ( $document = null )

unshiftChild() public method

Adds new child elements to the front of this InstantArticle
public unshiftChild ( $child )

withCanonicalURL() public method

Sets the canonical URL for the Instant Article. It is REQUIRED.
public withCanonicalURL ( string $url )
$url string The canonical url of article. Ie: http://domain.com/article.html

withCharset() public method

Sets the charset for the Instant Article. utf-8 by default.
public withCharset ( string $charset )
$charset string The charset of article. Ie: "iso-8859-1"

withFooter() public method

Sets the footer content to this InstantArticle
public withFooter ( Facebook\InstantArticles\Elements\Footer $footer )
$footer Facebook\InstantArticles\Elements\Footer to be added to this Article.

withHeader() public method

Sets the header content to this InstantArticle
public withHeader ( Facebook\InstantArticles\Elements\Header $header )
$header Facebook\InstantArticles\Elements\Header to be added to this Article.

withStyle() public method

Sets the style to be applied to this Instant Article
public withStyle ( string $style )
$style string Name of the style