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


PHP Validator::isEmail方法代碼示例

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


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

示例1: testEmailDomainCheckBadMxrr

 public function testEmailDomainCheckBadMxrr()
 {
     Mocker::overwriteFunction('lithium\\util\\getmxrr', function ($host, &$mxhosts) {
         $mxhosts = array();
         return true;
     });
     $this->assertTrue(Validator::isEmail('abc.efg@invalidfoo.com', null, array('deep' => true)));
 }
開發者ID:nilamdoc,項目名稱:KYCGlobal,代碼行數:8,代碼來源:ValidatorTest.php

示例2: testEmailDomainCheck

 /**
  * Tests email address validation, with additional hostname lookup
  *
  * @return void
  */
 public function testEmailDomainCheck()
 {
     $this->skipIf(dns_check_record("google.com") === false, "No internet connection.");
     $this->assertTrue(Validator::isEmail('abc.efg@rad-dev.org', null, array('deep' => true)));
     $this->assertFalse(Validator::isEmail('abc.efg@invalidfoo.com', null, array('deep' => true)));
     $this->assertFalse(Validator::isEmail('abc@example.abcd', null, array('deep' => true)));
 }
開發者ID:WarToaster,項目名稱:HangOn,代碼行數:12,代碼來源:ValidatorTest.php

示例3: testEmailDomainCheck

 /**
  * Tests email address validation, with additional hostname lookup
  *
  * @return void
  */
 public function testEmailDomainCheck()
 {
     $this->assertTrue(Validator::isEmail('abc.efg@rad-dev.org', null, array('deep' => true)));
     $this->assertFalse(Validator::isEmail('abc.efg@invalidfoo.com', null, array('deep' => true)));
     $this->assertFalse(Validator::isEmail('abc@example.abcd', null, array('deep' => true)));
 }
開發者ID:kdambekalns,項目名稱:framework-benchs,代碼行數:11,代碼來源:ValidatorTest.php

示例4: testEmailDomainCheck

 /**
  * Tests email address validation, with additional hostname lookup
  */
 public function testEmailDomainCheck()
 {
     $message = "No internet connection established.";
     $this->skipIf(!$this->_hasNetwork(), $message);
     $this->assertTrue(Validator::isEmail('abc.efg@rad-dev.org', null, array('deep' => true)));
     $this->assertFalse(Validator::isEmail('abc.efg@invalidfoo.com', null, array('deep' => true)));
     $this->assertFalse(Validator::isEmail('abc@example.abcd', null, array('deep' => true)));
 }
開發者ID:davidpersson,項目名稱:FrameworkBenchmarks,代碼行數:11,代碼來源:ValidatorTest.php

示例5:

			if(Validator::rule('uniqueEmail', $params['data']['email']) === false) {
				$params['data']['email'] = ''; 
			}
			
		} else {
			// If the fields password and password_confirm both exist, then validate the password field too
			if((isset($params['data']['password'])) && (isset($params['data']['password_confirm']))) {
				if(Validator::rule('moreThanFive', $params['data']['password']) === true) {
					$params['data']['password'] = String::hash($params['data']['password']); // will be sha512
				}
			}
			
			// If the new_email field was passed, the user is requesting to update their e-mail, we will set it and send an email to allow them to confirm, once confirmed it will be changed
			if(isset($params['data']['new_email'])) {
				// Unique E-mail validation
				if((Validator::rule('uniqueEmail', $params['data']['new_email']) === false) || (Validator::isEmail($params['data']['new_email']) === false)) {
					// Invalidate
					$params['data']['new_email'] = '';
				} else {
					$params['data']['approval_code'] = Util::unique_string(array('hash' => 'md5'));
					Email::changeUserEmail(array('first_name' => $params['data']['first_name'], 'last_name' => $params['data']['last_name'], 'to' => $params['data']['new_email'], 'approval_code' => $params['data']['approval_code']));
				}
			}
		}
	
	}
	
	//$data = array($params['entity']->file);
	//Asset::save($data);
	
	return $chain->next($self, $params, $chain);
開發者ID:nateabele,項目名稱:Minerva-Plugin,代碼行數:31,代碼來源:User.php


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