Completed
Push — master ( 67c4a6...e61cbc )
by Aimeos
01:50
created

CatalogController::suggestAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 7
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), 2015-2016
6
 * @package laravel
7
 * @subpackage Controller
8
 */
9
10
11
namespace Aimeos\Shop\Controller;
12
13
use Illuminate\Routing\Controller;
14
use Illuminate\Support\Facades\Response;
15
16
17
/**
18
 * Aimeos controller for catalog related functionality.
19
 *
20
 * @package laravel
21
 * @subpackage Controller
22
 */
23
class CatalogController extends Controller
24
{
25
	/**
26
	 * Returns the view for the XHR response with the counts for the facetted search.
27
	 *
28
	 * @return \Illuminate\Http\Response Response object with output and headers
29
	 */
30
	public function countAction()
31
	{
32
		$params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'catalog-count' );
33
34
		return Response::view('shop::catalog.count', $params)
35
			->header('Content-Type', 'application/javascript');
36
	}
37
38
39
	/**
40
	 * Returns the html for the catalog detail page.
41
	 *
42
	 * @return \Illuminate\Http\Response Response object with output and headers
43
	 */
44
	public function detailAction()
45
	{
46
		$params = app( 'Aimeos\Shop\Base\Page' )->getSections( 'catalog-detail' );
47
		return Response::view('shop::catalog.detail', $params);
48
	}
49
50
51
	/**
52
	 * Returns the html for the catalog list page.
53
	 *
54
	 * @return \Illuminate\Http\Response Response object with output and headers
55
	 */
56
	public function listAction()
57
	{
58
		$params = app( 'Aimeos\Shop\Base\Page' )->getSections( 'catalog-list' );
59
		return Response::view('shop::catalog.list', $params);
60
	}
61
62
63
	/**
64
	 * Returns the html body part for the catalog stock page.
65
	 *
66
	 * @return \Illuminate\Http\Response Response object with output and headers
67
	 */
68
	public function stockAction()
69
	{
70
		$params = app( 'Aimeos\Shop\Base\Page' )->getSections( 'catalog-stock' );
71
72
		return Response::view('shop::catalog.stock', $params)
73
			->header('Content-Type', 'application/javascript');
74
	}
75
76
77
	/**
78
	 * Returns the view for the XHR response with the product information for the search suggestion.
79
	 *
80
	 * @return \Illuminate\Http\Response Response object with output and headers
81
	 */
82
	public function suggestAction()
83
	{
84
		$params = app( 'Aimeos\Shop\Base\Page' )->getSections( 'catalog-suggest' );
85
86
		return Response::view('shop::catalog.suggest', $params)
87
			->header('Content-Type', 'application/json');
88
	}
89
90
91
	/**
92
	 * Returns the html for the catalog tree page.
93
	 *
94
	 * @return \Illuminate\Http\Response Response object with output and headers
95
	 */
96
	public function treeAction()
97
	{
98
		$params = app( 'Aimeos\Shop\Base\Page' )->getSections( 'catalog-tree' );
99
		return Response::view('shop::catalog.tree', $params);
100
	}
101
}