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


PHP Languages::update方法代碼示例

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


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

示例1: actionUpdateLng

 public function actionUpdateLng()
 {
     /* @var $language Languages */
     $id = Yii::app()->request->getParam('id', null);
     $label = Yii::app()->request->getParam('label', '');
     $prefix = Yii::app()->request->getParam('prefix', DEFAULT_LANGUAGE);
     $status = Yii::app()->request->getParam('status', Constants::STATUS_VISIBLE);
     $original_name = Yii::app()->request->getParam('original_name', '');
     $english_name = Yii::app()->request->getParam('english_name', '');
     $russian_name = Yii::app()->request->getParam('russian_name', '');
     $notification = Yii::app()->request->getParam('notification', '');
     $language = Languages::model()->findByPk($id);
     if ($language == null) {
         $language = new Languages();
     }
     $language->label = $label;
     $language->prefix = strtolower(substr($prefix, 0, 2));
     $language->notification = strtoupper(substr($notification, 0, 2));
     $language->status = $status;
     $language->original_language_name = $original_name;
     $language->english_language_name = $english_name;
     $language->russian_language_name = $russian_name;
     if ($language->isNewRecord) {
         $language->priority = DwHelper::getNextPriority("Languages");
         $language->save();
     } else {
         $language->update();
     }
     $this->redirect($this->createUrl('/admin/panel/languages'));
 }
開發者ID:ruslankus,項目名稱:inlux-transfer,代碼行數:30,代碼來源:PanelController.php


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