Tool
in
Tags
Table of Contents
Methods
- fromFile() : InlineTool
- Loads a inline tool from inline tool definition file
- getConfig() : array<string|int, mixed>
- Returns this inline tool's configuration
- getIdentifier() : string
- Returns this inline tool's identifier
- getScript() : string
- Returns this inline tool's script
- getStyle() : string
- Returns this inline tool's style
- getTemplate() : string
- Returns this inline tool's markup template
- isDefault() : true
- Returns whether this block type is a system or user-defined
- render() : string
- Renders this inline tool for given data for front-end
Methods
fromFile()
Loads a inline tool from inline tool definition file
public
static fromFile(SplFileInfo $file, bool $default) : InlineTool
Parameters
- $file : SplFileInfo
-
File to load
- $default : bool
-
Whether this is a system or user-defined block type
Tags
Return values
InlineTool —InlineTool loaded from given file
getConfig()
Returns this inline tool's configuration
public
getConfig() : array<string|int, mixed>
Return values
array<string|int, mixed> —Configuration for this inline tool
getIdentifier()
Returns this inline tool's identifier
public
getIdentifier() : string
Return values
string —InlineTool identifier
getScript()
Returns this inline tool's script
public
getScript(bool $frontend) : string
Parameters
- $frontend : bool
-
Whether to return scripts for frontend or backend
Return values
string —JS scripts for this inline tool
getStyle()
Returns this inline tool's style
public
getStyle(bool $frontend) : string
Parameters
- $frontend : bool
-
Whether to return styles for frontend or backend
Return values
string —CSS styles for this inline tool
getTemplate()
Returns this inline tool's markup template
public
getTemplate(bool $frontend) : string
Parameters
- $frontend : bool
-
Whether to return template for frontend or backend
Return values
string —Unparsed markup
isDefault()
Returns whether this block type is a system or user-defined
public
isDefault() : true
Return values
true —if this is a system block type, false otherwise
render()
Renders this inline tool for given data for front-end
public
render(stdClass|null $data) : string
We intentionally do not use Sigma here because:
- We can keep the code close to the JS code parsing this in backend (ClxBlock.js)
- We avoid any Widgets or other hooks from interfering
Parameters
- $data : stdClass|null
-
The block data to render
Return values
string —Rendered markup