Passed
Push — master ( 9e4a0d...17c1af )
by Aimeos
05:26
created

CheckoutController::updateComponentAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @license MIT, http://opensource.org/licenses/MIT
5
 * @copyright Aimeos (aimeos.org), 2014-2016
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 checkout related functionality.
19
 *
20
 * @package symfony
21
 * @subpackage Controller
22
 */
23
class CheckoutController extends Controller
24
{
25
	/**
26
	 * Returns the html for the checkout confirmation page.
27
	 *
28
	 * @return Response Response object containing the generated output
29
	 */
30
	public function confirmAction() : Response
31
	{
32
		$params = [];
33
		$shop = $this->container->get( 'shop' );
34
35
		foreach( $this->container->getParameter( 'aimeos_shop.page' )['checkout-confirm'] 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/Checkout/confirm.html.twig', $params );
42
		$response->headers->set( 'Cache-Control', 'no-store, max-age=0' );
43
		return $response;
44
	}
45
46
47
	/**
48
	 * Returns the html for the standard checkout page.
49
	 *
50
	 * @return Response Response object containing the generated output
51
	 */
52
	public function indexAction() : Response
53
	{
54
		$params = [];
55
		$shop = $this->container->get( 'shop' );
56
57
		foreach( $this->container->getParameter( 'aimeos_shop.page' )['checkout-index'] as $name )
58
		{
59
			$params['aiheader'][$name] = $shop->get( $name )->getHeader();
60
			$params['aibody'][$name] = $shop->get( $name )->getBody();
61
		}
62
63
		$response = $this->render( '@AimeosShop/Checkout/index.html.twig', $params );
64
		$response->headers->set( 'Cache-Control', 'no-store, max-age=0' );
65
		return $response;
66
	}
67
68
69
	/**
70
	 * Returns the view for the order update page.
71
	 *
72
	 * @return Response Response object containing the generated output
73
	 */
74
	public function updateAction() : Response
75
	{
76
		$params = [];
77
		$shop = $this->container->get( 'shop' );
78
79
		foreach( $this->container->getParameter( 'aimeos_shop.page' )['checkout-update'] as $name )
80
		{
81
			$params['aiheader'][$name] = $shop->get( $name )->getHeader();
82
			$params['aibody'][$name] = $shop->get( $name )->getBody();
83
		}
84
85
		$response = $this->render( '@AimeosShop/Checkout/update.html.twig', $params );
86
		$response->headers->set( 'Cache-Control', 'no-store, max-age=0' );
87
		return $response;
88
	}
89
90
91
}
92