Closed youanden closed 10 years ago
You just need to create a child class... something like:
class User extends \auth\models\User
{
public function rules()
{
return [
['first_name', 'required']
] + parent::rules();
}
}
You can create that model in your models
folder, and even create your own relations.
Feel free to comment (and contribute :) )
Thank you!
I am working with schema that has already been defined and populated (hence profile attributes are not currently possible) and am trying to override the
rules()
function without changing anything in the vendor folder.I am using the advanced yii2 beta organization and have attempted a variety of configurations (passing a different identity class), forcing my User model at common/models as well as backend/models to an edited copy of your auth\models\User class with no luck.
I'm excited by the organization of Yii and PHP 5.4s array syntax that would let me write rules like
Is there a way you know of where I can override your User model class?
Thank you for your time.