Exemple #1
0
?>
</h3>

        <div class="box-tools pull-right">
            <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button>
        </div>
    </div>

    <?php 
$form = ActiveForm::begin(['action' => ['index'], 'method' => 'get', 'layout' => 'horizontal', 'fieldClass' => RadiataField::className()]);
?>

    <div class="box-body">

        <?php 
echo $form->field($model, 'locale')->dropDownList(Lang::getLangForDropDown(), ['prompt' => Yii::t('b/radiata/forms', 'Choose value')]);
?>

        <?php 
echo $form->field($model, 'place_id')->dropDownList(BannerPlace::getPlacesForDropDown(), ['prompt' => Yii::t('b/radiata/forms', 'Choose value')]);
?>

        <?php 
echo $form->field($model, 'date_start')->dateInput();
?>

        <?php 
echo $form->field($model, 'date_end')->dateInput();
?>

        <?php 
Exemple #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getLanguage()
 {
     return $this->hasOne(Lang::className(), ['locale' => 'locale']);
 }
Exemple #3
0
 /**
  * Init all languages data
  *
  * return void
  */
 public function initLanguages()
 {
     $this->availableLanguages = Lang::getLanguages();
     $this->getDefaultLanguage();
 }
Exemple #4
0
?>

    <?php 
echo FieldHelper::showErrors($model);
?>

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

    <?php 
echo $form->field($model, 'place_id')->dropDownList(BannerPlace::getPlacesForDropDown(), ['prompt' => Yii::t('b/radiata/forms', 'Choose value')]);
?>

    <?php 
echo $form->field($model, 'locale')->dropDownList(Lang::getLangForDropDown(), ['prompt' => Yii::t('b/banner', 'All languages')]);
?>

    <?php 
echo $form->field($model, 'date_start')->dateInput();
?>

    <?php 
echo $form->field($model, 'date_end')->dateInput();
?>

    <?php 
echo $form->field($model, 'html')->textarea(['rows' => 6]);
?>

    <?php 
Exemple #5
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getLocales()
 {
     return $this->hasMany(Lang::className(), ['locale' => 'locale'])->viaTable('{{%news_tags_translation}}', ['parent_id' => 'id']);
 }
 /**
  * Finds the Lang model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Lang the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Lang::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }