CSSmartMacros
in package
Represents an api class to deal with Smart Macros
Tags
Table of Contents
- MACRO_PLACEHOLDER_PREFIX = '{MACRO_'
- MACRO_PLACEHOLDER_SUFFIX = '}'
- createMacro() : CSSmartMacro
- Creates a new CSSmartMacro object for a given CSSmartMacroPlugin prefix
- getAvailableMacros() : array<string|int, CSSmartMacro>
- Obtains a list of all available Macros (CSSmartMacroPlugins)
- replaceMacroPlaceholdersWithMacros() : mixed
- replaceMacrosInDocument() : array<string|int, CSSmartMacro>
- When a CSSmartDocument is rendered to html first the macros are replaced by tokens and in a later step the tokens are then replaced by the macro output, depending on the target medium and use case (like html editor).
Constants
MACRO_PLACEHOLDER_PREFIX
public
mixed
MACRO_PLACEHOLDER_PREFIX
= '{MACRO_'
Tags
MACRO_PLACEHOLDER_SUFFIX
public
mixed
MACRO_PLACEHOLDER_SUFFIX
= '}'
Tags
Methods
createMacro()
Creates a new CSSmartMacro object for a given CSSmartMacroPlugin prefix
public
static createMacro(string $sType) : CSSmartMacro
Parameters
- $sType : string
-
the plugin prefix, e.g. Hello if the Plugin is implemented in HelloMacro.php
Tags
Return values
CSSmartMacro —the macro
getAvailableMacros()
Obtains a list of all available Macros (CSSmartMacroPlugins)
public
static getAvailableMacros() : array<string|int, CSSmartMacro>
Tags
Return values
array<string|int, CSSmartMacro> —array with the available macro objects
replaceMacroPlaceholdersWithMacros()
public
static replaceMacroPlaceholdersWithMacros(mixed $sHtml, mixed $aMacros[, mixed $bEditable = FALSE ][, mixed $format = NULL ]) : mixed
Parameters
- $sHtml : mixed
- $aMacros : mixed
- $bEditable : mixed = FALSE
- $format : mixed = NULL
Tags
Return values
mixed —replaceMacrosInDocument()
When a CSSmartDocument is rendered to html first the macros are replaced by tokens and in a later step the tokens are then replaced by the macro output, depending on the target medium and use case (like html editor).
public
static replaceMacrosInDocument(CSSmartDocument $oDocument) : array<string|int, CSSmartMacro>
This method replaces the macros by tokens in the passed document first and returns the macro objects.
Parameters
- $oDocument : CSSmartDocument
Tags
Return values
array<string|int, CSSmartMacro> —array with the replaced macros?
