当前位置: 首页>>代码示例>>PHP>>正文


PHP FormBuilder::getFormValues方法代码示例

本文整理汇总了PHP中FormBuilder::getFormValues方法的典型用法代码示例。如果您正苦于以下问题:PHP FormBuilder::getFormValues方法的具体用法?PHP FormBuilder::getFormValues怎么用?PHP FormBuilder::getFormValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FormBuilder的用法示例。


在下文中一共展示了FormBuilder::getFormValues方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processPost

 /**
  * Handle processing the form when it's posted, such as saving and handling errors.
  */
 protected function processPost()
 {
     if (!$this->formObj) {
         return false;
     }
     if ($this->formObj->formSubmitted()) {
         // Form is valid, so save data
         if ($this->formObj->formValid()) {
             $originalFormValues = $this->formObj->getFormValues();
             // Add optional filter to tweak the form values before saving
             if ($this->filterBeforeSaveFunction && function_exists($this->filterBeforeSaveFunction)) {
                 $formValues = call_user_func($this->filterBeforeSaveFunction, $originalFormValues, $this);
             } else {
                 $formValues = $originalFormValues;
             }
             // Now save the form values as normal.
             $this->handleSave($formValues);
             // Optional function once data has been saved
             if ($this->afterSaveFunction && function_exists($this->afterSaveFunction)) {
                 call_user_func($this->afterSaveFunction, $formValues, $originalFormValues, $this);
             }
         } else {
             $this->messages = $this->showListOfErrors($this->formObj->getListOfErrors());
         }
     }
 }
开发者ID:nerdhaus,项目名称:avse,代码行数:29,代码来源:utils_easyform.inc.php

示例2: processPost

 /**
  * Handle processing the form when it's posted, such as saving and handling errors.
  */
 protected function processPost()
 {
     if (!$this->formObj) {
         return false;
     }
     if ($this->formObj->formSubmitted()) {
         // Form is valid, so save data
         if ($this->formObj->formValid()) {
             $originalFormValues = $this->formObj->getFormValues();
             // Add optional function to validate the data
             $gotFnErrorMsg = false;
             if ($this->filterExtraValidationFunction && function_exists($this->filterExtraValidationFunction)) {
                 $gotFnErrorMsg = call_user_func($this->filterExtraValidationFunction, $originalFormValues, $this);
             }
             // Got an error message, so show and abort.
             if ($gotFnErrorMsg) {
                 $this->messages = $this->showMessage($gotFnErrorMsg, true);
                 return false;
             }
             // Add optional filter to tweak the form values before saving
             if ($this->filterBeforeSaveFunction && function_exists($this->filterBeforeSaveFunction)) {
                 $formValues = call_user_func($this->filterBeforeSaveFunction, $originalFormValues, $this);
                 // If we're modifying values, then we need to update the data being stored in the form
                 $this->loadDefaults($formValues);
             } else {
                 $formValues = $originalFormValues;
             }
             // Now save the form values as normal.
             $this->handleSave($formValues);
             // Optional function once data has been saved
             if ($this->afterSaveFunction && function_exists($this->afterSaveFunction)) {
                 call_user_func($this->afterSaveFunction, $formValues, $originalFormValues, $this);
             }
         } else {
             $this->messages .= $this->showListOfErrors($this->formObj->getListOfErrors());
         }
     }
 }
开发者ID:NClaus,项目名称:Ambrose,代码行数:41,代码来源:utils_easyform.inc.php


注:本文中的FormBuilder::getFormValues方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。