public function ParagraphController::deleteParagraph in Paragraphs admin 8
Deletes paragraph content.
Parameters
\Drupal\paragraphs\ParagraphInterface $paragraph: Paragraph to be deleted.
1 string reference to 'ParagraphController::deleteParagraph'
File
- src/
Controller/ ParagraphController.php, line 47
Class
- ParagraphController
- Controller for paragraphs admin.
Namespace
Drupal\paragraphs_admin\ControllerCode
public function deleteParagraph(ParagraphInterface $paragraph) {
$pid = $paragraph
->id();
$paragraph
->delete();
$this->messenger
->addMessage($this
->t('Paragraph @pid deleted.', [
'@pid' => $pid,
]));
// Redirect back to view node page.
return $this
->redirect('view.paragraphs.page_admin_paragraphs');
}