assignment.php 1.65 KB
<?php

use yii\web\View;
use yii\helpers\Html;
use yii\helpers\ArrayHelper;

$this->title = $this->params['main_title'] . '-' . $this->params['sub_title'];
?>

<div class="col-md-12">
    <form class="form-bordered" method="POST" action="">
        <div class="panel panel-default">
            
            <div class="panel-heading">
                <h5 class="panel-title"><?=$role->name?></h5>
                <p><?=$role->description?></p>
            </div><!-- panel-heading -->

            <div class="panel-body">
                <ul class="row icon-list">
                    
                    <?php foreach ($allPermissions as $permissionName=>$permission):?>
                    <li class="col-xs-6 col-sm-4 col-md-3">
                        <div class="ckbox ckbox-default">
                            <?php echo Html::checkbox('permissions[]', array_key_exists($permissionName, $rolePermissions), ['id'=>$permissionName,'value'=>$permissionName])?>
                            <label for="<?=$permissionName?>"><?=$permission->description?></label>
                        </div>
                    </li>
                    <?php endforeach;?>
                    
                </ul>
              </div>

            <div class="panel-footer">
                <div class="row">
                    <div class="col-sm-9 col-sm-offset-3">
                        <button class="btn btn-primary mr5" id="upload_button">保存</button>
                        <a href="<?=$_refer?>" class="btn btn-dark">取消</a>
                    </div>
                </div>
            </div><!-- panel-footer -->
            
        </div><!-- panel -->
    </form>
</div>