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


PHP Validation::execute方法代碼示例

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


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

示例1: executeFormValidation

 private function executeFormValidation()
 {
     $validation = new Validation($this->myView->data);
     $fields['title'] = ['Mandatory'];
     $fields['text'] = ['Mandatory'];
     return $validation->execute($fields);
 }
開發者ID:sohflp,項目名稱:Hooked,代碼行數:7,代碼來源:class.Content.php

示例2: executeFormValidation

 protected function executeFormValidation()
 {
     $validation = new Validation($this->myView->data);
     $fields['name'] = ['Mandatory'];
     $fields['email'] = ['Mandatory', 'ValidEmail', 'DuplicateAccount'];
     // Verifica senha somente na criação do usuário
     if (!$this->myView->data->id) {
         $fields['password'] = ['Mandatory'];
     }
     return $validation->execute($fields);
 }
開發者ID:sohflp,項目名稱:Hooked,代碼行數:11,代碼來源:class.Account.php

示例3: executeFormValidation

 protected function executeFormValidation()
 {
     $validation = new Validation($this->myView->data);
     if ($this->addressIsMandatory) {
         $fields['street'] = ['Mandatory'];
         $fields['number'] = ['Mandatory', 'OnlyNumbers'];
         $fields['local'] = ['Mandatory'];
         $fields['city'] = ['Mandatory'];
         $fields['state'] = ['Mandatory'];
         $fields['zipcode'] = ['Mandatory', 'ValidCEP'];
     }
     return $validation->execute($fields);
 }
開發者ID:sohflp,項目名稱:Hooked,代碼行數:13,代碼來源:trait.AddressController.php

示例4: edit

 public function edit($id, $fields)
 {
     $this->errors = [];
     $id = (int) $id;
     $valid = new Validation($this->table);
     $valid->execute($fields, $id);
     if ($valid->good()) {
         $this->last_valid_obj = $valid->getObj();
         $this->db->update($this->table, $this->last_valid_obj, "{$this->pk}=:{$this->pk}", [$this->pk => $id]);
         return true;
     }
     $this->errors = $valid->errors();
     return false;
 }
開發者ID:annasoal,項目名稱:newsite,代碼行數:14,代碼來源:Model.php

示例5: executeFormValidation

 protected function executeFormValidation()
 {
     $validation = new Validation($this->myView->data);
     $fields['login'] = ['Mandatory', 'DuplicateUser'];
     $fields['name'] = ['Mandatory'];
     $fields['email'] = ['Mandatory', 'ValidEmail'];
     // Verifica senha somente na criação do usuário
     if (!$this->myView->data->id) {
         $fields['password'] = ['Mandatory'];
     }
     // Verifica se usuário possui permissão para alterar o Controle de Acessos
     foreach ($_SESSION['admLogin']->getRoles() as $role) {
         if ($role->rolePageID == explode(".", $this->myView->getPageId())[0]) {
             $fields['roles'] = ['MandatoryCombo'];
         }
     }
     return $validation->execute($fields);
 }
開發者ID:sohflp,項目名稱:Hooked,代碼行數:18,代碼來源:class.User.php

示例6: executeFormValidation

 private function executeFormValidation()
 {
     $validation = new Validation($this->myView->data);
     switch ($this->action) {
         case 'typeDetail':
         case 'brandDetail':
             $fields['title'] = ['Mandatory'];
             break;
         case 'typeNewFeature':
             $fields['feature'] = ['Mandatory'];
             break;
     }
     return $validation->execute($fields);
 }
開發者ID:sohflp,項目名稱:Hooked,代碼行數:14,代碼來源:class.Product.php

示例7: executeFormValidation

 protected function executeFormValidation()
 {
     $validation = new Validation($this->myView->data);
     switch ($this->action) {
         case 'detail':
             if ($this->myView->data->status == Config::read('order.status')['sent']) {
                 $fields['tracking'] = ['Mandatory'];
             }
             break;
     }
     return $validation->execute($fields);
 }
開發者ID:sohflp,項目名稱:Hooked,代碼行數:12,代碼來源:class.Order.php

示例8: executeFormValidation

 protected function executeFormValidation()
 {
     $validation = new Validation($this->myView->data);
     if ($this->myView->data->status != Config::read('product.status')['approved']) {
         $fields['name'] = ['Mandatory'];
         $fields['text'] = ['Mandatory'];
         $fields['type'] = ['Mandatory'];
         $fields['price'] = ['Mandatory', 'ValidPrice'];
     }
     $fields['discount'] = ['ValidPrice'];
     return $validation->execute($fields);
 }
開發者ID:sohflp,項目名稱:Hooked,代碼行數:12,代碼來源:class.Product.php

示例9: executeFormValidation

 protected function executeFormValidation()
 {
     $validation = new Validation($this->myView->data);
     // Transfere callback para métodos respectivos
     switch ($this->action) {
         case 'myAccount':
             $fields['name'] = ['Mandatory'];
             $fields['surname'] = ['Mandatory'];
             $fields['cpf'] = ['Mandatory', 'ValidCPF'];
             $fields['phone'] = ['Mandatory', 'ValidPhone'];
             $fields['cellphone'] = ['ValidPhone'];
             break;
         case 'newAccount':
             $fields['name'] = ['Mandatory'];
             $fields['surname'] = ['Mandatory'];
             $fields['email'] = ['Mandatory', 'ValidEmail', 'DuplicateAccount'];
             $fields['password'] = ['Mandatory'];
             break;
         case 'password':
             $fields['email'] = ['Mandatory', 'ValidEmail'];
             break;
     }
     $return = $validation->execute($fields);
     // Mescla retorno da classe com validação de endereço
     if ($this->action == 'myAccount') {
         $return['error'] = $return['error'] || $this->__executeAddressFormValidation()['error'];
         $return['messages'] = array_merge($return['messages'], $this->__executeAddressFormValidation()['messages']);
     }
     return $return;
 }
開發者ID:sohflp,項目名稱:Hooked,代碼行數:30,代碼來源:class.Login.php


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