Beispiel #1
0
 public function menu()
 {
     // TODO:
     $cafeName = $this->f3->get('PARAMS.cafeName');
     if (strtolower($cafeName) == 'richmond') {
         $this->f3->set('isRichmond', 'active');
         $cafeId = 1;
     } else {
         if (strtolower($cafeName) == 'malvern') {
             $this->f3->set('isMalvern', 'active');
             $cafeId = 2;
         }
     }
     $this->f3->set('cafeId', $cafeId);
     // create blur effect for background
     $this->f3->set('isBlurred', 'blur');
     // retrieve all pictures and return links to client
     $images = new ImageManager($this->db);
     $menuImages = $images->allForMenu();
     // retrieve all categories and setup for template
     $cats = new Category($this->db);
     $categories = $cats->all();
     $this->f3->set('categories', $categories);
     $firstCategory = $categories[0]->categoryId;
     $info = new Info($this->db);
     $this->f3->set('isPriceOn', $info->all()[0]->isPriceOn);
     // setup for client
     $clientArray = array();
     foreach ($menuImages as $menuImage) {
         $clientArray[] = $menuImage->imageLink;
     }
     // retreive all items based on $cafeId
     $items = new Item($this->db);
     $this->f3->set('items', $items->getAllByCategoryId($cafeId, $firstCategory));
     $this->f3->set('pictureArray', $clientArray);
     $this->f3->set('ESCAPE', false);
     $this->f3->set('view', 'user/menu.html');
 }