프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$anchor_position | integer | Anchorable components are anchored to the previous element that appears in the position specified. If the previous element is an advertisement, attaches to the next instead of the previous element. | |
$needs_layout_if_anchored | boolean | Right now, the only component that sets this to false is the body, as it doesn't need a special layout for anchoring, it just flows around anchored components. |
프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$can_be_anchor_target | boolean | Whether this component can be an anchor target. | |
$json | array | JSON for this component. | |
$layouts | Component_Layouts | Layouts for this component. | |
$settings | Settings | Settings for this component. | |
$styles | Component_Text_Styles | Styles for this component. | |
$text | string | Text for this component. | |
$workspace | Workspace | Workspace for this component. |
메소드 | 설명 | |
---|---|---|
__construct ( string $text, Workspace $workspace, Settings $settings, Component_Text_Styles $styles, Component_Layouts $layouts, Markdown $markdown = null ) | Constructor. | |
anchor ( ) | Sets the anchor layout for this component | |
can_be_anchor_target ( ) : boolean | Check if it's can_be_anchor_target and it hasn't been anchored already. | |
get_anchor_position ( ) : integer | Get the anchor position. | |
get_component_name ( ) : string | Gets the name of this component from the class name. | |
get_json ( string $name ) : mixed | Get a JSON value | |
is_anchor_target ( ) : boolean | All components that are anchor target have an UID. Return whether this component is an anchor target. | |
node_matches ( DomNode $node ) : mixed | Given a DomNode, if it matches the component, return the relevant node to work on. Otherwise, return null. | |
set_anchor_position ( integer $position ) | Set the anchor position. | |
set_json ( string $name, mixed $value ) | Set a JSON value. | |
to_array ( ) : array | Transforms HTML into an array that describes the component using the build function. | |
uid ( ) : string | Get the current UID. |
메소드 | 설명 | |
---|---|---|
build ( string $text ) | This function is in charge of transforming HTML into a Article Format valid array. | |
bundle_source ( string $filename, string $source ) | Calls the current workspace bundle_source method to allow for different implementations of the bundling technique. | |
clean_html ( string $html ) : string | Use PHP's HTML parser to generate valid HTML out of potentially broken input. | |
find_text_alignment ( ) : string | Some components follow this rule: 1. If the body is centered, text here should be centered too 2. Otherwise, align left | |
get_setting ( string $name ) : mixed | Gets an exporter setting. | |
maybe_bundle_source ( string $source, string $filename = null ) : string | Maybe bundles the source based on current settings. | |
node_has_class ( DomNode $node, string $classname ) : boolean | Check if a node has a class. | |
register_full_width_layout ( string $name, array $spec ) | Register a new layout which will be displayed as full-width, so no need to specify columnStart and columnSpan in the layout specs. This is useful because when the body is centered, the full-width layout spans the same columns as the body. | |
register_layout ( string $name, array $spec ) | Using the layouts service, register a new layout. | |
register_style ( string $name, array $spec ) | Using the style service, register a new style. | |
remote_file_exists ( DomNode $node ) : boolean | Check if the remote file exists for this node. | |
set_setting ( string $name, mixed $value ) : boolean | Sets an exporter setting. |
public __construct ( string $text, Workspace $workspace, Settings $settings, Component_Text_Styles $styles, Component_Layouts $layouts, Markdown $markdown = null ) | ||
$text | string | |
$workspace | Workspace | |
$settings | Settings | |
$styles | Component_Text_Styles | |
$layouts | Component_Layouts | |
$markdown | Markdown |
protected bundle_source ( string $filename, string $source ) | ||
$filename | string | The name of the file to be created |
$source | string | The path or URL of the resource which is going to be bundled |
public can_be_anchor_target ( ) : boolean | ||
리턴 | boolean |
protected static clean_html ( string $html ) : string | ||
$html | string | |
리턴 | string |
protected find_text_alignment ( ) : string | ||
리턴 | string |
public get_anchor_position ( ) : integer | ||
리턴 | integer |
public get_component_name ( ) : string | ||
리턴 | string |
protected get_setting ( string $name ) : mixed | ||
$name | string | |
리턴 | mixed |
public is_anchor_target ( ) : boolean | ||
리턴 | boolean |
protected static node_has_class ( DomNode $node, string $classname ) : boolean | ||
$node | DomNode | |
$classname | string | |
리턴 | boolean |
public static node_matches ( DomNode $node ) : mixed | ||
$node | DomNode | |
리턴 | mixed |
protected register_full_width_layout ( string $name, array $spec ) | ||
$name | string | |
$spec | array |
protected register_layout ( string $name, array $spec ) | ||
$name | string | |
$spec | array |
protected register_style ( string $name, array $spec ) | ||
$name | string | |
$spec | array |
protected static remote_file_exists ( DomNode $node ) : boolean | ||
$node | DomNode | |
리턴 | boolean |
public set_anchor_position ( integer $position ) | ||
$position | integer |
public int $anchor_position | ||
리턴 | integer |
protected bool $can_be_anchor_target | ||
리턴 | boolean |
protected Component_Layouts $layouts | ||
리턴 | Component_Layouts |
public bool $needs_layout_if_anchored | ||
리턴 | boolean |
protected Component_Text_Styles $styles | ||
리턴 | Component_Text_Styles |