本文整理汇总了PHP中Department::departmentOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP Department::departmentOptions方法的具体用法?PHP Department::departmentOptions怎么用?PHP Department::departmentOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Department
的用法示例。
在下文中一共展示了Department::departmentOptions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
echo $form->labelEx($model, 'student_info');
?>
<?php
echo $form->textArea($model, 'student_info', array('rows' => 6, 'cols' => 50));
?>
<?php
echo $form->error($model, 'student_info');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, '相应院系');
?>
<?php
echo $form->dropDownList($model, 'major_id', Department::departmentOptions(), array('name' => 'department_id'));
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'major_id');
?>
<?php
echo $form->dropDownList($model, 'major_id', array(), array('class' => 'width140', 'id' => 'major_id'));
?>
<?php
echo $form->error($model, 'major_id');
?>
</div>
示例2: array
echo $form->labelEx($model, 'major_info');
?>
<?php
echo $form->textArea($model, 'major_info', array('rows' => 6, 'cols' => 50));
?>
<?php
echo $form->error($model, 'major_info');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'department_id');
?>
<?php
echo $form->dropDownList($model, 'department_id', Department::departmentOptions());
?>
<?php
echo $form->error($model, 'department_id');
?>
</div>
<div class="row buttons">
<?php
echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
?>
</div>
<?php
$this->endWidget();
?>