Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Classes/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ class Template
*/
protected $childNodes;

/**
* Options can be used to configure third party processing
*
* @var array
*/
protected $options;

/**
* @var string
*/
Expand Down Expand Up @@ -67,6 +74,7 @@ class Template
* @param string $name
* @param array $properties
* @param array<Template> $childNodes
* @param array $options
* @param string $when
* @param string $withItems
*/
Expand All @@ -75,13 +83,15 @@ public function __construct(
$name = null,
array $properties = [],
array $childNodes = [],
array $options = [],
$when = null,
$withItems = null
) {
$this->type = $type;
$this->name = $name;
$this->properties = $properties;
$this->childNodes = $childNodes;
$this->options = $options;
$this->when = $when;
$this->withItems = $withItems;
}
Expand All @@ -107,6 +117,8 @@ public function apply(NodeInterface $node, array $context)
foreach ($this->childNodes as $childNodeTemplate) {
$childNodeTemplate->createOrFetchAndApply($node, $context);
}

$this->emitNodeTemplateApplied($node, $context, $this->options);
}

/**
Expand Down Expand Up @@ -200,4 +212,18 @@ protected function setProperties(NodeInterface $node, array $context)
}
}
}

/**
* Signals that a node template has been applied to the given node.
*
* @param NodeInterface $node
* @param array $context
* @param array $options
* @return void
* @Flow\Signal
* @api
*/
public function emitNodeTemplateApplied(NodeInterface $node, array $context, array $options)
{
}
}