Here, the first argument is the name of the HTML element that is generated, the second argument sets the default value and the third argument is an associative array of items.
// Setting HTML options $options = array('prompt'=>'Select a value'); echo CHtml::dropDownList('list', $selected, $data, $options);
This example shows how to add HTML options to the drop-down list. Here, the prompt option adds a default text as the first item in the list.
This example shows how to add custom HTML attributes to the generated HTML element. Here, the size and multiple attributes are added to the select tag.
Overall, CHtml dropDownList is a part of Yii's CHtml package library which provides a set of HTML helpers for generating HTML tags and form elements with ease.
PHP CHTml::dropDownList - 1 examples found. These are the top rated real world PHP examples of CHTml::dropDownList extracted from open source projects. You can rate examples to help us improve the quality of examples.