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


PHP Gpf_Rpc_Form::validate方法代碼示例

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


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

示例1: save

 /**
  * @anonym
  * @service
  * @param Gpf_Rpc_Params $params
  * @return Gpf_Rpc_Form
  */
 public function save(Gpf_Rpc_Params $params) {
     $form = new Gpf_Rpc_Form($params);
     $form->addValidator(new Gpf_Rpc_Form_Validator_EmailValidator(), self::AUTORESPONDER_ADDRESS, $this->_('Autoresponder'));
     if (!$form->validate()) {
         return $form;
     }
     Gpf_Settings::set(self::AUTORESPONDER_ADDRESS, $form->getFieldValue(self::AUTORESPONDER_ADDRESS));
     $form->setInfoMessage($this->_('AWeber saved'));
     return $form;
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:16,代碼來源:Config.class.php

示例2: validateAndRun

 private function validateAndRun($type) {
     if ($this->form->validate()) {
         try {
             $this->task->run();
         } catch (Gpf_Tasks_LongTaskInterrupt $e) {
             $this->form->setField(self::SUCCESS, Gpf::NO);
             $this->form->setInfoMessage($e->getMessage());
             return;
         } catch (Exception $e) {
             $this->task->forceFinishTask();
             $this->form->setField(self::SUCCESS, Gpf::YES);
             $this->form->setErrorMessage($this->_('Error during ' . $this->getActionName($type) . ' coupons') . ' (' . $e->getMessage() . ') ');
             return;
         }
         $this->form->setInfoMessage($this->_('Coupons are successfully ' . $this->getActionName($type, true)));
         $this->form->setField(self::SUCCESS, Gpf::YES);
     }
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:18,代碼來源:CreateCoupons.class.php

示例3: execute

 protected function execute(Gpf_Rpc_Params $params)
 {
     $form = new Gpf_Rpc_Form($params);
     $form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), Gpf_Install_CreateDatabase::DB_HOSTNAME, $this->_('Database Hostname'));
     $form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), Gpf_Install_CreateDatabase::DB_USERNAME, $this->_('Username'));
     $form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), Gpf_Install_CreateDatabase::DB_NAME, $this->_('Database Name'));
     if (!$form->validate()) {
         return $form;
     }
     $createDatabaseTask = new Gpf_Install_CreateDatabaseTask();
     $createDatabaseTask->setDBSettings($form->getFieldValue(Gpf_Install_CreateDatabase::DB_HOSTNAME), $form->getFieldValue(Gpf_Install_CreateDatabase::DB_USERNAME), $form->getFieldValue(Gpf_Install_CreateDatabase::DB_NAME), $form->getFieldValue(Gpf_Install_CreateDatabase::DB_PASSWORD));
     try {
         $createDatabaseTask->run();
     } catch (Gpf_Tasks_LongTaskInterrupt $e) {
         $this->setResponseType($form, self::PART_DONE_TYPE);
         $form->setInfoMessage($e->getMessage());
         return $form;
     } catch (Exception $e) {
         $form->setErrorMessage($e->getMessage());
         return $form;
     }
     $this->setNextStep($form);
     return $form;
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:24,代碼來源:CreateDatabase.class.php


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