public static getChildOptionStr ( type $pid, type $level ) : type | ||
$pid | type | |
$level | type | |
return | type |
public static function getChildOptionStr($pid, $level)
{
$optionStr = CHtml::tag('option', array('value' => ''), '请选择');
$cates = self::getCates($pid, $level);
if (!empty($cates)) {
foreach ($cates as $id => $name) {
$optionStr .= CHtml::tag('option', array('value' => $id), $name);
}
}
return $optionStr;
}
public function actionCate() { if (Yii::app()->request->isAjaxRequest) { $pid = Yii::app()->request->getParam('pid'); $level = Yii::app()->request->getParam('level'); echo ARCates::getChildOptionStr($pid, $level); } }