문제

I wanted to integrate a verified email address functionality in CakePHP 1.3.

I have used valid email address regular expressions but I have never ever verified an email address' domain (a valid domain name means existing domain name).

I know how this is done in plain PHP but I want to use CakePHP's functionality to achieve this.

도움이 되었습니까?

해결책

There is already built-in functionality you can use.

Read the documentation:

Note the boolean $deep = false param which you can use to actually check for the domains existence.

다른 팁

assign this into your model

public $validate = array(       
        'email' => array(
            'email' => array(
                'rule' => array('email',true),
                'message' => 'Your custom message here',
                //'allowEmpty' => false,
                //'required' => false,
                //'last' => false, // Stop validation after this rule
                //'on' => 'create', // Limit validation to 'create' or 'update' operations
            ),
);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top