У меня есть небольшая строка кода в Yii Framework:
array('username', 'unique', 'attributeName'=> 'username', 'caseSensitive' => 'false'),
, что дает мне ошибку:
RegisterForm and its behaviors do not have a method or closure named "tableName".
Полная модель RegisterForm.php:
<?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'),
);
}
}