Yii Framework Forum: prompttext in dropdownlist - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

prompttext in dropdownlist Rate Topic: -----

#1 User is offline   ilzale 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 113
  • Joined: 08-October 08

Posted 16 October 2008 - 06:12 AM

finally it was available in prado as a property of the object. I haven't found it in yii.

which is your solution?
0

#2 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,871
  • Joined: 04-October 08
  • Location:DC, USA

Posted 16 October 2008 - 07:00 AM

Please check CHtml::listOptions
0

#3 User is offline   ShabbyRobe 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 13-October 08

Posted 16 October 2008 - 08:08 AM

This is how you do it:

<div class="simple">
<?php echo CHtml::activeLabel($artist,'artistType'); ?>
<?php echo CHtml::activeDropDownList($artist,'artistType',array("item1","item2"),array("prompt"=>"pants")) ?>
</div>

But there's a slight bug with it. I have created a ticket here.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users