Exemple #1
0
                        <div class="col-sm-6">
                            <?php 
echo Select2::widget(['name' => 'vidmageMemes', 'data' => Meme::getMappedArray(), 'value' => ArrayHelper::getColumn($model->memeVidmages, 'meme_id'), 'options' => ['placeholder' => 'Select a Meme ...', 'multiple' => true], 'pluginOptions' => ['tags' => true]]);
?>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="control-label col-sm-3" for="vidmage-vidmagecategories">
                            <?php 
echo $model->getAttributeLabel('vidmageCategories');
?>
                        </label>
                        <div class="col-sm-6">
                            <?php 
echo Select2::widget(['name' => 'vidmageCategories', 'data' => Category::getMappedArray(), 'value' => ArrayHelper::getColumn($model->vidmageCategories, 'category_id'), 'options' => ['placeholder' => 'Select a category ...', 'multiple' => true], 'pluginOptions' => []]);
?>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3" for="vidmage-vidmageauthors">
                            <?php 
echo $model->getAttributeLabel('vidmageAuthors');
?>
                        </label>
                        <div class="col-sm-6">
                            <?php 
echo Select2::widget(['name' => 'vidmageAuthors', 'data' => Author::getMappedArray(), 'value' => ArrayHelper::getColumn($model->vidmageAuthors, 'author_id'), 'options' => ['placeholder' => 'Select an author ...', 'multiple' => true], 'pluginOptions' => ['tags' => true, 'tokenSeparators' => [',']]]);
?>
                        </div>
                    </div>
Exemple #2
0
            <?php 
$form = ActiveForm::begin(['id' => 'VidmageCategory', 'layout' => 'horizontal', 'enableClientValidation' => true, 'errorSummaryCssClass' => 'error-summary alert alert-error']);
?>

            <div class="">
                <?php 
$this->beginBlock('main');
?>

                <p>
                    
			<?php 
echo $form->field($model, 'vidmage_id')->dropDownList(Vidmage::getMappedArray());
?>
			<?php 
echo $form->field($model, 'category_id')->dropDownList(Category::getMappedArray());
?>
                </p>
                <?php 
$this->endBlock();
?>
                
                <?php 
echo Tabs::widget(['encodeLabels' => false, 'items' => [['label' => 'VidmageCategory', 'content' => $this->blocks['main'], 'active' => true]]]);
?>
                <hr/>
                <?php 
echo $form->errorSummary($model);
?>
                <?php 
echo Html::submitButton('<span class="glyphicon glyphicon-check"></span> ' . ($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Save')), ['id' => 'save-' . $model->formName(), 'class' => 'btn btn-success']);