Here is the code
In View
In View
$.post('<?php echo Yii::app()->createAbsoluteUrl('controller_name/action_name);?>',{variable_name_in_action :variable_value},function(data)
if(data=='')
{
//do this
}
else{
//do this
}
In Controller
public static function actionAction_name()
{
//you can get varible value here
$variable_name_in_action = $_POST['variable_value'];
}
if(data=='')
{
//do this
}
else{
//do this
}
In Controller
public static function actionAction_name()
{
//you can get varible value here
$variable_name_in_action = $_POST['variable_value'];
}
No comments:
Post a Comment