Exemplo n.º 1
0
?>
    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <?php 
echo Html::a(Html::tag('i', '', ['class' => 'glyphicon glyphicon-plus']) . ' ' . Yii::t('app', 'Create Street'), ['create'], ['class' => 'btn btn-success']);
?>
                </div>
                <div class="panel-body">
                    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>
                    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['id', 's_name', 's_type_id' => ['filter' => AddressStreetType::getAddressStreetTypeOptions(), 'attribute' => 's_type_id', 'value' => function (AddressStreet $data) {
    return $data->getSTypeId();
}], 'owner_id' => ['filter' => AddressCity::getAllOwnerIdOptions(), 'attribute' => 'owner_id', 'value' => function (AddressStreet $data) {
    return $data->getOwnerId();
}], ['class' => 'yii\\grid\\ActionColumn', 'contentOptions' => ['style' => 'width: 100px; text-align: center;']]]]);
?>
                </div>
            </div>
        </div>
    </div>
</div>
Exemplo n.º 2
0
            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="row">
                        <div class="col-md-12">
                            <?php 
echo $form->field($model, 's_name')->textInput(['maxlength' => true]);
?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <?php 
$ownerIdOptions = $model->isNewRecord && !empty($model->owner_id) ? ['disabled' => 1] : [];
?>
                            <?php 
echo $form->field($model, 'owner_id')->dropDownList(AddressCity::getAllOwnerIdOptions(), ['prompt' => ''] + $ownerIdOptions);
?>
                        </div>
                        <div class="col-md-6">
                            <?php 
echo $form->field($model, 's_type_id')->dropDownList(AddressStreetType::getAddressStreetTypeOptions(), ['prompt' => '']);
?>
                        </div>
                    </div>
                </div>
                <div class="panel-footer">
                    <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
                </div>
            </div>