Exemple #1
0
<?php

/**
 * Formulaire de mise à jour
 */
use app\modules\cms\HCms;
use app\modules\cms\models\BaseNews;
use app\modules\cms\widgets\BaseNewsForm;
use yii\helpers\Html;
/**
 * @var yii\web\View $this
 * @var BaseNews     $model
 */
$this->title = HCms::t('labels', 'Update base news : {label}', ['label' => $model->event_date]);
?>
<div class="row panel panel-default">
    <div class="panel-heading">
        <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    </div>

    <div class="panel-body">
        <?php 
echo BaseNewsForm::widget(['model' => $model]);
?>
    </div>
</div>
Exemple #2
0
$this->registerJs("\n    \$('#webnews-base_id').change(function() {\n        var url = '/cms/base-news/get-form/' + \$(this).val();\n        \$('#base-model-display').load(url, function() {\n            \$('#base_tags_ids').select2({\n                placeholder: \"{$placeHolderMsg}\",\n                tags: true\n            });\n        });\n    });\n");
?>

<div class="backend-form">

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

    <?php 
echo $form->field($model, 'base_id')->dropDownList(ArrayHelper::map($baseNews, 'id', 'event_date'), ['prompt' => HLib::t('messages', 'Select a value in the list')]);
?>

    <fieldset id="base-model-display">
        <?php 
echo BaseNewsForm::widget(['model' => $baseModel, 'asNestedForm' => true]);
?>
    </fieldset>

    <fieldset>
        <div class="row">
            <div class="col-sm-4">
                <?php 
echo $form->field($model, 'language_id')->dropDownList(ArrayHelper::map($languages, 'id', 'iso_639_code'), ['prompt' => HLib::t('messages', 'Select a value in the list')]);
?>
            </div>

            <div class="col-sm-4">
                <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => true]);
?>
 /**
  * Renvoie le code HTML du formulaire associée à la BasePage d'identifiant $id
  *
  * @param int $id
  * @return mixed
  */
 public function actionGetForm($id)
 {
     $model = $this->findModel($id);
     return BaseNewsForm::widget(['model' => $model, 'asNestedForm' => true]);
 }