Okay here is the situation, I am working on a "Ticketing" website that
I have already created in the "old" method of making websites (not
CakePHP).  I am redoing it now using CakePHP and I love it.  Here is
my problem.  On the old site, I built out the layout of the theatre
using a table with each seat being represented by a td cell.  Each td
cell had an onclick event that called my own code that either
"reserved" or "released" the selected seat by an AJAX call.  My AJAX
call would return a value, '1','2', or '0' denoting "success",
"failure", or "arleady taken" to my javascript function.  I would then
move on based on that response:

var response = oXmlHttp.responseText;
switch (response.charAt(0)) {
        case '0':
               // Alert that seat was already taken
               break;
        case '1':
                // Success
                break;
        case '2':
                // Alert Error
                break;
}

I have re-written this code using Prototype and can make the call to
Controller/reserve . BUT.... 1. I have to create a useless "view" for
this controller action and 2. I can't return a value of either 1,2, or
0.  If I echo any of those characters the response text contains the
entire "view" listing with "headers already sent" error.  If I try to
return any of those values it returns the entire view.

Is there a way to call a controller action without needing a view?  Is
there a way to return a value from the controller action like I need
1,2, or 0?

There are many actions that need to happen based on which return value
I get from my AJAX call so it has to happen this way.  The AJAX helper
only appears to follow the form of SAVE then UPDATE and that is not
enough.

There has to be a way to do this without doing it the old way of
making a call to a single script sitting in the document root.    I am
still very new to Cake so if this could be solved by something like a
Component or something I would greatly appreciate some direction.
Redoing this site with Cake has been fantastic and I have rolled right
along up to this point, but I have stalled out.

Please help!

Daniel


--~--~---------~--~----~------------~-------~--~----~
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