Hi Grant,

Let me show You some sweet features of CakePHP 1.2, please...

1. CakePHP 1.2 can parse 'file extensions' in url so RequestHandler
component can send proper headers and also customize helpers, viewPath
and layoutPath properties of controller. By the other words: if Your
ajax request will call url example.com/posts/index.js, it will look
for view posts/js/index.ctp (and switch layout and add JsHelper to
$helpers). Only thing You have to do is call
Router::parseExtensions(); in app/config/routes.php (it is better call
it with 'some' arguments, see api) and add 'RequestHandler' to
AppController::$components (or to all related controllers). This is
preferred way how to obtain rss, xml, json, wml etc from Your
application.

2. You can also call some RequestHandler methods in Your
AppController::beforeFilter() so RequestHandler can send any custom
header for any custom 'file extension'

3. Themed views: another way how to let CakePHP customize paths for
rendered content (with fallback to obvious file locations)

4. Rendering of flash messages: helpers now have 2 callbacks:
beforeRender() and afterRender(). So Your custom helper can use
session helper internally and customize returned output also.

With above features in mind, there may be some need for implementation
of AppController::redirect(), AppController::flash() or
AppController::beforeFilter/Render(), off course, maybe along with
some custom helper (it depends on ajax toolkit which You're using).

What I'm trying to say is maybe better explained at link that someone
(I think it was gwoo) posted some time ago: 
http://slash7.com/assets/2007/2/12/layercake.png

Code of Your controller shouldn't be most fat part of Your cake, so
controllers should be written so they can work with any interface that
You will create for them. Sure, You will maybe create some
controller's methods just for some fancy XHR things, but most of
changes should be in 'V' part of cake's MVC. Just my 0.02 :)

Regards, Jitka


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