echo $form->dropDownListRow($model, 'category', CHtml::listData(CategoryType::model()->findAll(), 'id', 'name'), array('empty' => 'Select a category')); ?> <?php echo $form->dropDownListRow($model, 'cuisine', CHtml::listData(CuisineType::model()->findAll(), 'id', 'name'), array('empty' => 'Select a cuisine type')); ?> <?php echo $form->textFieldRow($model, 'opening_hours', array('class' => 'span6', 'size' => 60, 'maxlength' => 100)); ?> <?php echo $form->checkBoxListRow($model, 'payment', $paymentMethods); ?> <?php echo $form->dropDownListRow($model, 'attire', CHtml::listData(AttireType::model()->findAll(), 'id', 'name'), array('empty' => 'Select an attire type')); ?> <?php echo $form->dropDownListRow($model, 'ambience', CHtml::listData(AmbienceType::model()->findAll(), 'id', 'name'), array('empty' => 'Select an ambience type')); ?> <?php echo $form->dropDownListRow($model, 'groups_option', array('empty' => 'Select one', 'Yes' => 'Yes', 'No' => 'No')); ?> <?php echo $form->dropDownListRow($model, 'kids_option', array('empty' => 'Select one', 'Yes' => 'Yes', 'No' => 'No')); ?> <?php echo $form->textFieldRow($model, 'website', array('class' => 'span6', 'size' => 60, 'maxlength' => 100)); ?> <?php echo $form->textFieldRow($model, 'menu', array('class' => 'span6', 'size' => 60, 'maxlength' => 100)); ?>
/** * @return string the ambience text display for the current business */ public function getAmbienceText() { $ambienceOptions = CHtml::listData(AmbienceType::model()->findAll(), 'id', 'name'); return isset($ambienceOptions[$this->ambience]) ? $ambienceOptions[$this->ambience] : "-"; }