ajith
(Ajith Tejas)
1
i have the following code in yii1
<?php
echo CHtml::ajaxLink('School', Yii::app()->createUrl( 'product/getproduct/cat/school'),
array('update' => '#desc')
);
[size=2]?>[/size]
[size=2]
[/size]
[size=2]how can i convert it into yii2. here i have used ajax call i need to convert this into equivalent yii2 code [/size]
[size=2]thanks
[/size]
There isn’t an ajaxlink anymore you have to do it the good old fashion way with a sprinkle of yii2.
Html::a('School',FALSE, ['onclick'=>"
$.ajax({
type :'POST',
url :'product/getproduct/cat/school',
success : function(response) {
$('#close').html(response);
}
});return false;",
]);
This won’t work but I have no clue what your trying to do so all I can do is put a reference example. Ajust it accordingly
'onchange' => '$.post("index.php?r=controllername/actionname",
function (data) { $("#div").append();
});'