1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
use yii\helpers\Html; |
4
|
|
|
use yii\helpers\Json; |
5
|
|
|
use yii\widgets\DetailView; |
6
|
|
|
use yii2mod\rbac\RbacAsset; |
7
|
|
|
|
8
|
|
|
RbacAsset::register($this); |
9
|
|
|
|
10
|
|
|
/* @var $this yii\web\View */ |
11
|
|
|
/* @var $model \yii2mod\rbac\models\AuthItemModel */ |
12
|
|
|
|
13
|
|
|
$labels = $this->context->getLabels(); |
14
|
|
|
$this->title = Yii::t('yii2mod.rbac', $labels['Item'] . ' : {0}', $model->name); |
|
|
|
|
15
|
|
|
$this->params['breadcrumbs'][] = ['label' => Yii::t('yii2mod.rbac', $labels['Items']), 'url' => ['index']]; |
16
|
|
|
$this->params['breadcrumbs'][] = $model->name; |
17
|
|
|
$this->render('/layouts/_sidebar'); |
18
|
|
|
?> |
19
|
|
|
<div class="auth-item-view"> |
20
|
|
|
<h1><?php echo Html::encode($this->title); ?></h1> |
21
|
|
|
<p> |
22
|
|
|
<?php echo Html::a(Yii::t('yii2mod.rbac', 'Update'), ['update', 'id' => $model->name], ['class' => 'btn btn-primary']); ?> |
23
|
|
|
<?php echo Html::a(Yii::t('yii2mod.rbac', 'Delete'), ['delete', 'id' => $model->name], [ |
24
|
|
|
'class' => 'btn btn-danger', |
25
|
|
|
'data-confirm' => Yii::t('yii2mod.rbac', 'Are you sure to delete this item?'), |
26
|
|
|
'data-method' => 'post', |
27
|
|
|
]); ?> |
28
|
|
|
<?php echo Html::a(Yii::t('yii2mod.rbac', 'Create'), ['create'], ['class' => 'btn btn-success']); ?> |
29
|
|
|
</p> |
30
|
|
|
<div class="row"> |
31
|
|
|
<div class="col-sm-12"> |
32
|
|
|
<?php echo DetailView::widget([ |
33
|
|
|
'model' => $model, |
34
|
|
|
'attributes' => [ |
35
|
|
|
'name', |
36
|
|
|
'description:ntext', |
37
|
|
|
'ruleName', |
38
|
|
|
'data:ntext', |
39
|
|
|
], |
40
|
|
|
]); ?> |
41
|
|
|
</div> |
42
|
|
|
</div> |
43
|
|
|
<?php echo $this->render('../_dualListBox', [ |
44
|
|
|
'opts' => Json::htmlEncode([ |
45
|
|
|
'items' => $model->getItems(), |
46
|
|
|
]), |
47
|
|
|
'assignUrl' => ['assign', 'id' => $model->name], |
48
|
|
|
'removeUrl' => ['remove', 'id' => $model->name], |
49
|
|
|
]); ?> |
50
|
|
|
</div> |
51
|
|
|
|
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: