コード例 #1
0
 /**
  * Return the homepage view.
  *
  */
 public function index()
 {
     $this->_pageData->pageTitle = "Home";
     try {
         $weatherModel = WeatherModelFactory::make(new RemoteCurlData());
         $this->_pageData->temperature = $weatherModel->getTemp();
     } catch (Exception $e) {
         $this->_pageData->temperature = '-';
     }
     $this->_pageData->properties = $this->_property->getProperties();
     return $this->_view->make('public/home', $this->_pageData);
 }
コード例 #2
0
 /**
  * Display the property details page.
  *
  * @param $id
  */
 public function show($id)
 {
     try {
         $this->_property = $this->_property->getProperty($id);
         if (is_null($this->_property)) {
             return header("Location: " . SITE_URL);
         }
     } catch (Exception $e) {
         return header("Location: " . SITE_URL);
     }
     try {
         $weatherModel = WeatherModelFactory::make(new RemoteCurlData());
         $this->_pageData->temperature = $weatherModel->getTemp();
     } catch (Exception $e) {
         $this->_pageData->temperature = '-';
     }
     $this->_pageData->property = $this->_property;
     $this->_pageData->pageTitle = $this->_property->name . " - Details";
     return $this->_view->make('public/property-detail', $this->_pageData);
 }