Cascade Core  v0.12-1-g22cbbeb
 All Classes Namespaces Functions Variables Pages
Static Public Member Functions | List of all members
IShebangHandler Interface Reference

Interface required by shebang handlers. More...

Inheritance diagram for IShebangHandler:
Inheritance graph

Static Public Member Functions

static createFromShebang ($block_config, $shebang_config, Context $context, $block_type)
 Factory method to create a proxy block (usualy self). More...
 

Detailed Description

Interface required by shebang handlers.

Shebang handler is usualy proxy block itself, it only needs few extra methods.

If block storage returns something without shebang specified, default shebang 'proxy' is assumed. This is for compatibility with old blocks.

/

Todo:
Add some helpers for block editor.

Member Function Documentation

static createFromShebang (   $block_config,
  $shebang_config,
Context  $context,
  $block_type 
)
static

Factory method to create a proxy block (usualy self).

Called by CascadeController::createBlockInstance() when block storage returns configuration instead of block.

Parameters
$block_configis configuration of the new block.
$shebang_configis configuration of the shebang (from core.json.php).
$contextis Context of creating block – not the context in which will be block executed.
$block_typeis type of the block (ID is not known yet).

Example: Typical implementation: return new self();

Implemented in ProxyBlock.