Possible solution for cake 1.2 could be:

a) in AppController var $components = array('RequestHandler');

b) in AppController::beforeRender() switch theme in dependency of
result of $this->RequestHandler->isMobile()

c) let router parse extensions by call Router::parseExtensions() in
app/config/routes.php

That's all. Now:

a) requests from mobile devices can be rendered with theme another
then default

b) you can call your actions like example.com/controller/action.xml
(or any other supported or user-defined content type extension) and
browser will obtain proper headers and rendered content will use
layout and view from 'xml' subfolder (if proper views/layout exist)

For 1.1 you should use ThemeView from cakeforge.org (in 1.2 it is in
core) and either use 1.1 cake's built-in webservices support, or parse
$this->params['url']['url'] for extension, alter $this->layoutPath and
$this->viewPath in controller and send proper headers from layouts for
non-html content types.

I am sure there are another ways how to solve your problem, but this
is way I am using.



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