當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。