---
title: "Frontend requests"
manual: "TYPO3 Explained"
version: "14.3"
permalink: "https://docs.typo3.org/permalink/t3coreapi:frontend-requests@14.3"
source: "ApiOverview/RequestLifeCycle/FrontendRequest.rst"
rendered: "2026-10-01T15:20:05+00:00"
---

# Frontend requests {#frontend-requests}

When handling **frontend web requests**, TYPO3 automatically sets up a rich
context that is used to render content and generate links. Several
objects are created and configured during this process:

-   **ContentObjectRenderer (cObj)** – Responsible for processing
    TypoScript-based rendering, including
    [typolink](https://docs.typo3.org/permalink/t3tsref:typolink) and other link generation tasks.
-   **page Attribute** – Holds the current page context and is used by many
    rendering processes.
-   **PageInformation Object**: Provides additional metadata about the current
    page.
-   **Router**: Ensures proper URL resolution.
-   **FrontendTypoScriptFactory**: Collects
    TypoScript and provides settings like `linkAccessRestrictedPages` and
    `typolinkLinkAccessRestrictedPages`.

These components work together only because the frontend request bootstrap
initializes them with all the necessary data.

## Limitations when there is no frontend request {#frontend-requests-outside}

When executing code **outside** of a frontend request (for example, in a CLI
command), this context is missing:

-   The  `\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer`
    can be instantiated manually, but it will
    not have a populated `data` array because there is no `tt_content` record.
    As a result, TypoScript properties like `field = my_field` or `data = my_data`
    will not work as expected.
-   The `\TYPO3\CMS\Core\TypoScript\FrontendTypoScriptFactory`
    is not set up.

Understanding this difference is crucial when writing custom code that depends
on frontend rendering behavior but runs in a different context.

## Simulating a frontend request {#frontend-requests-simulation}

It may be necessary to simulate a frontend request to make certain
functionality available where it would usually not be available.

For example, you might need to simulate a frontend request to be able to send a
[FluidEmail](https://docs.typo3.org/permalink/t3coreapi:mail-fluid-email@14.3)
from a CLI / Console command context.

To simulate a frontend request you need, at a minimum, a site. If the current site is
not defined you can use the [SiteFinder](https://docs.typo3.org/permalink/t3coreapi:sitehandling-sitefinder-object@14.3)
to find one.

The following example demonstrates how to set up a basic frontend request with
`applicationType` and `site` attributes:

**EXT:my_extension/Classes/Service/MyClass.php**

```php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\Service;

use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder;
use TYPO3\CMS\Core\Http\ServerRequest;
use TYPO3\CMS\Core\Site\SiteFinder;

final readonly class MyClass
{
  public function __construct(
    private SiteFinder $siteFinder,
  ) {}

  public function createRequest(): ServerRequestInterface
  {
    $site = $this->siteFinder->getSiteByPageId(1);
    return (new ServerRequest())
      ->withAttribute(
        'applicationType',
        SystemEnvironmentBuilder::REQUESTTYPE_FE,
      )
      ->withAttribute('site', $site);
  }
}

```

For a complete example on how to send a FluidEmail with a console command see
[Example: Sending a FluidEmail via console command](https://docs.typo3.org/permalink/t3coreapi:console-command-tutorial-fe-request-example@14.3).

At this stage, the simulated frontend request still lacks page-related
information and does not load TypoScript. It is still only a simplified simulation.

If you rely on any of these methods you will need to bootstrap them before using
them.

> [!NOTE]
> There is no simple way to fully simulate a frontend request. Some aspects,
> like basic link generation, can work by manually setting request attributes.
> However, complex TypoScript-based link modifications, access restrictions,
> and context-aware rendering will not behave the same as a real web request.
