Cakephp validation issue: delimiter must not be alphanumeric or backslash

solution found:

I spelled "nonEmpty" incorrectly - nothing is visible here, move forward.


I am just starting on cakePHP and I ran into this problem

Warning (2): preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash [CORE/cake/libs/model/model.php, line 2611]

I get this when I try to add / edit a post. This is caused by this verification code:

 var $validate = array( 'title' => array( 'title_not_blank' => array( 'rule' => 'nonEmpty', 'message' => 'This post is missing a title' ), 'title_unique' => array( 'rule' => 'isUnique', 'message' => 'A post with this title already exists' ) ), 'body' => array( 'body_not_blank' => array( 'rule' => 'notEmpty', 'message' => 'Post is missing its body' ) ) ); 

I have no idea what to do? Any help?

+8
php cakephp
source share
1 answer

You know? You correctly execute the rules / verification code (even with multiple rules for each field). The only reason for your problem is that you write nonEmpty instead of notEmpty (note t ) in the first rule.

Yes, I know how to upset these minor things. Perhaps that is why we ultimately developed OCD .: D

+21
source share

All Articles