当前位置: 首页>>代码示例>>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;未经允许,请勿转载。