当前位置: 首页>>代码示例>>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;未经允许,请勿转载。