Ejemplo n.º 1
0
 /**
  * Add related tags to projects
  * @param array $projects Array of project object
  * @param bool  $toString Convert to string
  */
 public function addTags(array $projects, $toString = true)
 {
     $tagModel = new \Prolio\Model\Tag();
     foreach ($projects as $project) {
         $tags = $tagModel->getAllByProject($project->id);
         if ($toString) {
             $tags = $tagModel->tagsToString($tags);
         }
         $project->tags = $tags;
     }
 }
Ejemplo n.º 2
0
 public function get($project_slug = null)
 {
     $project = $this->model->getBySlug($project_slug);
     $tagModel = new \Prolio\Model\Tag();
     $tags = $tagModel->getAllByProject($project->id);
     $tags = $tagModel->tagsToString($tags);
     $compModel = new \Prolio\Model\Compatibility();
     $comps = $compModel->getAllByProject($project->id);
     $comps = $compModel->compatibilitiesToString($comps);
     $buttonModel = new \Prolio\Model\Button();
     $buttons = $buttonModel->getAllByProject($project->id);
     $imageModel = new \Prolio\Model\Image();
     $images = $imageModel->getAllByProject($project->id);
     if ($project) {
         $this->app->render('project.twig', ['project' => $project, 'tags' => $tags, 'comps' => $comps, 'buttons' => $buttons, 'images' => $images]);
     } else {
         $this->app->notFound();
     }
 }