I don't understand what you mean about options['update'], this is 
something i would set in an Ajax link but i have no idea how it 
relates to redirecting!!  I was under the impression that 
options['update'] is only relevant ajax helper functions and i'm not 
using any.

I just tried doing this:

function redirect($url, $status = null) {
        f($this->RequestHandler->isAjax()) {
                echo "got here";
                echo $this->requestAction($url, array("return"));
                exit(0);
        } else {
                parent::redirect($url);
                exit(0);
        }
}

And i'm still not getting any joy here.  I understand that 
requestACtion()is supposed to return the actual output of the action/
view as it were, but its getting confused somewhere as firebug is 
telling me the response of me echoing this is a big lot of gibberish 
and not a lovely HTML page as required!!

if i deliberately login with wrong password, the response is the 
correct login page with error message, but its not displaying it!!  
Whereas if i login correctly the response is the mad gibberish.  COuld 
this be to do with the fact that the p[age i redirect to has Ajax 
stuff on it, wheres as the login page doesn't?

My head hurts!



On Jan 30, 12:37 pm, "AD7six" <[EMAIL PROTECTED]> wrote:
> 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