示例#1
0
 public function AddNewTranslAction()
 {
     if (isset($_POST['data'])) {
         $model = new WordsModel();
         $model->decodeJson($_POST['data']);
         $model->validate('translation', $model->getJsonData('addTranslation'));
         $model->validate('type', $model->getJsonData('addType'));
         $model->validate('category', $model->getJsonData('addCategory'));
         $model->validateId($model->getJsonData('wordId'));
         if (count($model->errors) > 0) {
             echo $model->helper['MainHelper']->getError('0x00008');
         } else {
             echo $model->insertNewTranslation();
         }
     }
 }