Hello,
I'm following this tutorial on the Auth component: http://bit.ly/aNWz3J
I'm confused about three things and I can't figure it out on my own (trust me I tried).
Class User extends AppModel {
// ......
function password_match($data, $password_field, $hashed=true) {$password = $this->data[$this->alias][$password_field];$keys = array_keys($data);$password_confirm = $hashed ?Security::hash($data[$keys[0]], null, true) :$data[$keys[0]];return $password === $password_confirm}
}
Confusion #1: $data
It's my understanding that $data is a property of class Controller and it contains data which has been posted to the controller user HtmlHelper and that data here is accessible using the $this->data['ModelName']['fieldName'] format.
So why is it many times (in parameter list and in function body) that it's put out there simply as "$data"?
Confusion #2: $this->alias
What is $this->alias
Confusion #3: Where is the matching?
I don't see any matching.
Hope you guys can help. Thank you so much.
Jon Lyles
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment