コード例 #1
0
ファイル: _form.php プロジェクト: nbayteam/restaurant
?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php 
echo $form->errorSummary($model);
?>

	<?php 
echo $form->textFieldRow($model, 'name', array('class' => 'span6', 'size' => 60, 'maxlength' => 100));
?>
	<?php 
echo $form->textAreaRow($model, 'description', array('class' => 'span6', 'rows' => 5));
?>
	<?php 
echo $form->dropDownListRow($model, 'type', CHtml::listData(BusinessType::model()->findAll(), 'id', 'name'), array('empty' => 'Select a type'));
?>
	<?php 
echo $form->textFieldRow($model, 'address', array('class' => 'span6', 'size' => 60, 'maxlength' => 255));
?>
	<?php 
echo $form->textFieldRow($model, 'zipcode', array('class' => 'span6', 'size' => 60, 'maxlength' => 6));
?>
	<?php 
echo $form->textFieldRow($model, 'phone', array('class' => 'span6', 'size' => 60, 'maxlength' => 8));
?>
	<?php 
echo $form->dropDownListRow($model, 'price', CHtml::listData(PriceType::model()->findAll(), 'id', 'name'), array('empty' => 'Select a type'));
?>
	<?php 
echo $form->dropDownListRow($model, 'category', CHtml::listData(CategoryType::model()->findAll(), 'id', 'name'), array('empty' => 'Select a category'));
コード例 #2
0
ファイル: Business.php プロジェクト: nbayteam/restaurant
 /**
  * @return string the type text display for the current business
  */
 public function getTypeText()
 {
     $typeOptions = CHtml::listData(BusinessType::model()->findAll(), 'id', 'name');
     return isset($typeOptions[$this->type]) ? $typeOptions[$this->type] : "-";
 }