Beispiel #1
0
 public function actionPageById($id)
 {
     $page = Page::findByPK($id);
     if (empty($page)) {
         throw new E404Exception();
     }
     $this->data->page = $page;
 }
Beispiel #2
0
 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();
     }
 }