Fix bug displaying single prosjekt

This commit is contained in:
Peder Bergebakken Sundt 2017-10-28 20:54:33 +02:00
parent c1def5fd7d
commit 60ef214e1b
1 changed files with 6 additions and 4 deletions

View File

@ -47,9 +47,11 @@ $projects = $projectManager->getAll();
<ul class="calendar-events">
<?php
$randProjects = array_rand($projects, min(3, count($projects)));
for($i = 0; $i < count($randProjects); $i++){
$project = $projects[$randProjects[$i]];
if (!is_array($randProjects)) {
$randProjects = [$randProjects];
};
foreach($randProjects as $i) {
$project = $projects[$i];
?>
<li>