activeDropDownListControlGroup() public static method

Generates a control group with a drop down list for a model attribute.
See also: self::activeControlGroup
public static activeDropDownListControlGroup ( CModel $model, string $attribute, array $data = [], array $htmlOptions = [] ) : string
$model CModel the data model.
$attribute string the attribute.
$data array data for generating the list options (value=>display).
$htmlOptions array additional HTML attributes.
return string the generated control group.
Exemplo n.º 1
0
 public function testActiveDropDownListControlGroup()
 {
     $I = $this->codeGuy;
     $html = TbHtml::activeDropDownListControlGroup(new Dummy(), 'dropdown', array('1', '2', '3', '4', '5'));
     $group = $I->createNode($html, 'div.control-group');
     $controls = $group->filter('div.controls');
     $I->seeNodeChildren($controls, array('select'));
 }
Exemplo n.º 2
0
 /**
  * Generates a control group with a drop down list for a model attribute.
  * @param CModel $model the data model.
  * @param string $attribute the attribute name.
  * @param array $htmlOptions additional HTML attributes.
  * @return string the generated row.
  * @see TbHtml::activeDropDownListControlGroup
  */
 public function dropDownListControlGroup($model, $attribute, $data, $htmlOptions = array())
 {
     $htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
     return TbHtml::activeDropDownListControlGroup($model, $attribute, $data, $htmlOptions);
 }