public function loadmoreAction() { $offset = $this->getParam('offset'); $offset = intval($offset); $projects = Object\Project::getList(["offset" => $offset, "limit" => 9, "orderKey" => ["date"], "order" => ["desc"]]); $this->view->projects = $projects; }
public function projectAction() { $id = $this->getParam('id'); $project = Project::getById($id); $this->project = $project; $this->videos = $project->getVideos(); if (!$project) { http_response_code(404); die; } }
public function portfolioAction() { $this->enableLayout(); $categories = []; $projects = Object\Project::getList(["offset" => 0, "limit" => 9, "orderKey" => ["date"], "order" => ["desc"]]); foreach ($projects as $project) { foreach ($project->getCategories() as $category) { if (!in_array($category, $categories)) { array_push($categories, $category); } } } for ($i = 0; $i < count($categories); $i++) { $category = ucfirst($categories[$i]); $category = str_replace("-", " ", $category); $categories[$categories[$i]] = $category; unset($categories[$i]); } $this->view->projects = $projects; $this->view->categories = $categories; // $th = new Pimcore\Model\Object\Fieldcollection(); // $th->current() }