On Jan 30, 1:03 pm, "quincy" <[EMAIL PROTECTED]> wrote:
> Hey,
>
> Thanks for the pointers.  After some confusion and searching here i
> have overwritten the redirect() function in AppController like so: -
>
> class AppController extends Controller {
>
>         var $components = array("RequestHandler");
>
>         function redirect($url) {
>                 if($this->RequestHandler->isAjax()) {
>                         echo "got here";
>                         $this->requestAction($url, array("ajax"));
>                         exit(0);
>                 } else {
>                         parent::redirect($url);
>                         exit(0);
>                 }
>         }
>
> }But this doesn't seem to have helped, and firebug spits back the
> request at me with "got here" but not the page i have requested with
> the requestAction($url).  I really have no idea what else to try, I
> was convinced that the re-written redirect() would have it covered as
> it is mentioned many times around here, but still something is wrong.
>
> Oddly enough if i type the url i wanted to redirect to in the address
> bar directly after the failed redirect, the action has definately been
> called as it has correctly set my session data and displays the page
> with the "xyz is logged on".  So its calling the action but not
> rendering the page it seems.
>
> Help!!

Hi Quincy,

If you are not seeing the text "Got here" somewhere on the PAGE, you 
still need to ensure $options['update'] contains the name of something 
to update. Otherwise what you can deduce from firebug is that you 
received a response (so you got that far), with wich you have 
specified to do nothing (or not specified to to anything :) ) with.

In the code above you are missing "echo" before requestAction and 
"array('return')" as a second parameter. You want to echo the result 
of rendering the requestActoin call not just execute the controller 
method. More details on that in the manual/api, here's an example to 
copy paste, the extra logic is primarily to ensure the ajax layout is 
used, but if you haven't got anything funky in it, you can just stick 
with echo reqeustAction.
https://cakeforge.org/plugins/scmsvn/viewcvs.php/branches/standalone/
plugins/acl_admin/generic_controller.php?rev=13&root=acl-
admin&view=markup

HTH,

AD7six
Please note:
The manual/bakery is a good place to start any quest for info.
You may get your answer quicker by asking on
the IRC Channel (you can access it with just a browser
here:http://irc.cakephp.org).



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to