Exemplo n.º 1
0
 public function index($material_type)
 {
     $indexModel = new IndexModel();
     $data = $indexModel->getPage(Router::getId(), Router::getLanguage(), $material_type);
     if (!$data) {
         throw new Exception(" Page is not exist", 404);
     } elseif ($data[0]['status'] == 0) {
         throw new Exception(" Page not publish", 2);
     }
     if (!$indexModel->existTranslationPage(Router::getId(), Router::getLanguage(), $material_type)) {
         throw new Exception(" Page has no translation", 204);
     }
     $args = $data[0];
     return $args;
 }