PHP Class Apple_Exporter\Component_Factory

Since: 0.2.0
Show file Open project: alleyinteractive/apple-news Class Usage Examples

Public Methods

Method Description
get_component ( string $shortname, string $html ) : Component Get a component.
get_components_from_node ( DomNode $node ) : array Given a node, returns an array of all the components inside that node. If the node is a component itself, returns an array of only one element.
initialize ( Workspace $workspace, Settings $settings, Component_Text_Styles $styles, Component_Layouts $layouts ) Initialize the component factory.

Private Methods

Method Description
register_component ( string $shortname, string $classname ) Register a component.

Method Details

get_component() public static method

Get a component.
public static get_component ( string $shortname, string $html ) : Component
$shortname string
$html string
return Component

get_components_from_node() public static method

Given a node, returns an array of all the components inside that node. If the node is a component itself, returns an array of only one element.
public static get_components_from_node ( DomNode $node ) : array
$node DomNode
return array

initialize() public static method

Initialize the component factory.
public static initialize ( Workspace $workspace, Settings $settings, Component_Text_Styles $styles, Component_Layouts $layouts )
$workspace Workspace
$settings Settings
$styles Component_Text_Styles
$layouts Component_Layouts