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


PHP Validation::blank方法代码示例

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


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

示例1: blank

 /**
  * Checks if resource is not blank or empty
  *
  * @param mixed $check Array or string
  * @return boolean
  */
 static function blank($check)
 {
     if (empty($check)) {
         return true;
     }
     if (TransferValidation::fileUpload($check) && $check['error'] == UPLOAD_ERR_NO_FILE) {
         return true;
     }
     if (is_string($check) && Validation::blank($check)) {
         return true;
     }
     return false;
 }
开发者ID:razzman,项目名称:media,代码行数:19,代码来源:TransferValidation.php

示例2: check

 public function check()
 {
     //busca o post
     $login = DataHandler::getValueByArrayIndex($_POST, "login");
     $password = DataHandler::getValueByArrayIndex($_POST, "password");
     //iniciando o retorno padrao em http client ajax
     $returnResult = new ReturnResultVO();
     //se não validar retornar erro
     if (!Validation::blank($password, 1) && !Validation::blank($login, 1)) {
         $returnResult->success = 0;
         $returnResult->message = "Envie Login e Senha";
     } else {
         //cadastra o usuario e os detalhes do mesmo
         $DAO = UserDetailDAO::getInstance();
         $ReturnDataVO = $DAO->checkLogin($login, $password);
         //print_r($ReturnDataVO);
         if ($ReturnDataVO->success && count($ReturnDataVO->result) > 0) {
             if ($ReturnDataVO->result[0]->user_type_id == Config::ADMIN_USER_TYPE_ID || $ReturnDataVO->result[0]->user_type_id == Config::DEVELOPER_USER_TYPE_ID) {
                 UserClient::setId($ReturnDataVO->result[0]->id);
                 UserClient::setTypeId($ReturnDataVO->result[0]->user_type_id);
                 UserClient::setActiveTime(time());
                 //setando sucesso true caso tenha dado certo
                 $returnResult->success = $ReturnDataVO->success;
                 $returnResult->message = "sucesso ao logar";
             } else {
                 //print_r($ReturnDataVO);
                 $returnResult->success = 0;
                 $returnResult->message = "Usuario sem permissão!";
             }
         } else {
             //print_r($ReturnDataVO);
             $returnResult->success = 0;
             $returnResult->message = "Erro ao Logar!";
         }
     }
     //Debug::print_r($returnResult); exit();
     if ($returnResult->success) {
         if ($this->to != "") {
             Navigation::redirect($this->to);
         } else {
             Navigation::redirect("backend");
         }
     } else {
         return $this->init($returnResult);
     }
 }
开发者ID:reytuty,项目名称:facil,代码行数:46,代码来源:Login.php

示例3: check

 public function check()
 {
     //busca o post
     $login = DataHandler::getValueByArrayIndex($_POST, "login");
     $password = DataHandler::getValueByArrayIndex($_POST, "password");
     //iniciando o retorno padrao em http client ajax
     $returnResult = new ReturnResultVO();
     //se não validar retornar erro
     if (!Validation::blank($password, 1) && !Validation::blank($login, 1)) {
         $returnResult->success = 0;
         $returnResult->addMessage("Envie Login e Senha");
     } else {
         //cadastra o usuario e os detalhes do mesmo
         $DAO = UserDetailDAO::getInstance();
         $ReturnDataVO = $DAO->checkLogin($login, $password);
         if ($ReturnDataVO->success && count($ReturnDataVO->result) > 0) {
             UserClient::setId($ReturnDataVO->result[0]->id);
             UserClient::setTypeId($ReturnDataVO->result[0]->user_type_id);
             UserClient::setActiveTime(time());
             //setando sucesso true caso tenha dado certo
             $returnResult->success = $ReturnDataVO->success;
             $message_success = file_get_contents(Config::getAsset("templates/login_sucesso.txt"));
             $returnResult->addMessage($message_success);
         } else {
             //print_r($ReturnDataVO);
             $returnResult->success = 0;
             $returnResult->addMessage("Erro ao Logar!");
         }
     }
     if ($returnResult->success) {
         if ($this->to != "") {
             Navigation::redirect($this->to);
         }
     }
     echo $returnResult->toJson();
     exit;
 }
开发者ID:reytuty,项目名称:facil,代码行数:37,代码来源:Login.php

示例4: testBlankAsArray

 /**
  * testBlankAsArray method
  *
  * @return void
  */
 public function testBlankAsArray()
 {
     $this->assertTrue(Validation::blank(array('check' => '')));
     $this->assertTrue(Validation::blank(array('check' => ' ')));
     $this->assertTrue(Validation::blank(array('check' => "\n")));
     $this->assertTrue(Validation::blank(array('check' => "\t")));
     $this->assertTrue(Validation::blank(array('check' => "\r")));
     $this->assertFalse(Validation::blank(array('check' => '    Blank')));
     $this->assertFalse(Validation::blank(array('check' => 'Blank')));
 }
开发者ID:alvaroziqar,项目名称:galei,代码行数:15,代码来源:ValidationTest.php

示例5: validateParamether

 private function validateParamether()
 {
     //vai validar a VO inteira conforme as regras
     if (!Validation::blank($this->__table, 2)) {
         return FALSE;
     }
     if (!$this->getId() > 0) {
         return FALSE;
     }
     return TRUE;
 }
开发者ID:reytuty,项目名称:facil,代码行数:11,代码来源:BaseParametherVO.class.php

示例6: validate

 /**
  * valida��o da VO para ver se est� apta a ser cadastrada
  * @return array
  */
 function validate()
 {
     //vai validar a VO inteira conforme as regras
     $ReturnResultVO = new ReturnResultVO();
     $ReturnResultVO->sucess = TRUE;
     if (!Validation::blank($this->name, 2)) {
         $ReturnResultVO->sucess = FALSE;
         $ReturnResultVO->addMessage(Translation::text("LibraryLanguage::ERROR_PARAMETHER_VALIDATE_NAME"));
     }
     return $ReturnResultVO;
 }
开发者ID:reytuty,项目名称:facil,代码行数:15,代码来源:ParametherVO.class.php

示例7: testBlank

 /**
  * testBlank method
  *
  * @return void
  */
 public function testBlank()
 {
     $this->assertTrue(Validation::blank(''));
     $this->assertTrue(Validation::blank(' '));
     $this->assertTrue(Validation::blank("\n"));
     $this->assertTrue(Validation::blank("\t"));
     $this->assertTrue(Validation::blank("\r"));
     $this->assertFalse(Validation::blank('    Blank'));
     $this->assertFalse(Validation::blank('Blank'));
 }
开发者ID:noibilism,项目名称:nst_portal,代码行数:15,代码来源:ValidationTest.php

示例8: testInvalidBlank

 /**
  * @testdox blank should return false to non-empty string
  */
 public function testInvalidBlank()
 {
     $value = 'Spaghetti';
     $this->assertFalse(Validation::blank($value));
 }
开发者ID:klawdyo,项目名称:spaghettiphp,代码行数:8,代码来源:ValidationTest.php

示例9: validate

 function validate()
 {
     //vai validar a VO inteira conforme as regras
     $ReturnResultVO = new ReturnResultVO();
     $ReturnResultVO->success = TRUE;
     if (!Validation::blank($this->table, 1)) {
         $ReturnResultVO->success = FALSE;
         $ReturnResultVO->addMessage(Translation::text("LibraryLanguage::ERROR_LINK_VALIDATE_TABLE"));
     }
     if (!Validation::blank($this->linked_table, 1)) {
         $ReturnResultVO->success = FALSE;
         $ReturnResultVO->addMessage(Translation::text("LibraryLanguage::ERROR_LINK_VALIDATE_LINKED_TABLE"));
     }
     if (!$this->table_id > 0) {
         $ReturnResultVO->success = FALSE;
         $ReturnResultVO->addMessage(Translation::text("LibraryLanguage::ERROR_LINK_VALIDATE_TABLE_ID"));
     }
     if (!$this->linked_table_id > 0) {
         $ReturnResultVO->success = FALSE;
         $ReturnResultVO->addMessage(Translation::text("LibraryLanguage::ERROR_LINK_VALIDATE_LINKED_TABLE_ID"));
     }
     return $ReturnResultVO;
 }
开发者ID:reytuty,项目名称:facil,代码行数:23,代码来源:LinkVO.class.php

示例10: checkDateComp

 /**
  * Used to compare 2 datetime values.
  *
  * @param object &$model use model
  * @param string|array $check datetime string
  * @param string $operator Can be either a word or operand
  *	is greater >, is less <, greater or equal >=
  *	less or equal <=, is less <, equal to ==, not equal !=
  * @param string $compare compare datetime string
  * @return bool Success
  */
 public function checkDateComp(&$model, $check, $operator, $compare)
 {
     // 比較対象がないので比較する必要なし
     if (Validation::blank($model->data['Registration'][$compare])) {
         return true;
     }
     $check2 = strtotime($model->data['Registration'][$compare]);
     foreach ($check as $val) {
         if (Validation::blank($val)) {
             continue;
         }
         $check1 = strtotime($val);
         $ret = Validation::comparison($check1, $operator, $check2);
         if (!$ret) {
             return false;
         }
     }
     return true;
 }
开发者ID:NetCommons3,项目名称:Registrations,代码行数:30,代码来源:RegistrationValidateBehavior.php

示例11: validate

 /**
  * Validação da VO para ver se está apta a ser cadastrada
  * @return array
  */
 function validate()
 {
     //vai validar a VO inteira conforme as regras
     $ReturnResultVO = new ReturnResultVO();
     $ReturnResultVO->success = TRUE;
     //o login é um email por isso deve ser validado como email
     if (!Validation::blank($this->getLastName(), 1)) {
         //não tem mais de 1 nome, precisa de sobrenome
         $ReturnResultVO->success = FALSE;
         $ReturnResultVO->addMessage("preencha seu sobrenome");
     }
     if (!Validation::blank($this->getName(), 1)) {
         //não tem mais de 1 nome, precisa de sobrenome
         $ReturnResultVO->success = FALSE;
         $ReturnResultVO->addMessage("preencha seu nome");
     }
     if (!Validation::blank($this->getPassword(), 4)) {
         $ReturnResultVO->success = FALSE;
         $ReturnResultVO->addMessage(Translation::text("digite uma senha"));
     }
     if (!Validation::validateEmail($this->getEmail())) {
         $ReturnResultVO->success = FALSE;
         $ReturnResultVO->addMessage(Translation::text("E-mail invalido"));
     }
     return $ReturnResultVO;
 }
开发者ID:reytuty,项目名称:facil,代码行数:30,代码来源:UserDetailVO.class.php

示例12: validate

 /**
  * @desc Validação da VO para ver se está apta a ser cadastrada
  * @return ReturnResultVO
  */
 function validate()
 {
     //vai validar a VO inteira conforme as regras
     $ReturnResultVO = new ReturnResultVO();
     $ReturnResultVO->success = TRUE;
     if (!Validation::validateEmail($this->from)) {
         $ReturnResultVO->success = FALSE;
         $ReturnResultVO->addMessage(Translation::text("LibraryLanguage::ERROR_CONTACT_INVALID_FROM_EMAIL"));
     }
     if (!Validation::validateEmail($this->to)) {
         $ReturnResultVO->success = FALSE;
         $ReturnResultVO->addMessage(Translation::text("LibraryLanguage::ERROR_CONTACT_INVALID_TO_EMAIL"));
     }
     if (!Validation::blank($this->from_name, 2)) {
         $ReturnResultVO->success = FALSE;
         $ReturnResultVO->addMessage(Translation::text("LibraryLanguage::ERROR_CONTACT_INVALID_NAME"));
     }
     if (!Validation::blank($this->body, 2)) {
         $ReturnResultVO->success = FALSE;
         $ReturnResultVO->addMessage(Translation::text("LibraryLanguage::ERROR_CONTACT_INVALID_MESSAGE"));
     }
     if (!Validation::blank($this->host, 8)) {
         $ReturnResultVO->success = FALSE;
         $ReturnResultVO->addMessage(Translation::text("LibraryLanguage::ERROR_CONTACT_INVALID_HOST"));
     }
     if (!Validation::blank($this->username, 2)) {
         $ReturnResultVO->success = FALSE;
         $ReturnResultVO->addMessage(Translation::text("LibraryLanguage::ERROR_CONTACT_INVALID_USERNAME"));
     }
     if (!Validation::blank($this->password, 2)) {
         $ReturnResultVO->success = FALSE;
         $ReturnResultVO->addMessage(Translation::text("LibraryLanguage::ERROR_CONTACT_INVALID_PASSWORD"));
     }
     return $ReturnResultVO;
 }
开发者ID:reytuty,项目名称:facil,代码行数:39,代码来源:MailInfoPostVO.php

示例13: validateContentFields

 /**
  * @param $field_name string
  * @param $field_value *
  * @return ReturnResultVO
  */
 protected function validateContentFields($field_name, $VO)
 {
     $ReturnResultVO = new ReturnResultVO();
     $ReturnResultVO->success = TRUE;
     //para o aptana
     if (FALSE) {
         $VO = new ContentSiteVO();
     }
     switch ($field_name) {
         case "name":
             $ReturnResultVO->success = Validation::blank($VO->getName(), 1);
             //echo Debug::li("  getName:".$VO->getName());
             break;
         case "title":
             $ReturnResultVO->success = Validation::blank($VO->getTitle(), 1);
             break;
         case "hat":
             $ReturnResultVO->success = Validation::blank($VO->getHat(), 1);
             break;
         case "description":
             $ReturnResultVO->success = Validation::blank($VO->getDescription(), 1);
             break;
         case "content":
             $ReturnResultVO->success = Validation::blank($VO->getContent(), 1);
             break;
         case "files":
             $returnTemp = $_FILES["file"];
             $ReturnResultVO->success = count($returnTemp) > 0;
             break;
         case "images":
             $returnTemp = $_FILES["image"];
             $ReturnResultVO->success = count($returnTemp) > 0;
             break;
     }
     return $ReturnResultVO;
 }
开发者ID:reytuty,项目名称:facil,代码行数:41,代码来源:Content.php


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