Esempio n. 1
0
echo $form->field($model, 'name')->textInput(['maxlength' => 80]);
?>

    <?php 
echo $form->field($model, 'phone')->textInput(['maxlength' => 20]);
?>

    <?php 
echo $form->field($model, 'email')->textInput(['maxlength' => 80]);
?>

    <?php 
echo $form->field($model, 'website')->textInput(['maxlength' => 255]);
?>

    <?php 
echo $form->field($model, 'units')->dropDownList(Facility::getLocalizedConstants('UNITS_'));
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('igolf', 'Create') : Yii::t('igolf', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>
Esempio n. 2
0
<?php

use yii\data\ActiveDataProvider;
use kartik\detail\DetailView;
use common\models\Facility;
use common\models\Course;
/* @var $this yii\web\View */
/* @var $model app\models\Facility */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('igolf', 'Facilities'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="facility-view">

    <?php 
echo DetailView::widget(['model' => $model, 'panel' => ['heading' => '<h3>' . $model->name . '</h3>'], 'labelColOptions' => ['style' => 'width: 30%'], 'attributes' => ['name', 'phone', 'email:email', 'website', ['attribute' => 'units', 'type' => DetailView::INPUT_DROPDOWN_LIST, 'items' => Facility::getLocalizedConstants('UNITS_'), 'value' => Yii::t('igolf', $model->units)]]]);
?>

<?php 
$dataProvider = new ActiveDataProvider(['query' => $model->getCourses()]);
echo $this->render('../course/_list', ['dataProvider' => $dataProvider, 'facility' => $model]);
?>

<?php 
echo $this->render('../media/_add', ['model' => $model]);
?>

</div>