コード例 #1
0
 /**
  * Index action.
  *
  * @access public
  * @param Silex\Application $app Silex application
  * @param Symfony\Component\HttpFoundation\Request $request Request object
  * @return string Output
  */
 public function indexAction(Application $app, Request $request)
 {
     try {
         $roomsModel = new RoomsModel($app);
         $this->view['photos'] = $roomsModel->getMainGallery();
     } catch (\PDOException $e) {
         $app->abort(500, $app['translator']->trans('Something went wrong.'));
     }
     return $app['twig']->render('index/index.twig', $this->view);
 }