Skip to content

Commit 969ed7e

Browse files
committed
Add HomepageController
1 parent 1c7bfad commit 969ed7e

File tree

2 files changed

+39
-4
lines changed

2 files changed

+39
-4
lines changed

config/services/controller.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,23 @@
1818
>
1919
<services>
2020
<defaults public="true" />
21+
22+
<service id="sylius.controller.shop.currency_switch" class="Sylius\LegacyBridgePlugin\Controller\CurrencySwitchController">
23+
<argument type="service" id="twig" />
24+
<argument type="service" id="sylius.context.currency" />
25+
<argument type="service" id="sylius.storage.currency" />
26+
<argument type="service" id="sylius.context.channel" />
27+
</service>
28+
2129
<service id="sylius.controller.shop.locale_switch" class="Sylius\LegacyBridgePlugin\Controller\LocaleSwitchController">
2230
<argument type="service" id="twig" />
2331
<argument type="service" id="sylius.context.locale" />
2432
<argument type="service" id="sylius.provider.locale" />
2533
<argument type="service" id="sylius_shop.locale_switcher" />
2634
</service>
2735

28-
<service id="sylius.controller.shop.currency_switch" class="Sylius\LegacyBridgePlugin\Controller\CurrencySwitchController">
36+
<service id="sylius.controller.shop.homepage" class="Sylius\LegacyBridgePlugin\Controller\HomepageController">
2937
<argument type="service" id="twig" />
30-
<argument type="service" id="sylius.context.currency" />
31-
<argument type="service" id="sylius.storage.currency" />
32-
<argument type="service" id="sylius.context.channel" />
3338
</service>
3439

3540
<service id="sylius.controller.shop.security_widget" class="Sylius\LegacyBridgePlugin\Controller\SecurityWidgetController">
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Sylius package.
5+
*
6+
* (c) Sylius Sp. z o.o.
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Sylius\LegacyBridgePlugin\Controller;
15+
16+
use Symfony\Component\HttpFoundation\Request;
17+
use Symfony\Component\HttpFoundation\Response;
18+
use Twig\Environment;
19+
20+
final class HomepageController
21+
{
22+
public function __construct(private Environment $templatingEngine)
23+
{
24+
}
25+
26+
public function indexAction(Request $request): Response
27+
{
28+
return new Response($this->templatingEngine->render('@SyliusShop/Homepage/index.html.twig'));
29+
}
30+
}

0 commit comments

Comments
 (0)