Example #1
0
 /** use at BE
  * @Author: ANH DUNG Apr 07, 2014
  * @Todo: build html select 
  */
 public static function getDropDownList($name, $id, $value = '', $hasEmpty = false, $classSelect = null)
 {
     $criteria = new CDbCriteria();
     $criteria->order = 'parent_id ASC, name asc';
     $menus = ProPropertyType::model()->findAll($criteria);
     $strSelect = '<select  class="' . $classSelect . '" name=' . $name . ' id=' . $id . '>';
     if ($hasEmpty) {
         $strSelect .= '<option value="">Select</option>';
     }
     $strSelect .= ProPropertyType::oMenu(0, $menus, $value);
     $strSelect .= '</select>';
     return $strSelect;
 }