---
title: "Clipboard"
manual: "TYPO3 Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3coreapi:examples-clipboard-put@main"
source: "ApiOverview/Backend/Clipboard.rst"
modified: "2026-09-16T09:14:56+00:00"
---

# Clipboard

> [!NOTE]
> The class `\TYPO3\CMS\Backend\Clipboard\Clipboard` is marked
> `@internal`. It is a specific Backend implementation and is not
> considered part of the Public TYPO3 API. It might change without notice.

You can easily access the internal clipboard in TYPO3 from your
backend modules:

**Extension examples, file Classes/Controller/ModuleController.php**

```php
<?php

use TYPO3\CMS\Backend\Clipboard\Clipboard;
use TYPO3\CMS\Core\Utility\DebugUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;

class ModuleController extends ActionController implements LoggerAwareInterface
{
  protected function debugClipboard()
  {
    /** @var $clipboard Clipboard */
    $clipboard = GeneralUtility::makeInstance(Clipboard::class);
    // Read the clipboard content from the user session
    $clipboard->initializeClipboard();
    DebugUtility::debug($clipboard->clipData);
  }
}

```

In this simple piece of code we instantiate a clipboard object and make it
load its content. We then dump this content into the BE module's debug
window, with the following result:

![](../../Images/ManualScreenshots/Examples/Clipboard/ClipboardDump.png)

This tells us what objects are registered on the default tab ("normal")
(a content element with id 216 in "copy" mode) and the numeric tabs (which can
each contain more than one element). It also tells us that the current
tab is number 2. We can compare with the BE view of the clipboard:

![](../../Images/ManualScreenshots/Examples/Clipboard/ClipboardContent.png)

which indeed contains two files.

Clipboard content should not be accessed directly, but using the
`elFromTable()` method of the clipboard object:

**Extension examples, file Classes/Controller/ModuleController.php**

```php
<?php

use TYPO3\CMS\Backend\Clipboard\Clipboard;
use TYPO3\CMS\Core\Utility\GeneralUtility;

class ModuleController extends ActionController implements LoggerAwareInterface
{
  protected function getCurrentClipboard(): array
  {
    /** @var $clipboard Clipboard */
    $clipboard = GeneralUtility::makeInstance(Clipboard::class);
    // Read the clipboard content from the user session
    $clipboard->initializeClipboard();
    // Access files and pages content of current pad
    $clipboardContent = [
      'files' => $clipboard->elFromTable('_FILE'),
      'pages' => $clipboard->elFromTable('pages'),
    ];
    return $clipboardContent;
  }
}

```

Here we first try to get all files and then all page records on the
current pad (which is pad 2). Then we change to the "Normal" pad, call
the `elFromTable()` method again.

In the "examples" extension, this data is passed to a BE module view
for display, which is really just information:

![](../../Images/ManualScreenshots/Examples/Clipboard/ClipboardItems.png)
