> Let me see if I understand this correctly, the built-in webservices is
> an advanced routing feature that will translate an address of
> http://example.com/xml/controller/action/ to a particular controller,
> and action of controller::xml_action().

For the most part, yeah, the current web services stuff is just routing
enhancements.

> For this example, I would then have to create the xml by using DOM and
> then output that xml to the client. For each function that I would want
> to turn into a web service, I would create a new function in its
> controller, and implement the web service by hand.

If you want to do it the long way, I guess.  What I usually do is not
use the routes at all, but something more like:

function beforeFilter( ) {
    if ($this->RequestHandler->accepts('rss')) {
       $this->viewPath .= '/rss';
    }
}

Then, just create an rss folder within your view templates folder, so
if I have a controller called EventsController, the full view path
would be /app/views/events/rss.

Then, just create one new template for each action.  If you code your
views efficiently, you shouldn't have to add or change any controller
code other than the above.

Also, I've never understood this thing with server-side DOM for XML
output.  Why not just write a template the same as you would for an
HTML page?


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

Reply via email to