Fully ajax website problem

I’m building a fully ajax website follow this idea h ttp://tpoxa.com/2011/04/19/fully-ajax-website-with-yii/

But i got an error:


Declaration of EHttpRequest::redirect() should be compatible with that of CHttpRequest::redirect()


E:\wwwroot\ngaymua\protected\components\EHttpRequest.php(4)


 <?php 

 

 class EHttpRequest extends CHttpRequest

 {

  

    public function redirect($url) {

         if(is_array($url) && isset($url[0]))

             $url = $url[0];


        if(Yii::app()->request->isAjaxRequest){

  

            $data = array();

 

            if(Yii::app()->user->hasFlash('updatedata')) {

                $flashdata = Yii::app()->user->getFlash('updatedata');        

                $data = $data + $flashdata;    




I added


'request'=>array(

                     'class'=>'EHttpRequest',

               ),

to config file.

I can not figure where is the problem.

Thanks for any idea.

I’m not sure if it’s going to help but try to change


public function redirect($url)

to


public function redirect($url,$terminate=true,$statusCode=302)

You either do as viter or set your php_error reporting to something else than E_STRICT

Hello Everyone ,

I have Successfully made my Ajax Website .

I Did it by Following the two tutorials Given By Tpoxa.

Cheers to Him :D

Now my problem is That , i am not able to change the Url Structure of my Site.

Its something like this :

projectname/#url=/projectname/news/index

Now my desired Url is something like this :

projectname/#!/projectname/news/index

In Short , i just want to repalce «#url=» with «#!»

Please Help

Thanks in Advace :)

lavket, did you ever figure this out? I’ve been stumbling on this for 2 days. =/ Would appreciate your help if you solved it.

Yes i have. Sorry for the late reply. Sorry i don’t have the code now, let me know if you have still not figured out to change URL in AJAX, i will post the code.

Anyone who needs any help with AJAX website, please post your queries here. I have been part of developing a complete AJAX website in YII. Will be happy to help.

Cheers!! :)

Hi lavket, I followed the same tutorial, can you post the code for change URL in AJAX, please? Furthermore, when I load a view with Cgridview widget, after that I filter some columns the grid disappears! :o can you help me?