Hi
I am using PHPManager for access control in Yii2 advanced template. I have set up authmanager as follows:
'authManager'=>[
'class' => 'yii\rbac\PhpManager',
],
In my controller, I have set up rules as follows:
return [
'access'=>[
'class' => AccessControl::className(),
'only' => ['view', 'index', 'create', 'update', 'delete'],
'rules' => [
[
//'actions' => ['view', 'index', 'create', 'update', 'delete'],
'allow' => true,
'roles' => ['@'],
],
],
],
];
I have generated crud functions with gii and the code for gridview is as follows:
<?php echo GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
[
//'attribute'=>'id',
'class' => 'yii\grid\CheckboxColumn'
],
'Job_Name',
[
'attribute'=>'Cat_Id',
//'header'=>'Job Category',
'value'=>function($model)
{
return Category::getCategoryName($model->Cat_Id);
}
],
'Employer',
[
'attribute'=>'IsDisclosed',
'value'=>function($model)
{
if($model->IsDisclosed)
return 'Yes';
else
return 'No';
}
],
// 'IsShow',
// 'CanAccess',
// 'Salary',
// 'SalaryPer',
// 'Location',
// 'Date_Posted',
// 'Apply_Before',
// 'Specific_Attributes:ntext',
// 'Responsibilities:ntext',
// 'Contact_Person',
// 'Job_Ref',
// 'Position_Type',
// 'Experience:ntext',
// 'Education:ntext',
[
'class' => 'yii\grid\ActionColumn',
],
],
]); ?>
This code was supposed to show links/buttons/icons in the action column for view, update and delete but I don’t see any at all.
Did I do something wrong with the configuration? Or did I miss something anywhere?
Can anybody please help me?
Thanks in advance.