File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Documentation/ApiOverview/Backend Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,16 @@ An implementation of :php-short:`\TYPO3\CMS\Backend\LoginProvider\LoginProviderI
8989look like this for TYPO3 v13:
9090
9191.. literalinclude :: _LoginProvider/_MyLoginProvider.php
92+ :caption: EXT:my_extension/Classes/Login/MyLoginProvider.php
93+ :linenos:
94+
95+ The default implementation in :php-short: `\T YPO3\C MS\B ackend\L oginProvider\U sernamePasswordLoginProvider `
96+ is a good example. Extensions that need to configure additional template, layout or
97+ partial lookup paths can extend them, see lines 23-28 in the example above.
98+
99+ Consumers of :php-short: `\T YPO3\C MS\B ackend\L oginProvider\E vent\M odifyPageLayoutOnLoginProviderSelectionEvent `
100+ should use the request instead, and/or should get an instance of
101+ :php-short: `\T YPO3\C MS\C ore\P age\P ageRenderer ` injected as well.
92102
93103.. _login-provider-view :
94104
Original file line number Diff line number Diff line change 77use TYPO3 \CMS \Backend \LoginProvider \LoginProviderInterface ;
88use TYPO3 \CMS \Core \Page \PageRenderer ;
99use TYPO3 \CMS \Core \View \ViewInterface ;
10+ use TYPO3 \CMS \Fluid \View \FluidViewAdapter ;
1011
1112#[Autoconfigure(public: true )]
1213final readonly class MyLoginProvider implements LoginProviderInterface
@@ -18,6 +19,13 @@ public function __construct(
1819 public function modifyView (ServerRequestInterface $ request , ViewInterface $ view ): string
1920 {
2021 $ this ->pageRenderer ->addJsFile ('someFile ' );
22+ // Custom login provider implementations can add custom fluid lookup paths.
23+ if ($ view instanceof FluidViewAdapter) {
24+ $ templatePaths = $ view ->getRenderingContext ()->getTemplatePaths ();
25+ $ templateRootPaths = $ templatePaths ->getTemplateRootPaths ();
26+ $ templateRootPaths [] = 'EXT:my_extension/Resources/Private/Templates ' ;
27+ $ templatePaths ->setTemplateRootPaths ($ templateRootPaths );
28+ }
2129 $ view ->assign ('Some Variable ' , 'some value ' );
2230 return 'Login/MyLoginForm ' ;
2331 }
You can’t perform that action at this time.
0 commit comments