-1

ドロップダウンを作成しようとしていますが、今のところ表示したくないので、ここにコードを示します。

<div class="row">
    <?php echo $form->labelEx($model,'lang_id'); ?>
    <?php echo $form->dropdownlist($model,'lang_id',CHtml::listData(Lang::model()->findAll(), 'id', 'name')); ?>
    <?php echo $form->error($model,'lang_id'); ?>
</div>

どうすればこれtype = 'hidden'またはそのようなものを作ることができますか?

つまり、フィールドを保持したいのですが、表示したくないのです。

4

2 に答える 2

6

これを試して..

<div class='row' style='display:none'>
于 2012-05-28T11:24:28.000 に答える
5

また、dropDownListのスタイル属性を定義することもできます。

public static string dropDownList(string $name, string $select, array $data, array $htmlOptions=array ( ))

あなたはで試すことができます:

<div class="row">
    <?php echo $form->labelEx($model,'lang_id'); ?>
    <?php echo $form->dropDownList($model,'lang_id',CHtml::listData(Lang::model()->findAll(), 'id', 'name'), array('style' => 'display: none'); ?>
    <?php echo $form->error($model,'lang_id'); ?>
</div>
于 2012-05-28T13:56:13.733 に答える