You are here

public function QuickNodeCloneNodeController::cloneNode in Quick Node Clone 8

Provides the node submission form.

Parameters

\Drupal\node\Entity\Node $node: The node entity to clone.

Return value

array A node submission form.

1 string reference to 'QuickNodeCloneNodeController::cloneNode'
quick_node_clone.routing.yml in ./quick_node_clone.routing.yml
quick_node_clone.routing.yml

File

src/Controller/QuickNodeCloneNodeController.php, line 74

Class

QuickNodeCloneNodeController
Returns responses for Quick Node Clone Node routes.

Namespace

Drupal\quick_node_clone\Controller

Code

public function cloneNode(Node $node) {
  if (!empty($node)) {
    $form = $this
      ->entityFormBuilder()
      ->getForm($node, 'quick_node_clone');
    return $form;
  }
  else {
    throw new NotFoundHttpException();
  }
}