---
title: "AbstractPlugin"
manual: "TYPO3 Explained"
version: "12.4"
permalink: "https://docs.typo3.org/permalink/t3coreapi:abstractplugin@12.4"
source: "ExtensionArchitecture/HowTo/FrontendPlugin/AbstractPlugin.rst"
rendered: "2026-10-21T15:29:37+00:00"
noindex: true
---

> [!WARNING]
> **Attention**
>
> TYPO3 v12 has reached end-of-life as of April 30th 2026 and
> is no longer being maintained. Use the version switcher on the top
> left of this page to select documentation for a supported version of TYPO3.
>
> Need more time before upgrading?
> You can purchase Extended Long Term Support (ELTS) for TYPO3 v12 here:
> [TYPO3 ELTS](https://typo3.com/services/extended-support-elts).

# AbstractPlugin {#abstractplugin}

<!-- TODO: no Markdown rendering for "deprecated" -->

This class will be removed in TYPO3 v13.

## Migration {#migration}

Remove the dependency of `\TYPO3\CMS\Frontend\Plugin\AbstractPlugin`. If
functionality of this class is still used, copy it into your plugin.

### Example {#example}

Class before migration:

**EXT:gh_randomcontent/Classes/Plugin/RandomContent.php**

```php
class RandomContent extends AbstractPlugin
{
    public function main(string $content, array $conf) : string
    {
        $this->conf = $conf;

        $this->pi_initPIflexForm(); // Init FlexForm configuration for plugin
        if ($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'which_pages', 'sDEF')) {
            $this->conf['pages'] = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'which_pages', 'sDEF');
        }
        // ...
    }
}
```

Class after migration:

**EXT:gh_randomcontent/Classes/Plugin/RandomContent.php**

```php
class RandomContent
{
    /**
     * The back-reference to the mother cObj object set at call time
     */
    public $cObj;

    /**
     * This setter is called when the plugin is called from UserContentObject (USER)
     * via ContentObjectRenderer->callUserFunction().
     *
     * @param ContentObjectRenderer $cObj
     */
    public function setContentObjectRenderer(ContentObjectRenderer $cObj): void
    {
        $this->cObj = $cObj;
    }

    public function main(string $content, array $conf) : string
    {
         $this->conf = $conf;

        $this->pi_initPIflexForm(); // Init FlexForm configuration for plugin
        if ($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'which_pages', 'sDEF')) {
            $this->conf['pages'] = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'which_pages', 'sDEF');
        }
        // ...
    }

    /**
     * Converts $this->cObj->data['pi_flexform'] from XML string to flexForm array.
     *
     * @param string $field Field name to convert
     */
    public function pi_initPIflexForm($field = 'pi_flexform')
    {
        // ...
    }

    public function pi_getFFvalue($T3FlexForm_array, $fieldName, $sheet = 'sDEF', $lang = 'lDEF', $value = 'vDEF')
    {
        // ...
    }

}
```

It is also possible to migrate to an Extbase plugin using a controller.
See the [Extbase frontend plugins](https://docs.typo3.org/permalink/t3coreapi:extbase-registration-of-frontend-plugins@12.4).
