yangruiyou85 / yiidoc

Automatically exported from code.google.com/p/yiidoc
0 stars 0 forks source link

Accessing Model attribute inside function rules() #44

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. The documentation for accessing the value of the model's attribute
inside the Rules() function in CActiveRecord is missing.

What is the expected output? What do you see instead?
I expected to see the value of the attribute, but it came out null.

What version of the product are you using? On what operating system?
Using Yii-1.0.10, on freebsd 8.0

Please provide any additional information below.

To be able to include the Model's attribute property inside the Rules()
function.

eg. 
array('email','unique','caseSensitive'=>'false','message'=>'Specified email
address -'.$this->email.'- is already on file.')

The above will not work. 
we need to do 

array('email','unique','caseSensitive'=>'false','message'=>'Specified email
address -{value} - is already on file.')

This was not found in any documentation.

Original issue reported on code.google.com by arvind.r...@gmail.com on 17 Dec 2009 at 9:31

GoogleCodeExporter commented 9 years ago
Fixed in CUniqueValidator.

Original comment by qiang.xue on 27 Dec 2009 at 10:13

GoogleCodeExporter commented 9 years ago
I dont see any documentation on that page where
{value} is explained. Sorry, If i missed it, but I dont see it after searching.

Original comment by arvind.r...@gmail.com on 28 Dec 2009 at 7:20