Passed
Push — master ( df512e...3ff0f7 )
by Aimeos
16:16
created

SupplierController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 21
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A detailAction() 0 14 2
1
<?php
2
3
/**
4
 * @license MIT, http://opensource.org/licenses/MIT
5
 * @copyright Aimeos (aimeos.org), 2014-2020
6
 * @package symfony
7
 * @subpackage Controller
8
 */
9
10
11
namespace Aimeos\ShopBundle\Controller;
12
13
use Symfony\Component\HttpFoundation\Response;
14
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
15
16
17
/**
18
 * Aimeos controller for supplier related functionality.
19
 *
20
 * @package symfony
21
 * @subpackage Controller
22
 */
23
class SupplierController extends Controller
24
{
25
	/**
26
	 * Returns the html for the supplier detail page.
27
	 *
28
	 * @return Response Response object containing the generated output
29
	 */
30
	public function detailAction() : Response
31
	{
32
		$params = [];
33
		$shop = $this->container->get( 'shop' );
34
35
		foreach( $this->container->getParameter( 'aimeos_shop.page' )['supplier-detail'] as $name )
36
		{
37
			$params['aiheader'][$name] = $shop->get( $name )->getHeader();
38
			$params['aibody'][$name] = $shop->get( $name )->getBody();
39
		}
40
41
		$response = $this->render( '@AimeosShop/Supplier/detail.html.twig', $params );
42
		$response->headers->set( 'Cache-Control', 'private, max-age=10' );
43
		return $response;
44
	}
45
}
46