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


PHP Form::getMode方法代碼示例

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


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

示例1: partnerFormSuccessHandle

 /**
  * PartnerForm success event handler
  * @param Form $form
  */
 public function partnerFormSuccessHandle(Form $form)
 {
     $values = $form->getValues();
     try {
         switch ($form->getMode()) {
             case FormMode::CREATE_MODE:
                 $this->createPartnerHandle($values);
                 break;
             case FormMode::UPDATE_MODE:
                 $this->updatePartnerHandle($values);
                 break;
         }
     } catch (Exceptions\DuplicateEntryException $ex) {
         $form->addError("partnersModule.partnerForm.partnerNameAlreadyExist");
     }
 }
開發者ID:fuca,項目名稱:sportsclub,代碼行數:20,代碼來源:AdminPresenter.php

示例2: paymentFormSubmitHandle

 /**
  * PaymentForm onSuccess event handler
  * @param Form $form
  */
 public function paymentFormSubmitHandle(Form $form)
 {
     $values = $form->getValues();
     switch ($form->getMode()) {
         case FormMode::CREATE_MODE:
             //		$oSelId = $values[PaymentForm::PAYMENT_OWNER_TYPE_SELECT_ID];
             //		switch ($oSelId) {
             //		    case PaymentOwnerType::GROUP:
             //			$groupId = $values[PaymentForm::OWNER_TYPE_GROUP];
             //			try {
             //			    $users = $this->getPositionService()->getUsersWithinGroup($groupId);
             //			    $this->createMultiPaymentHandle($values, $users);
             //			} catch (Exceptions\DataErrorException $ex) {
             //			    $this->handleDataLoad(null, "this", $ex);
             //			}
             //			break;
             //		    case PaymentOwnerType::SELECT:
             $ids = $values[PaymentForm::OWNER_TYPE_SELECT];
             $this->createMultiPaymentHandle($values, $ids);
             break;
             //		}
             break;
         case FormMode::UPDATE_MODE:
             $this->updatePaymentHandle($values);
             break;
     }
 }
開發者ID:fuca,項目名稱:sportsclub,代碼行數:31,代碼來源:AdminPresenter.php

示例3: seasonApplicationFormSubmitHandle

 public function seasonApplicationFormSubmitHandle(Form $form)
 {
     $values = $form->getValues();
     try {
         switch ($form->getMode()) {
             case FormMode::CREATE_MODE:
                 $users = $values->owner;
                 $values->offsetUnset("owner");
                 foreach ($users as $u) {
                     $values["owner"] = $u;
                     $this->createSeasonApplicationHandle($values);
                 }
                 break;
             case FormMode::UPDATE_MODE:
                 $this->updateSeasonApplicationHandle($values);
                 break;
         }
     } catch (Exceptions\NoResultException $ex) {
         $this->logWarning($ex);
         $form->addError($this->tt("seasonsModule.admin.error.noTaxForSeasonAndGroup"));
     } catch (Exceptions\InvalidStateException $ex) {
         $this->logWarning("SeasonApplicationForm /// " . $ex);
         $form->addError($this->tt("seasonsModule.admin.error.appDeadlineExpired"));
     } catch (Exceptions\DuplicateEntryException $ex) {
         $this->logWarning($ex);
         $form->addError($this->tt("seasonsModule.admin.error.seasonAppUniqueExist"), self::FM_ERROR);
     }
 }
開發者ID:fuca,項目名稱:sportsclub,代碼行數:28,代碼來源:AdminPresenter.php

示例4: motEntryFormSuccessHandle

 public function motEntryFormSuccessHandle(Form $form)
 {
     $values = $form->getValues();
     switch ($form->getMode()) {
         case FormMode::CREATE_MODE:
             $ids = $values->offsetGet(MotivationEntryForm::MULTI_OWNER_ID);
             $values->offsetUnset(MotivationEntryForm::MULTI_OWNER_ID);
             $this->createEntry($values, $ids);
             break;
         case FormMode::UPDATE_MODE:
             $this->updateEntry($values);
             break;
     }
 }
開發者ID:fuca,項目名稱:sportsclub,代碼行數:14,代碼來源:AdminPresenter.php

示例5: searchFormSuccess

 public function searchFormSuccess(Form $form)
 {
     $values = $form->getValues();
     switch ($form->getMode()) {
         case FormMode::CREATE_MODE:
             $this->redirect(":System:Search:default", $values->keyword);
             break;
         case FormMode::UPDATE_MODE:
             break;
     }
 }
開發者ID:fuca,項目名稱:sportsclub,代碼行數:11,代碼來源:BasePresenter.php

示例6: forumThreadFormSuccess

 public function forumThreadFormSuccess(Form $form)
 {
     $values = $form->getValues();
     try {
         switch ($form->getMode()) {
             case FormMode::CREATE_MODE:
                 $this->createForumThread($values);
                 break;
             case FormMode::UPDATE_MODE:
                 break;
         }
     } catch (Exceptions\DuplicateEntryException $ex) {
         $form->addError("communicationModule.club.forumThreadAlreadyExist");
     }
 }
開發者ID:fuca,項目名稱:sportsclub,代碼行數:15,代碼來源:ForumPresenter.php

示例7: articleFormSubmitted

 /** 
  * Article form success handler
  * @param Form $form
  */
 public function articleFormSubmitted(Form $form)
 {
     $values = $form->getValues();
     try {
         switch ($form->getMode()) {
             case FormMode::CREATE_MODE:
                 $this->createArticle($values);
                 break;
             case FormMode::UPDATE_MODE:
                 $this->updateArticle($values);
                 break;
         }
     } catch (Exceptions\DuplicateEntryException $ex) {
         $form->addError("articlesModule.admin.articleForm.errors.articleAlreadyExist");
     }
 }
開發者ID:fuca,項目名稱:sportsclub,代碼行數:20,代碼來源:AdminPresenter.php

示例8: commentFormSuccess

 /**
  * CommentForm onSuccess event handler
  * @param Form $form
  */
 public function commentFormSuccess(Form $form)
 {
     $values = $form->getValues();
     switch ($form->getMode()) {
         case FormMode::CREATE_MODE:
             if ($this->isCommenting()) {
                 $this->presenter->addComment($values);
             }
             break;
         case FormMode::UPDATE_MODE:
             $this->presenter->updateComment($values);
             break;
     }
     if ($this->presenter->isAjax()) {
         unset($this->template->showSimpleForm);
         $this->redrawControl("commentsData");
     }
 }
開發者ID:fuca,項目名稱:sportsclub,代碼行數:22,代碼來源:CommentControl.php

示例9: forumThreadFormSuccess

 public function forumThreadFormSuccess(Form $form)
 {
     $values = $form->getValues();
     try {
         switch ($form->getMode()) {
             case FormMode::CREATE_MODE:
                 $this->createForumThread($values);
                 break;
             case FormMode::UPDATE_MODE:
                 $this->updateForumThread($values);
                 break;
         }
     } catch (Exceptions\DuplicateEntryException $ex) {
         $form->addError("forumModule.admin.forThrForm.errors.forumThrAlreadyExist");
     }
 }
開發者ID:fuca,項目名稱:sportsclub,代碼行數:16,代碼來源:AdminPresenter.php


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