Exemple #1
0
<?php

$create_url = Yii::app()->createAbsoluteUrl('/modulePermission/create');
$update_url = Yii::app()->createAbsoluteUrl('/modulePermission/update/' . $_GET['id']);
$form = $this->beginWidget('CActiveForm', array('id' => 'module-permission-form', 'action' => $model->isNewRecord ? $create_url : $update_url, 'enableClientValidation' => TRUE, 'clientOptions' => array('validateOnSubmit' => TRUE, 'validateOnChange' => TRUE), 'htmlOptions' => array('autocomplete' => 'off', 'role' => 'form'), 'focus' => array($model, 'module_id')));
$list = Department::getDepartmentList();
$typelist = UserRoles::getUserTypeList();
?>
<div class="row">
    <div class="col-md-6">
        <div class="row">
            <div class="col-md-12">
            	<div class="form-horizontal">
                <?php 
if ($model->isNewRecord) {
    ?>
                    <div class="form-group">
                        <?php 
    echo $form->labelEx($model, 'user_role_type', array('class' => 'col-sm-3 control-label'));
    ?>
                    <div class="col-sm-9">
                        <?php 
    echo $form->dropDownlist($model, 'user_role_type', $typelist, array('class' => 'form-control', 'empty' => 'Please Select ' . $model->getAttributeLabel('user_role_name')));
    ?>
                        <?php 
    echo $form->error($model, 'user_role_type', array('class' => 'text-red'));
    ?>
                    </div>
                    </div>
                <?php 
} else {