Пример #1
0
?>

    <?php 
// $form->field($model, 'crowd')->textInput(['maxlength' => 225])
?>

    <?php 
// $form->field($modelBrandsCityField, 'crowd')->checkbox(['label'=>'Lock']);
?>

    <?php 
// $form->field($model, 'type')->dropDownList(ArrayHelper::merge(['' => 'Select'], ArrayHelper::map(\common\models\EstTypes::find()->andWhere(['status' => 1])->All(), 'Id', 'name')))
?>
 
    <?php 
echo $form->field($model, 'types')->widget(Multiselect::className(), ['data' => ArrayHelper::merge([], ArrayHelper::map(\common\models\EstTypes::find()->andWhere(['status' => 1])->All(), 'Id', 'name')), 'options' => ['multiple' => 'multiple', 'size' => 7, 'title' => 'Select Types']]);
?>

    <?php 
echo $form->field($modelBrandsCityField, 'type')->checkbox(['label' => 'Lock']);
?>

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

    <?php 
echo $form->field($modelBrandsCityField, 'facebookUrl')->checkbox(['label' => 'Lock']);
?>

    <?php 
Пример #2
0
 public function getTypesnames()
 {
     if ($this->cusinies) {
         $cuisines = explode(',', $this->type);
         if (!is_array($cuisines)) {
             $cuisines[] = $cuisines;
         }
         $cusStr = '';
         for ($i = 0; $i < count($cuisines); $i++) {
             $cusStr .= "'" . $cuisines[$i] . "',";
         }
         $cusStr = substr($cusStr, 0, -1);
         $res = EstTypes::find()->where('Id IN (' . $cusStr . ')')->all();
         $cuisine = [];
         foreach ($res as $model) {
             $cuisine[] = $model->name;
         }
         return implode(', ', $cuisine);
     }
 }