當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Country::getErrors方法代碼示例

本文整理匯總了PHP中Country::getErrors方法的典型用法代碼示例。如果您正苦於以下問題:PHP Country::getErrors方法的具體用法?PHP Country::getErrors怎麽用?PHP Country::getErrors使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Country的用法示例。


在下文中一共展示了Country::getErrors方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: actionWrite

 public function actionWrite()
 {
     parent::actionWrite();
     if (isset($_POST['Country'])) {
         $messages = $this->ValidateData(array(array($_POST['Country']['countrycode'], 'emptycountrycode', 'emptystring'), array($_POST['Country']['countryname'], 'emptycountryname', 'emptystring')));
         if ($messages == '') {
             //$dataku->attributes=$_POST['Country'];
             if ((int) $_POST['Country']['countryid'] > 0) {
                 $model = $this->loadModel($_POST['Country']['countryid']);
                 $model->countryname = $_POST['Country']['countryname'];
                 $model->countrycode = $_POST['Country']['countrycode'];
                 $model->recordstatus = $_POST['Country']['recordstatus'];
             } else {
                 $model = new Country();
                 $model->attributes = $_POST['Country'];
             }
             try {
                 if ($model->save()) {
                     $this->DeleteLock($this->menuname, $_POST['Country']['countryid']);
                     $this->GetSMessage('ccoinsertsuccess');
                 } else {
                     $this->GetMessage($model->getErrors());
                 }
             } catch (Exception $e) {
                 $this->GetMessage($e->getMessage());
             }
         }
     }
 }
開發者ID:bylinggha,項目名稱:Capella-ERP-Indonesia,代碼行數:29,代碼來源:CountryController.php

示例2: actionNewcountry

 public function actionNewcountry()
 {
     if (isset($_POST['Country'])) {
         $obj = new Country();
         $obj->attributes = $_POST['Country'];
         $obj->active = 1;
         $obj->sort_order = 10;
         if ($obj->validate()) {
             if ($obj->save()) {
                 echo "success";
             } else {
                 echo _xls_convert_errors_display(_xls_convert_errors($obj->getErrors()));
             }
         } else {
             echo _xls_convert_errors_display(_xls_convert_errors($obj->getErrors()));
         }
     }
 }
開發者ID:uiDeveloper116,項目名稱:webstore,代碼行數:18,代碼來源:ShippingController.php

示例3: actionEditableCreator

 public function actionEditableCreator()
 {
     if (isset($_POST['Country'])) {
         $model = new Country();
         $model->attributes = $_POST['Country'];
         if ($model->save()) {
             echo CJSON::encode($model->getAttributes());
         } else {
             $errors = array_map(function ($v) {
                 return join(', ', $v);
             }, $model->getErrors());
             echo CJSON::encode(array('errors' => $errors));
         }
     } else {
         throw new CHttpException(400, 'Invalid request');
     }
 }
開發者ID:schmunk42,項目名稱:yii-sakila-crud,代碼行數:17,代碼來源:CountryController.php


注:本文中的Country::getErrors方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。