nineinchnick / yii2-usr

Yii framework module for user authentication, password reset, registration and profile updating. A port of yii-usr to Yii Framework 2.0.
http://demo2.niix.pl
MIT License
39 stars 8 forks source link

Move ExampleUser to behavior #28

Closed schmunk42 closed 10 years ago

schmunk42 commented 10 years ago

I haven't looked into it in detail, but it would be awesome if you could just attach a behavior to your custom User model class, instead of extending it.

In Yii 1, the user and rights module required this and it caused a lot of conflicts.

nineinchnick commented 10 years ago

It's just an example. You can either extend it (not recommended) or just copy it. I think most of the methods implementing interfaces would have minor changes.

Also, behaviors don't implement interfaces, we'd have to make two checks, one for instanceof and second for getBehavior().