when i make new controller using GII … i want to make new users but when i click on this then it redirect to login page… how can i disable login for specific controller
when i make new controller using GII … i want to make new users but when i click on this then it redirect to login page… how can i disable login for specific controller
Remove create method from your controller’s accessRules method like below…
public function accessRules()
{
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('index','view'),
'users'=>array('*'),
),
array('allow', // allow authenticated user to perform 'create' and 'update' actions
[color="#FF0000"][b][sub]'actions'=>array([color="#FFFF00"]'create'[/color],'update'),[/sub][/b][/color]
'users'=>array('@'),
),
array('allow', // allow admin user to perform 'admin' and 'delete' actions
'actions'=>array('admin','delete'),
'users'=>array('admin'),
),
array('deny', // deny all users
'users'=>array('*'),
),
);
}
Also need to put [color="#006400"]create[/color] with [color="#FF0000"]‘actions’=>array(‘index’,‘view’),[/color]
like ‘actions’=>array(‘index’,‘view’,‘create’),