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


PHP BaseForm::isValid方法代码示例

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


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

示例1: isValid

 /**
  * {@inheritDoc}
  *
  * Sets render mode to {@link RENDER_SUMMARY}, if validation succeeded.
  *
  * @see \Zend\Form\Form::isValid()
  */
 public function isValid()
 {
     $isValid = parent::isValid();
     if ($isValid) {
         $this->setRenderMode(self::RENDER_SUMMARY);
     }
     return $isValid;
 }
开发者ID:webpants,项目名称:YAWIK,代码行数:15,代码来源:SummaryForm.php

示例2: processForm

 private function processForm($params, BaseForm $form)
 {
     $form->bind($params);
     if ($form->isValid()) {
         $form->save();
         return true;
     }
     return false;
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:9,代码来源:actions.class.php

示例3: isValid

 public function isValid()
 {
     $valid = parent::isValid();
     if ($valid) {
         return $this->isValidUser();
     } else {
         return false;
     }
 }
开发者ID:nova76,项目名称:nova-plugins,代码行数:9,代码来源:BasesfGuardRequestForgotPasswordForm.class.php

示例4: processForm

 protected function processForm(sfWebRequest $request, BaseForm $form)
 {
     $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
     if ($form->isValid()) {
         $schedule = $form->save();
         $this->getUser()->setFlash('notice', $form->isNew() ? 'The schedule has added' : 'The schedule has updated');
         $results = explode('-', $schedule->start_date);
         $this->redirect(sprintf('@calendar_year_month?year=%d&month=%d', $results[0], $results[1]));
     }
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:10,代码来源:actions.class.php

示例5: isValid

 public function isValid()
 {
     $check = parent::isValid();
     $values = $this->getTaintedValues();
     //validate email available
     if ($values['email'] != $this->existingEmail && Doctrine::getTable('SfGuardUser')->emailExists($values['email'])) {
         $this->addCustomError('This email address is already used by another account.', 'email');
         $check = false;
     }
     return $check;
 }
开发者ID:jnankin,项目名称:makeaminyan,代码行数:11,代码来源:AccountForm.class.php

示例6: isValid

 public function isValid()
 {
     if (parent::isValid()) {
         // Clean the students field
         $students = $this->getValue('students');
         $students = str_replace(array("\r\n", "\r"), "\n", $students);
         $students = trim($students);
         $this->students = explode("\n", $students);
         sort($this->students);
         return true;
     } else {
         return false;
     }
 }
开发者ID:nightingailm,项目名称:TinyTotsList,代码行数:14,代码来源:ClassListForm.class.php

示例7: isValid

 public function isValid()
 {
     $valid = parent::isValid();
     if ($valid) {
         $values = $this->getValues();
         $this->user = Doctrine_Core::getTable('sfGuardUser')->createQuery('u')->where('u.email_address = ?', $values['email_address'])->fetchOne();
         if ($this->user) {
             return true;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
开发者ID:hunde,项目名称:bsc,代码行数:15,代码来源:BasesfGuardRequestForgotPasswordForm.class.php

示例8: checkCSRFProtection

 public function checkCSRFProtection()
 {
     $form = new BaseForm();
     $form->bind($form->isCSRFProtected() ? array($form->getCSRFFieldName() => $this->getParameter($form->getCSRFFieldName())) : array());
     if (!$form->isValid()) {
         throw $form->getErrorSchema();
     }
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:8,代码来源:sfWebRequest.class.php

示例9: executeDeletePair

 public function executeDeletePair(sfWebRequest $request)
 {
     $pair = MappingPairTable::getInstance()->find($request->getParameter('id'));
     if (!$pair) {
         return $this->notFound();
     }
     /* @var $pair MappingPair */
     $form = new BaseForm();
     $form->getWidgetSchema()->setNameFormat('delete_pair[%s]');
     $form->bind($request->getPostParameter($form->getName()));
     if ($form->isValid()) {
         $id = $pair->getId();
         $pair->delete();
         return $this->ajax()->remove('#pair_' . $id)->remove('#pair_form_' . $id)->render();
     } else {
         return $this->ajax()->form($form)->render();
     }
 }
开发者ID:uniteddiversity,项目名称:policat,代码行数:18,代码来源:actions.class.php

示例10: processForm

 private function processForm(BaseForm $form, sfWebRequest $request, $type = null)
 {
     $name = $form->getName();
     $form->bind($request->getParameter($name), $request->getFiles($name));
     if ($this->setFlashMessageByType($form->isValid(), $type)) {
         $form->save();
     }
     $this->redirect('@opCalendarPlugin');
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:9,代码来源:actions.class.php

示例11: isValid

 public function isValid()
 {
     if ($this->member) {
         return parent::isValid();
     }
     opActivateBehavior::disable();
     foreach ($this->getValues() as $key => $value) {
         if (!empty($this->memberConfigSettings[$key]['IsUnique'])) {
             $memberConfig = Doctrine::getTable('MemberConfig')->retrieveByNameAndValue($key . '_pre', $value);
             if ($memberConfig) {
                 $member = $memberConfig->getMember();
                 if (!$member->getIsActive()) {
                     $this->member = $member;
                 }
             }
         }
     }
     opActivateBehavior::enable();
     return parent::isValid();
 }
开发者ID:balibali,项目名称:OpenPNE3,代码行数:20,代码来源:MemberConfigForm.class.php


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