예제 #1
0
파일: Index.php 프로젝트: scorp7mix/try.t4
 public function actionPageById($id)
 {
     $page = Page::findByPK($id);
     if (empty($page)) {
         throw new E404Exception();
     }
     $this->data->page = $page;
 }
예제 #2
0
파일: Admin.php 프로젝트: scorp7mix/try.t4
 public function actionMoveAfter($id, $to)
 {
     try {
         $item = Page::findByPK($id);
         if (empty($item)) {
             throw new Exception('Source element does not exist');
         }
         $destination = Page::findByPK($to);
         if (empty($destination)) {
             throw new Exception('Destination element does not exist');
         }
         $item->insertAfter($destination);
         $this->data->result = true;
     } catch (Exception $e) {
         $this->data->result = false;
         $this->data->error = $e->getMessage();
     }
 }