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

  • SEARCH
  • Home
  • 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 7555253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:33:32+00:00 2026-05-30T11:33:32+00:00

I have this small line of code in Yii Framework: array(‘username’, ‘unique’, ‘attributeName’=> ‘username’,

  • 0

I have this small line of code in Yii Framework:

array('username', 'unique', 'attributeName'=> 'username', 'caseSensitive' => 'false'),

that gives me an error:

RegisterForm and its behaviors do not have a method or closure named "tableName".

The full RegisterForm.php model:

<?php
class RegisterForm extends CFormModel
{
    public $username;
    public $password;
    public $password2;
    public $email;
    public $fullname;
    public $birth;

    public function rules()
    {
        return array(
            array('username, password, password2, email, fullname, birth', 'required'),

            array('username','length','min'=>3),
            array('username','length','max'=>16),
            array('username', 'filter', 'filter'=>'strtolower'),
            array('username', 'ext.alpha', 'allowSpaces'=>'flase', 'allAccentedLetters'=>'false'),
            array('username', 'unique', 'attributeName'=> 'username', 'caseSensitive' => 'false'),

            array('password', 'length', 'min' =>6),
            array('password', 'length', 'max' =>32),
            array('password', 'compare', 'allowEmpty' => 'false', 'compareAttribute' => 'password2', 'strict' => 'true'),

            array('email', 'length', 'min' =>8),
            array('email', 'length', 'max' =>128),
            array('email', 'email'),

            array('fullname','length','min'=>6),
            array('fullname','length','max'=>64),
            array('fullname', 'ext.alpha', 'allowNumbers'=>'false', 'allAccentedLetters'=>'false'),

            array('birth', 'date', 'allowEmpty'=>'false', 'format'=>'dd/MM/yyyy'),
        );
    }
}
  • 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-30T11:33:33+00:00Added an answer on May 30, 2026 at 11:33 am

    You have to specify an additional property, className, in that validator. It should contain the name of the Active Record class whose table should be checked for uniqueness.

    http://www.yiiframework.com/doc/api/1.1/CUniqueValidator#className-detail

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

Sidebar

Related Questions

Let's say I have a line of text like this Small 0.0..20.0 0.00 1.49
I have this small code library that I'm considering releasing into Open Source. I
Work on this small test application to learn threading/locking. I have the following code,
I have this small snipped of code. I don't know ruby and I think
Inside a liquid css layout i have this code: <div class=column> <div class=absolute_small_column><p>Absolut small
I have written this small code snippet in C++, the output is also attached.
I have this small SQL query. SELECT a.`id` , a.`title` , a.`date` , (
I have this small class called City that simply holds some information about a
In my c# application i have this small form which is used to set
In CodeIgniter I'm using a base CRUD My_model , but I have this small

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.