---
title: "PHP and TypoScript"
manual: "TypoScript Explained"
version: "13.4"
permalink: "https://docs.typo3.org/permalink/t3tsref:appendix-a@13.4"
source: "AppendixA/Index.rst"
rendered: "2026-10-01T05:02:42+00:00"
---

# PHP and TypoScript {#appendix-a}

## ContentObjectRenderer {#content-object-renderer}

### `ContentObjectRenderer::cObjGetSingle(value, properties[, TSkey = '__'])` {#appendix-include-cobjgetsingle}

A method of `\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer`.
Gets a content object from the `$conf` array.

#### Example: {#example}

```php
$content = $cObjectRenderer->cObjGetSingle($conf['image'], $conf['image.'], 'My Image 2');
```

This would return any IMAGE cObject at the property `image` of the
`$conf` array for the include script!

### `ContentObjectRenderer::stdWrap(value, properties)` {#appendix-include-stdwrap}

A method of `\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer`.

Hands the content in "value" to the stdWrap function, which will
process it according to the configuration of the array "properties".

#### Example: {#example-1}

```php
$content = $cObjectRenderer->stdWrap($content, $conf['stdWrap.']);
```

This will stdWrap the content with the properties of `.stdWrap` of the
`$conf` array!

## TypoScriptFrontendController, TSFE {#typoscript-frontend-controller}

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

The class \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
and its global instance $GLOBALS['TSFE'] have been marked as
deprecated. The class will be removed with TYPO3 v14.

You can retrieve the `\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController`
via the [request](https://docs.typo3.org/m/typo3/reference-coreapi/13.4/en-us/ApiOverview/RequestLifeCycle/Typo3Request.html#typo3-request) attribute
[frontend.controller](https://docs.typo3.org/m/typo3/reference-coreapi/13.4/en-us/ApiOverview/RequestLifeCycle/RequestAttributes/FrontendController.html#typo3-request-attribute-frontend-controller).

For instance, if you want to access the variable `id`, you can do so by
writing: `TypoScriptFrontendController->id`.

### TypoScriptFrontendController->id {#appendix-include-tsfe-id}

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

The property has been marked as read-only. Use
$request->getAttribute('frontend.page.information')->getId()
instead. See Frontend page information.

-   **id**

    -   *Type:* integer

    The current page id

### TypoScriptFrontendController->type {#appendix-include-tsfe-type}

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

The property has been removed with TYPO3 v13.0. See
Migration

-   **type**

    -   *Type:* integer

#### Migration from `$GLOBALS['TSFE']->type` {#appendix-include-tsfe-type-migration}

When using this property in PHP code via `$GLOBALS['TSFE']->type`,
it is recommended to move to the
[PSR-7 request](https://docs.typo3.org/m/typo3/reference-coreapi/13.4/en-us/ApiOverview/RequestLifeCycle/Typo3Request.html#typo3-request) via
`$request->getAttribute('routing')->getPageType()`.

### TypoScriptFrontendController->page {#appendix-include-tsfe-page}

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

The property has been marked as read-only. Use
$request->getAttribute('frontend.page.information')->getPageRecord()
instead. See Frontend page information.

-   **page**

    -   *Type:* array

    The page record

### TypoScriptFrontendController->feuser {#appendix-include-tsfe-feuser}

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

The variable has been removed with TYPO3 v13. See
Migration

-   **fe_user**

    -   *Type:* array

    The frontend user record

#### Migration: Use UserAspect or context instead of `$GLOBALS['TSFE']->fe_user` {#appendix-include-tsfe-feuser-migration}

There are two possible migrations.

First, a limited information list of frontend user details can be
retrieved using the [Context](https://docs.typo3.org/m/typo3/reference-coreapi/13.4/en-us/ApiOverview/Context/Index.html#context-api) aspect
`frontend.user` in frontend calls. See class
`\TYPO3\CMS\Core\Context\UserAspect` for a full list. The current
context can be retrieved using
[dependency injection](https://docs.typo3.org/m/typo3/reference-coreapi/13.4/en-us/ApiOverview/DependencyInjection/Index.html#DependencyInjection).
Example:

**EXT:my_extension/Classes/Controller/MyExtensionController.php**

```php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\Controller;

use TYPO3\CMS\Core\Context\Context;

final class MyExtensionController
{
  public function __construct(
    private readonly Context $context,
  ) {}

  public function myAction()
  {
    $frontendUserUsername = $this->context->getPropertyFromAspect(
      'frontend.user',
      'username',
      '',
    );
  }
}

```

Additionally, the full `\TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication`
object is available as [request](https://docs.typo3.org/m/typo3/reference-coreapi/13.4/en-us/ApiOverview/RequestLifeCycle/Typo3Request.html#typo3-request) attribute
[frontend.user](https://docs.typo3.org/m/typo3/reference-coreapi/13.4/en-us/ApiOverview/RequestLifeCycle/RequestAttributes/FrontendUser.html#typo3-request-attribute-frontend-user)
in the frontend. Note some details of that object are marked
`@internal`, using the context aspect is thus the preferred way.
Example of an extension using the Extbase's `ActionController`:

**EXT:my_extension/Classes/Controller/MyExtensionController.php**

```php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\Controller;

use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;

final class MyExtensionController extends ActionController
{
  public function myAction(): ResponseInterface
  {
    // Note the 'user' property is marked @internal.
    $frontendUserUsername = $this->request
        ->getAttribute('frontend.user')->user['username'];
    $this->view->assign('username', $frontendUserUsername);
    return $this->htmlResponse();
  }
}

```

### TypoScriptFrontendController->rootLine {#appendix-include-tsfe-rootline}

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

The property has been marked as read-only. Use
$request->getAttribute('frontend.page.information')->getRootLine()
instead. See Frontend page information.

-   **rootLine**

    -   *Type:* array

    The root line (all the way to tree root, not only the current site!).

    The current site root line is available via
    `$request->getAttribute('frontend.page.information')->getLocalRootLine()`.
    See [Frontend page information](https://docs.typo3.org/m/typo3/reference-coreapi/13.4/en-us/ApiOverview/RequestLifeCycle/RequestAttributes/FrontendPageInformation.html#typo3-request-attribute-frontend-page-information).

    In TYPO3 versions before v13 the current site root line was only available
    via `\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->config['rootLine']`.

### TypoScriptFrontendController->table-row {#appendix-include-tsfe-table-row}

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

The property has been marked as read-only. Avoid usages altogether,
create own instances of the
\TYPO3\CMS\Core\Domain\Repository\PageRepository when needed.

-   **rootLine**

    -   *Type:* object

    The object with page functions (object) See
    `EXT:core/Classes/Domain/Repository/PageRepository.php`.
