Been totally new to the Yii framework I have followed the tutorials, books and videos and was wondering if anyone could help with the following best practice question?
We have 4 user types
Each user can create a record but should be restricted to the information they can submit as some will be able to add additional information into the same record.
We have used Gii to create our basic CRUD structure and was wondering if we could extend the create.php view by creating a separate _form.php for each user form view?
Honestly, your design is a lazy design. You have to define accessRules for all each actions. And when you do the $model->save(), you need make sure all elements can pass the validation check before save.
So the better way is assigning user type during the user log-in, so it can be access by Yii::app()->user->type. Depends on your statement, user type may be used very often in your system. Once you can handle user->type, then, you only need to create one actionCreate, and one create.php file, but in create.php, you can determine the user type (Yii::app()->user->type) to show different renderPartials.