phreak
(Phreak)
April 16, 2009, 4:03pm
1
I am creating the link like that:
echo CHtml::ajaxLink('Create new', $this->createUrl('Admin/Section', array('new'=>'1')), array('update'=>'#form'));
in the Admin controller when I check Yii::app()->request->isAjaxRequest it is always false. Any Ideas why ?
phreak
(Phreak)
April 17, 2009, 6:05am
2
I'm using NuSphere PHPed and its internal webserver for development and debugging, is it possible this to be the problem ?
system
(system)
April 17, 2009, 2:50pm
3
Quote
I'm using NuSphere PHPed and its internal webserver for development and debugging, is it possible this to be the problem ?
You should check if the $_SERVER['HTTP_X_REQUESTED_WITH'] super-global is correctly set by you webserver, otherwise it wont work.
phreak
(Phreak)
April 17, 2009, 2:58pm
4
I've checked it, and its not set correctly. It is null. Does anyone know how to work around this issue ?
system
(system)
April 18, 2009, 4:28pm
5
Quote
I've checked it, and its not set correctly. It is null. Does anyone know how to work around this issue ?
Maybe you could add some special get parameter to your ajax request ('isAjax'=>true for example) and check if it is set in your related controller.
phreak
(Phreak)
April 19, 2009, 12:08pm
6
Well, in my production system there is not such problem, but that’s makes debuggin while development harder and annoying. May be I’ll install local apache with debuggin extension on my comp and will stop using the internal server(it’s very convinient though ) or i’ll set extra get parameter like @juban suggested.