Пример #1
0
    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => 255]);
?>
    
    <?php 
$availableChampionships = [];
if (!$model->isNewRecord) {
    $championship = Championship::findOne($model->championship_id);
    if (isset($championship->id)) {
        $availableChampionships = [$championship->id => $championship->name];
    }
}
echo $form->field($model, 'championship_id')->widget(SelectizeDropDownList::classname(), ['loadUrl' => Url::to(['championship/championship-part-list']), 'items' => $availableChampionships, 'options' => ['multiple' => false], 'clientOptions' => ['valueField' => 'value', 'labelField' => 'text', 'persist' => false]]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Добавить' : 'Изменить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

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

</div>
Пример #2
0
            <div id="source-url"><?php 
echo $model->source_url;
?>
</div>
        </div>
    </div>
    

    <?php 
$availableTags = [];
if (isset($tags)) {
    foreach ($tags as $tag) {
        $availableTags[$tag->id] = $tag->name;
    }
}
echo $form->field($model, 'tags')->widget(SelectizeDropDownList::classname(), ['loadUrl' => '/admin/tag/tag-list', 'items' => $availableTags, 'options' => ['multiple' => true], 'clientOptions' => ['delimiter' => ',', 'valueField' => 'value', 'labelField' => 'text', 'persist' => false, 'createOnBlur' => true, 'maxItems' => 10, 'create' => new JsExpression('function(input) { return { value: "{new}" + input, text: input } }')]]);
?>

    <?php 
echo $form->field($model, 'content_category_id')->dropDownList($model::categoryDropdown());
?>

    <?php 
$pluginOptions = ['showUpload' => false, 'showRemove' => false, 'overwriteInitial' => true, 'browseLabel' => "Обзор...", 'allowedFileExtensions' => ['jpg', 'jpeg', 'gif', 'png']];
if (isset($image) && $image->getFileUrl()) {
    $pluginOptions['initialPreview'] = [Html::img($image->getFileUrl())];
}
echo $form->field($model, 'image')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*', 'multiple' => false], 'pluginOptions' => $pluginOptions]);
?>

    <?php 
Пример #3
0
use dosamigos\selectize\SelectizeDropDownList;
use yii\helpers\Url;
use kartik\select2\Select2;
use yii\helpers\ArrayHelper;
use common\models\Amplua;
/* @var $this yii\web\View */
/* @var $model common\models\Composition */
$this->title = 'Добавить игрока в состав';
$this->params['breadcrumbs'][] = ['label' => 'Составы команд матчей', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="composition-create">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <?php 
$form = ActiveForm::begin(['id' => 'team' . $model->command_id . '-player-add-form']);
echo $form->field($contractModel, 'player_id')->widget(SelectizeDropDownList::classname(), ['loadUrl' => Url::to(['player/player-list']), 'options' => ['multiple' => false], 'clientOptions' => ['valueField' => 'value', 'labelField' => 'text', 'persist' => false]]);
echo $form->field($contractModel, 'amplua_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Amplua::find()->all(), 'id', 'name'), 'language' => 'ru', 'options' => ['placeholder' => 'Выберите амплуа...'], 'pluginOptions' => ['allowClear' => true]]);
echo $form->field($contractModel, 'number')->textInput();
echo $form->field($model, 'is_basis')->widget(CheckboxX::classname(), ['pluginOptions' => ['threeState' => false], 'options' => ['id' => 'team' . $model->command_id . '-create-is_basis']]);
echo $form->field($model, 'is_captain')->widget(CheckboxX::classname(), ['pluginOptions' => ['threeState' => false], 'options' => ['id' => 'team' . $model->command_id . '-create-is_captain']]);
echo Html::submitButton('Добавить', ['class' => 'btn btn-primary']);
ActiveForm::end();
?>

</div>
Пример #4
0
    <?php 
$form = ActiveForm::begin();
?>
    
    <div class="row">
        <div class="col-sm-6">
        <?php 
$availableTeams = [];
if (!$model->isNewRecord) {
    $team = $model->team;
    if (isset($team->id)) {
        $availableTeams = [$team->id => $team->name];
    }
}
echo $form->field($model, 'command_id')->widget(SelectizeDropDownList::classname(), ['loadUrl' => Url::to(['team/team-list']), 'items' => $availableTeams, 'options' => ['multiple' => false, 'placeholder' => 'Выберите команду...'], 'clientOptions' => ['valueField' => 'value', 'labelField' => 'text', 'persist' => false]]);
?>
        </div>
        
        <div class="col-sm-6">
        <?php 
echo $form->field($model, 'championship_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Championship::find()->all(), 'id', 'name'), 'language' => 'ru', 'options' => ['placeholder' => 'Выберите чемпионат...'], 'pluginOptions' => ['allowClear' => true]]);
?>
        </div>
    </div>
    
    <div class="row">
        <div class="col-sm-6">
        <?php 
echo $form->field($model, 'league_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(League::find()->all(), 'id', 'name'), 'language' => 'ru', 'options' => ['placeholder' => 'Выберите лигу...'], 'pluginOptions' => ['allowClear' => true]]);
?>
Пример #5
0
    }
}
echo $form->field($model, 'arbiter_assistant_4_id')->widget(SelectizeDropDownList::classname(), ['loadUrl' => Url::to(['arbiter/arbiter-list']), 'items' => $availableArbiters, 'options' => ['multiple' => false], 'clientOptions' => ['valueField' => 'value', 'labelField' => 'text', 'persist' => false]]);
?>
        </div>
        
        <div class="col-sm-6">
            <?php 
$availableArbiters = [];
if (!$model->isNewRecord) {
    $arbiter = Arbiter::findOne($model->arbiter_reserve_id);
    if (isset($arbiter->id)) {
        $availableArbiters = [$arbiter->id => $arbiter->name];
    }
}
echo $form->field($model, 'arbiter_reserve_id')->widget(SelectizeDropDownList::classname(), ['loadUrl' => Url::to(['arbiter/arbiter-list']), 'items' => $availableArbiters, 'options' => ['multiple' => false], 'clientOptions' => ['valueField' => 'value', 'labelField' => 'text', 'persist' => false]]);
?>
        </div>
    </div>

    <?php 
echo $form->field($model, 'announcement')->widget(\vova07\imperavi\Widget::className(), ['settings' => ['lang' => 'ru', 'minHeight' => 200, 'plugins' => ['fullscreen', 'table', 'video', 'fontcolor']]]);
?>

    <?php 
echo $form->field($model, 'is_visible')->widget(CheckboxX::classname(), ['pluginOptions' => ['threeState' => false]]);
?>
    
    <?php 
echo $form->field($model, 'is_finished')->widget(CheckboxX::classname(), ['pluginOptions' => ['threeState' => false]]);
?>
Пример #6
0
/* @var $this yii\web\View */
/* @var $model common\models\SelectedBlog */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="selected-blog-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
$availablePost = [];
if (isset($model->post)) {
    $availablePost[$model->post->id] = $model->post->title;
}
echo $form->field($model, 'post_id')->widget(SelectizeDropDownList::classname(), ['loadUrl' => '/admin/post/blog-list', 'items' => $availablePost, 'options' => ['multiple' => false], 'clientOptions' => ['delimiter' => ',', 'persist' => false, 'createOnBlur' => false, 'maxItems' => 1]]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Добавить' : 'Изменить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

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

</div>