$.ajax({
url: base_url + '/post/',
dataType: "json",
data: {'id': id},
success: function (response) {
...
}
});
$.ajax({
url: base_url + '/post/' + id,
dataType: "json",
success: function (response) {
...
}
});
$js = 'var myUrl = "' . Yii::app()->createUrl('bla/bla/bla', array('id' => 'REPLACE_HERE')) . '";';
Yii::app()->getClientScript()->registerScript('carramba', $js, CClientScript::POS_HEAD )
var realUrl = myUrl.replace('REPLACE_HERE', id);