Neos\Neos\Service\Controller\NodeController::copyAndRenderAction PHP Method

copyAndRenderAction() public method

Copies the given node before, into or after the target node depending on the given position and renders it's content collection.
public copyAndRenderAction ( Node $node, Node $targetNode, string $position, string $typoScriptPath, string $nodeName = null ) : void
$node Neos\ContentRepository\Domain\Model\Node The node to be copied
$targetNode Neos\ContentRepository\Domain\Model\Node The target node to be copied "to", see $position
$position string Where the node should be added in relation to $targetNode (allowed: before, into, after)
$typoScriptPath string The TypoScript path of the collection
$nodeName string Optional node name (if empty random node name will be generated)
return void
    public function copyAndRenderAction(Node $node, Node $targetNode, $position, $typoScriptPath, $nodeName = null)
    {
        $copiedNode = $this->nodeOperations->copy($node, $targetNode, $position, $nodeName);
        $this->redirectToRenderNode($copiedNode, $typoScriptPath);
    }