Пример #1
0
<?php

$this->breadcrumbs = array(Yii::t('weekdays', 'Weekdays') => array('index'), Yii::t('weekdays', 'Manage'));
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'jobDialog', 'options' => array('title' => Yii::t('weekdays', 'Create Job'), 'autoOpen' => true, 'modal' => 'true', 'width' => 'auto', 'height' => 'auto')));
?>
                
<?php 
echo $form->dropDownList($model, 'item_type_id', CHtml::listData(ItemType::model()->findAll(), 'id', 'type'), array('empty' => 'select Type'));
?>
				
<?php 
$this->endWidget('zii.widgets.jui.CJuiDialog');
Пример #2
0
?>
",
                        dataType: 'html',
                        success: function(results)
                        {
                            $("#item_prop_values").empty();
                            $(results).appendTo("#item_prop_values");
                        }
                    });
        }
    });
</script>

<?php 
$cri = new CDbCriteria(array('condition' => 'enabled = 1'));
$ItemType = ItemType::model()->findAll($cri);
$list = CHtml::listData($ItemType, 'type_id', 'name');
echo $form->DropDownListRow($model, 'type_id', $list, array('empty' => '请选择商品类型', 'hint' => '请选择商品的所属类型,进而完善此商品的属性'));
//$props_list = Item::model()->findByPk($model->item_id);
//$props_arr = explode(';', $props_list->props);
//foreach ($props_arr as $k => $v) {
//    $newarr[] = explode(':', $v);
//}
//foreach ($newarr as $k => $v) {
//        $v_arr = explode(',', $v[1]);
//        $arr[$v[0]] = $v_arr;
//}
//print_r($arr);
?>