File: D:/HostingSpaces/SBogers85/dale-int.com/app/Komma/Projects/ProjectController.php
<?php
/**
* Short description for the file.
*
* @author Komma <support@komma.pro>
* @copyright (c) 2012-2015, Komma Mediadesign
*/
namespace Komma\Projects;
use Komma\Blocks\BlockService;
use Komma\Pages\PageService;
class ProjectController extends \BaseController
{
public $data;
protected $pageService;
protected $blockService;
protected $projectService;
public function __construct(PageService $pageService, BlockService $blockService, ProjectService $projectService)
{
parent::__construct();
$this->pageService = $pageService;
$this->blockService = $blockService;
$this->projectService = $projectService;
$this->data = (object)[];
}
//Project index page
public function index(){
$page = $this->pageService->getPageByCodeName('project_overview');
$this->data->content = $page;
$this->data->id = $this->data->content->id;
$projects = $this->projectService->getAllProjects();
$otherLanguages = $this->pageService->getOtherLanguageRoutes($this->data->id);
return \View::make('layouts.pages.projectOverview')
->with('data', $this->data)
->with('blocks', $page->blocks)
->with('otherLanguages', $otherLanguages->allTranslations)
->with('projects', $projects);
}
public function show($projectId){
$this->data = $this->projectService->getProject($projectId);
return \View::make('layouts.pages.projectDetail')
->with('data', $this->data);
}
}