/**
  * top page
  */
 public function getIndex()
 {
     $sections = $this->section->getSections();
     foreach ($sections as $section) {
         $section->recipes = $this->recipe->getRecipeFromSectionByRand($section->section_id);
     }
     $data = ['latest' => $this->recipe->getLatestRecipe(7), 'sections' => $sections, 'popular' => $this->getContentsRanking()];
     $this->view('home.index', $data);
 }
 /**
  * @param string $format
  * @return mixed
  */
 public function getIndex($format = 'atom')
 {
     $this->feed->setHeaders($format);
     $feed = $this->feed->getFeeder();
     $recipes = $this->recipe->getLatestRecipe(25);
     if ($recipes) {
         foreach ($recipes as $recipe) {
             $entry = $feed->createEntry();
             $entry->setTitle($recipe->title);
             $entry->setLink(route('home.recipe', ['one' => $recipe->recipe_id]));
             $entry->setDateModified(strtotime($recipe->updated_at));
             $entry->setDateCreated(strtotime($recipe->created_at));
             $entry->setDescription(\Markdown::render($recipe->problem));
             if ($recipe->solution != '') {
                 $entry->setContent(\Markdown::render($recipe->solution));
             }
             $feed->addEntry($entry);
         }
     }
     return $this->feed->render();
 }