yii-inheritance

Yii CUserIdentity vs a User Model

北慕城南 提交于 2020-01-13 19:55:13
问题 I have at least one model in my Yii project that will need to reference a particular user ID. In my SQL for the model I have something like CONSTRAINT FOREIGN KEY (user_id) REFERENCES User(id) . I was going to go ahead and create a User model when I came across the docs for CUserIdentity. I have to admit I am confused. Is a CUserIdentity a user or a state associated with a particular user-case? I would like to use as much of the built-in Yii features as possible since they handle a lot of

Yii CUserIdentity vs a User Model

南楼画角 提交于 2020-01-13 19:53:22
问题 I have at least one model in my Yii project that will need to reference a particular user ID. In my SQL for the model I have something like CONSTRAINT FOREIGN KEY (user_id) REFERENCES User(id) . I was going to go ahead and create a User model when I came across the docs for CUserIdentity. I have to admit I am confused. Is a CUserIdentity a user or a state associated with a particular user-case? I would like to use as much of the built-in Yii features as possible since they handle a lot of

How to load selected list items in multiple-select-listbox in update view in yii?

我只是一个虾纸丫 提交于 2019-12-07 01:00:37
问题 I have a multiple select-list-box for Staff in Create-Service-Form , used to select multiple staff when creating a new service. for this i can assign multiple staff on a single service. I saved staff_id field as: $model->staff_id = serialize($model->staff_id); Here the update-view code for multiple-select-list-box: <div class="row"> <?php echo $form->labelEx($model,'staff_id'); ?> <?php $data = array('1' => 'Sam', '2' => 'john', '3' => 'addy'); $htmlOptions = array('size' => '5', 'prompt'=>

Yii CUserIdentity vs a User Model

做~自己de王妃 提交于 2019-12-06 07:02:40
I have at least one model in my Yii project that will need to reference a particular user ID. In my SQL for the model I have something like CONSTRAINT FOREIGN KEY (user_id) REFERENCES User(id) . I was going to go ahead and create a User model when I came across the docs for CUserIdentity. I have to admit I am confused. Is a CUserIdentity a user or a state associated with a particular user-case? I would like to use as much of the built-in Yii features as possible since they handle a lot of security-related issues from what I understand, and I am aware of the existence of some modules like srbac