示例#1
0
 public function actionShowStaticPage($id)
 {
     $page = null;
     try {
         if (is_numeric($id)) {
             $page = $this->staticPageService->getStaticPage($id);
         } else {
             $page = $this->staticPageService->getStaticPageAbbr($id);
         }
     } catch (Exceptions\DataErrorException $ex) {
         $this->handleDataLoad($id, "default", $ex);
     }
     $this->setEntity($page);
     $this->template->page = $page;
 }
示例#2
0
 /**
  * @Secured(resource="updateStaticPage")
  */
 public function actionUpdateStaticPage($id)
 {
     if (!is_numeric($id)) {
         $this->handleBadArgument($id);
     }
     try {
         $dbPage = $this->staticPageService->getStaticPage($id);
         if ($dbPage !== null) {
             $form = $this->getComponent('updateStaticPageForm');
             $form->setDefaults($dbPage->toArray());
             $this->template->page = $dbPage;
         }
     } catch (Exceptions\DataErrorException $ex) {
         $this->handleDataLoad($id, "default", $ex);
     }
 }