本文整理匯總了PHP中Province::getErrors方法的典型用法代碼示例。如果您正苦於以下問題:PHP Province::getErrors方法的具體用法?PHP Province::getErrors怎麽用?PHP Province::getErrors使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Province
的用法示例。
在下文中一共展示了Province::getErrors方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: actionWrite
public function actionWrite()
{
parent::actionWrite();
if (isset($_POST['Province'])) {
$messages = $this->ValidateData(array(array($_POST['Province']['countryid'], 'emptycountrycode', 'emptystring'), array($_POST['Province']['provincename'], 'emptyprovincename', 'emptystring')));
if ($messages == '') {
//$dataku->attributes=$_POST['Province'];
if ((int) $_POST['Province']['provinceid'] > 0) {
$model = $this->loadModel($_POST['Province']['provinceid']);
$model->provincename = $_POST['Province']['provincename'];
$model->countryid = $_POST['Province']['countryid'];
$model->recordstatus = $_POST['Province']['recordstatus'];
} else {
$model = new Province();
$model->attributes = $_POST['Province'];
}
try {
if ($model->save()) {
$this->DeleteLock($this->menuname, $_POST['Province']['provinceid']);
$this->GetSMessage('cciinsertsuccess');
} else {
$this->GetMessage($model->getErrors());
}
} catch (Exception $e) {
$this->GetMessage($e->getMessage());
}
}
}
}