コード例 #1
0
 public function homeAction()
 {
     $this->view->aboutMe = $this->_contacts->getAboutMeByID();
     $this->view->whatIDo = $this->_contacts->getWhatIDoByID();
     $this->view->articles = $this->_articles->getAllArticles();
     $this->view->contacts = $this->_contacts->getContactsByID();
     $this->view->serviceCategories = $this->_serviceCategories->getAllServiceCategories();
     $this->view->services = $this->_services->getAllServices();
     $this->view->testimonials = $this->_testimonials->getAllTestimonials();
     $this->view->footer = $this->_contacts->getFooterByID();
 }
コード例 #2
0
 public function whatIDoAction()
 {
     $form = new Admin_Form_WhatIDoForm();
     $whatIDo = $this->_contacts->getWhatIDoByID();
     if ($this->_request->isPost()) {
         $formData = $this->_request->getPost();
         if ($form->isValid($formData)) {
             // update
             if ($form->Image->isUploaded()) {
                 $form->Image->receive();
                 $path = "img/profile/WhatIDo.jpg";
                 Admin_View_Helper_ImageControls::resizeImage($path, $path, 200, 300);
                 $formData['ImageUpdateTime'] = Site_View_Helper_Date::formatDate();
                 $whatIDo->ImageUpdateTime = Site_View_Helper_Date::formatDate();
             }
             $this->_contacts->updateWhatIDo($formData);
         } else {
             $form->populate($formData);
         }
     } else {
         $data = $whatIDo->toArray();
         $form->populate($data);
     }
     $this->view->whatIDo = $whatIDo;
     $this->view->form = $form;
 }