コード例 #1
0
 public function index()
 {
     $result['title'] = 'Cities';
     $result['cities'] = $this->city->getCities();
     View::make('city.index', $result);
     if (Auth::isAuth()) {
         View::appendTemplateToLayout('topBar', 'top_bar/user');
     } else {
         View::appendTemplateToLayout('topBar', 'top_bar/guest');
     }
     View::appendTemplateToLayout('header', 'includes/header')->appendTemplateToLayout('footer', 'includes/footer')->render();
 }
コード例 #2
0
 public function getEdit($id)
 {
     $result['title'] = 'Edit';
     /* @var $estate \Models\ViewModels\EstateViewModel */
     $estate = $this->estate->getEstate($id);
     if ($estate == null) {
         Session::setError('The estate id is incorrect');
         Redirect::to('');
     }
     $estate->images = $this->image->getImagesByEstate($id);
     foreach ($estate->images as $i) {
         $i->thumbnailName = $this->setImageThumb($i->name);
     }
     $result['estate'] = $estate;
     $result['action'] = '/admin/estate/' . $estate->id . '/edit';
     $result['submit'] = 'Edit';
     $result['categories'] = $this->setCategoryFormOptions($this->category->getCategories(), $estate);
     $result['cities'] = $this->setCityFormOptions($this->city->getCities(), $estate);
     View::make('estate.add', $result);
     if (Auth::isAuth()) {
         View::appendTemplateToLayout('topBar', 'top_bar/user');
     } else {
         View::appendTemplateToLayout('topBar', 'top_bar/guest');
     }
     View::appendTemplateToLayout('header', 'includes/header')->appendTemplateToLayout('footer', 'includes/footer')->render();
 }