File: D:/HostingSpaces/SBogers106/rvt-trainingen.nl/app/Komma/Services/ServiceController.php
<?php
/**
* Short description for the file.
*
* @author Komma <support@komma.pro>
* @copyright (c) 2012-2015, Komma Mediadesign
*/
namespace Komma\Services;
use Komma\Pages\PageService;
class ServiceController extends \BaseController
{
protected $pageService;
protected $blockService;
protected $projectService;
public function __construct(PageService $pageService, ServiceService $serviceService)
{
parent::__construct();
$this->pageService = $pageService;
$this->serviceService = $serviceService;
}
//Project index page
public function index(){
//get content of page and get all page links
$page = $this->pageService->getPageByCodeName('services');
$links = $this->pageService->getAllRoutes();
$page->translation->description = json_decode($page->translation->description);
//Get all projects
$services = $this->serviceService->getAllServices();
return \View::make('layouts.pages.servicesOverview')
->with('page', $page)
->with('links', $links)
->with('services', $services);
}
public function show($serviceId){
$page = $this->serviceService->getService($serviceId);
$links = $this->pageService->getAllRoutes();
return \View::make('layouts.pages.serviceDetail')
->with('page', $page)
->with('links', $links);
}
}