Ajax Widget Counter Problem

Hello comunity of yii, glad to programm on this great framework.

i got a problem with ajax

so i need widget with variable witch will increase on 1 on every ajax request, but it increase on 1 only on first request.

my controller

public function actionAjaxTest() {


$this->renderPartial('application.widgets.views.test',array('params' => array('value'=>$valuetestcontr)));



class TestWidget extends CWidget {

public $params = array(



public function init() {


public function run() {

$valuewidg = $this->params['value'] + 1;


$valuewidg = $this->params['value']+2;

$this->render('test',array('params' => array('value'=>$valuewidg)));



view of widget


$valuetest=$params['value'] + 1;

echo '<div id=ajaxtest> value = '. $valuetest; 

echo CHtml::ajaxLink(

'<i class="icon-chevron-left"></i>',

Yii::app()->createUrl(Yii::app()->controller->id . '/ajaxTest'), //<-CONTROLLER




'value' => $valuetest,


'update' => '#ajaxtest'



echo '</div>';

and widget call in controller view

$this->widget('testWidget', array('params'=>array('value'=>1)));

i stucked with it from july, need to finish till NY, so will be glad on any response, thx.

increase it by session in ajax controller’s action

thx for your suggestion, i don’t made any session in project for now, will read about it.

i think i need more simple way to made it with only _GET or it’s impossible? so i need to have in GET variable $var+1 and not $defaultvar on widget start.

i need somthing like this to get it work