Example #1
0
 public function loadTemplate($dir, $results, $showLimit, $template)
 {
     $total = count($results["photos"]["photo"]);
     $pages = @$_GET["page"];
     $pagesTotal = ceil($total / $showLimit);
     if ($pages < 1) {
         $pages = 1;
     } else {
         $pages;
     }
     $start = ($pages - 1) * $showLimit;
     $resultsSlices = array_slice($results["photos"]["photo"], $start, $showLimit);
     $this->pagesTotal = $pagesTotal;
     echo $total;
     $db = new Database();
     $db->dump($resultsSlices);
     /*foreach($resultsSlices as $resultsKey => $resultSlice){
     			foreach ($resultSlice as $column => $data){
     				$this->{$column} = $data;
     			}
     			require($dir.'/'.$template.'.php');
     		}*/
 }