Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 13.4] [TASK] Prefer "Autoconfigure" attribute over the Services.yaml configuration #4943

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions Documentation/ApiOverview/Seo/PageTitleApi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,9 @@ example the site title, you can implement a page title provider as follows:
The :ref:`frontend.page.information attribute <typo3-request-attribute-frontend-page-information>`
has been introduced.

As we need to :ref:`inject <DependencyInjection>` the class :php:`SiteFinder`
to retrieve the current site configuration, we must make the new page title
provider :ref:`public <knowing-what-to-make-public>`:

.. literalinclude:: _ExampleWebsiteTitle/_Services.yaml
:language: yaml
:caption: EXT:my_sitepackage/Configuration/Services.yaml
The class must be set to :ref:`public <t3coreapi:What-to-make-public>`, because
we :ref:`inject <DependencyInjection>` the class :php:`SiteFinder` as
dependency.

Then **flush the cache** in :guilabel:`Admin Tools > Maintenance > Flush TYPO3
and PHP Cache`.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
namespace MyVendor\MySitepackage\PageTitle;

use Psr\Http\Message\ServerRequestInterface;
use Symfony\Component\DependencyInjection\Attribute\Autoconfigure;
use TYPO3\CMS\Core\PageTitle\PageTitleProviderInterface;
use TYPO3\CMS\Core\Site\SiteFinder;
use TYPO3\CMS\Frontend\Page\PageInformation;

#[Autoconfigure(public: true)]
final readonly class WebsiteTitleProvider implements PageTitleProviderInterface
{
public function __construct(
Expand Down
Loading