Ajax Parameters Aren't Sent With Ajaxlink

Hey guys, im having quite of a bad time here. I’m using flowing calendar and i’m extending part of it’s functionallity to suit my needs…

basic logic:

calendar, next and previous buttons refresh months through ajax and not reloading the site.

/extensions/flowing-calendar/views/flowingCalendar




$this->storePreviousLink = CHtml::ajaxLink(

                                    "<<",

                                    Yii::app()->createUrl('evento/updateCalendar', <-CONTROLLER

									array(

										'type'=>'POST',

                                        'data'=>array('month'=>$this->previousMonth,'year'=>$this->yearPreviousMonth),

                                        )), // Yii URL

                                    array('update' => '#CalendarArea') // jQuery selector

									

 

                           );

AND MY CONTROLLER:




public function actionUpdateCalendar(){

			

            if (isset($_POST['month'])){

				$mes = $_POST['month'];

				$anyo = $_POST['year'];

                $this->widget('ext.flowing-calendar.FlowingCalendarWidget', array("month"=>$mes, "year"=>$anyo));

            }else{

                $this->widget('ext.flowing-calendar.FlowingCalendarWidget', array("month"=>2, "year"=>2014));

            }

			Yii::app()->end();

        }



so basically when i click the next or prev button of the calendar, should switch between months, but my controller ain’t receiving any POST parameters. the refresh works good because it’s rendering february 2014. but there’s no way it can receive POST[month] or POST[year]…

what can i be doing wrong or what other coice do i have?

i’m quite a noob at Yii and Ajax

Thx in advantage

Finally got it working! turned out to be just a syntax thing… if anyone is having something like this…

Controller




 public function actionUpdateListaEventosDia(){

           if (isset($_POST['dia']) && isset($_POST['mes']) && isset($_POST['anio'])){

                $dia = $_POST['dia'];

                $mes = $_POST['mes'];

                $anio = $_POST['anio'];

                $usuario = Usuario::model()->getUsuarioSession();

                $datos = $usuario->getEventosDelDia($dia,$mes,$anio);

                $this->renderPartial('_listaDia',array('eventos'=>$datos));

            }else{

                $this->renderPartial('_crearEvento');

            }

        }



AJAX LINK




$dia = CHtml::ajaxButton(

                                        $list_day,

                                        Yii::app()->createUrl('evento/updateListaEventosDia'),

                                                array(

                                                    'type' => 'POST',

                                                    'data' => array(

                                                        'dia' => $list_day,

                                                        'mes' => $this->month,

                                                        'anio' => $this->year,

                                                        ),

                                                    'update' => '#loadWidget',

                                                    ),

                                                array(

                                                    'href' => Yii::app()->createUrl('evento/updateListaEventosDia'),

                                                )

                                        );



ajax link syntax:

CHTML::ajaxlink (

1.- name

2.- url to create or action to ejecute

3.- ajax options (type, update, data, success, beforeSubmit… and so on)

4.- html options (id, href, method, …)

)

problem was that i’ve been declaring “update” attr inside HTML options…

can you pls show your _listaDia and _crearEvento files inside, really need it, thx.