File: D:/HostingSpaces/SBogers10/topswtwmobile.komma.pro/app/controllers/HomeController.php
<?php
use KommaApp\Shop\Categories\CategoryRepository;
use KommaApp\Shop\Pages\PageService;
use KommaApp\Shop\Modules\Kiyoh\KiyohService;
class HomeController extends BaseController
{
/**
* @var CategoryRepository
*/
private $categoryRepository;
/**
* @var PageService
*/
private $pageService;
private $kiyohService;
/**
* @param PageService $pageService
* @param CategoryRepository $categoryRepository
*/
public function __construct(PageService $pageService, CategoryRepository $categoryRepository, KiyohService $kiyohService)
{
$this->kiyohService = $kiyohService;
$this->categoryRepository = $categoryRepository;
$this->pageService = $pageService;
}
public function index()
{
$categories = $this->categoryRepository->getOnHomepage();
$pageId = $this->routeData->routable->page_id;
$node = $this->pageService->getNodeById($pageId);
return View::make( viewPrefix() . 'pages.home' )
->with('bodyClasses', 'home')
->withEntity($node)
->withCategories($categories)
->withKiyoh($this->kiyohService)
->withStreamer(true);
}
}