有一个区域列表。选择区域时,需要生成该区域的城市列表。我向控制器发送请求site/get_cities,为了形成这个特定区域的列表,我也尝试发送该id区域。但是我不知道用什么来代替问号?
Html::dropDownList(
'region',
$region,
ArrayHelper::map($regions_dropdownlist,'id','name'),
[
'prompt' => 'Все регионы',
'onchange' => '$.post(
"'.Yii::$app->urlManager>createUrl(["site/get_cities", "id" => ??????]).'",
function( data ) {
alert(data);
}
)'
]
)
As a result, I want to create two selects, when choosing a region, a list of cities is formed in the second select.
这样决定