File: D:/HostingSpaces/SBogers87/basephotography.nl/app/Komma/Projects/ProjectController.php
<?php
namespace Komma\Projects;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
use Komma\BaseController;
use Komma\Pages\PageService;
class ProjectController extends \BaseController
{
public $data;
protected $projectService;
protected $pageService;
public function __construct(ProjectService $projectService, PageService $pageService){;
$this->pageService = $pageService;
$this->projectService = $projectService;
$this->data = (object)[
'translations' => $this->pageService->getTextBlocks()
];
}
public function show($id = 2){
$this->data->id = 3;
$projects = $this->projectService->getProjects($id);
$this->data->next = $projects['next'];
$this->data->previous = $projects['previous'];
$this->data->content = $projects['project'];
$this->data->content->images = $this->projectService->splitImages($this->data->content->images);
return \View::make('layouts.pages.project')->with([
'data' => $this->data,
'categories' => $this->projectService->getCategories(),
]);
}
public function sub(){
$category = \Request::segment(2);
$this->data->id = 3;
$this->data->content = $this->pageService->getPageContent(3);
$projects = $this->projectService->getCategoryImages($category);
return \View::make('layouts.pages.projectCategory')->with([
'data' => $this->data,
'projects' => $projects,
'categories' => $this->projectService->getCategories(),
'active' => $category
]);
}
}