Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6652359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:07:41+00:00 2026-05-26T01:07:41+00:00

using cakephp 2.0 rc3. following validation in my model: var $validate = array( ‘loginname’

  • 0

using cakephp 2.0 rc3.

following validation in my model:

var $validate = array(
        'loginname' => array(
            'minCharactersRule' => array(
                'rule' => array('minLength', 3),
            ),
            'alphaNumericRule' => array(
                'rule' => 'alphaNumeric',
            ),
            'uniqueRule' => array(
                'rule' => 'isUnique',
            ),
            'on' => 'create',
            'required' => true,
            'allowEmpty' => false,
        ),

        'password' => array(
            'minCharactersRule' => array(
                'rule' => array('minLength', 5),
            ),
            'required' => true,
            'allowEmpty' => false,
        ),

        'email' => array(
            'emailRule' => array(
                'rule' => array('email'),
            ),
            'uniqueRule' => array(
                'rule' => 'isUnique',
            ),
            'required' => true,
            'allowEmtpy' => false,
        ),

        'display_name' => array(
            'betweenRule' => array(
                'rule' => array('between', 3, 20),
            ),
            'uniqueRule' => array(
                'rule' => 'isUnique',
            ),
            'required' => true,
            'allowEmpty' => false,
        ),

        'registered' => array(
            'rule' => array('date', 'ymd'),
            'required' => false,
            'allowEmpty' => false,
            'on' => 'create'
        ),

        'status' => array(
            'rule' => 'numeric',
            'required' => false,
            'allowEmpty' => false,
            'on' => 'create'
        ),
    );

when i fill out every field and submit im getting “required” error messages…
debug($this->Model->validationErrors) says:

Array(
[loginname] => Array
    (
        [0] => required
    )

[password] => Array
    (
        [0] => required
    )

[email] => Array
    (
        [0] => required
    )

[display_name] => Array
    (
        [0] => required
    ))

in addition some ugly warnings appear:

Warning (2): preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash [CORE/Cake/Model/Model.php, line 2981]

(4 times)

when i saw it the first time, i thought i misstyped anything, but after checking 3-4 times and getting the same error, i decided to come here to ask 😡
am i missing anything? running out of ideas …

nahri

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:07:41+00:00Added an answer on May 26, 2026 at 1:07 am

    after reading the cookbook examples again, i found the solution.

    every single rule must have the required, allowEmpty, etc, parameters given, not the field itself.

    this makes no sense to me, but thats how it is described in the manual and how it works..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using CakePHP 1.3, I have the following layout: /srv/www/_cakephp13/ /app/ /cake/ /plugins/ /vendors/ etc...
Using CakePHP, I created select-option form element with: echo $form->select('items', $numeration , array('selected' =>
I am using cakephp 1.2 and I have an array that appears to have
Using CakePHP 1.3 I understand the example at http://book.cakephp.org/complete/1143/Data-Validation#Adding-your-own-Validation-Methods-1181 on how to add my
Using CakePHP 1.3 I have a fairly large model in CakePHP, and I'd like
I am using cakephp. I have a form with an element array. For ex:-
i am using cakephp facebook plugin. when i click login. i get the following
I am using cakephp framework to build my application. I want that, whenever a
I am using CakePHP framework with MySQL database and I have problem in saving
I'm using CakePHP to build an application using the MVC Pattern, but my question

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.