NYCPHP Meetup

NYPHP.org

[nycphp-talk] JSON and MVC

Mitch Pirtle mitch.pirtle at gmail.com
Tue Jul 21 13:17:18 EDT 2009


Took the same approach with Jooma 1.5, although there is a little more
work to it ;-)

-- Mitch

On Tue, Jul 21, 2009 at 1:08 PM, Nate Abele<nate at cakephp.org> wrote:
> On Mon, 20 Jul 2009, Hans Zaunere wrote:
>
> I think this really begs some questions on current server-side frameworks
>
> and the MVC methodology.  Changes like this have already begun, namely in
>
> RoR and other platforms.
>
> In Cake 3.0 we have a class called Media
> (http://code.cakephp.org/cake3/source/libraries/cake/http/Media.php#47) that
> sits between the controller and view layers.  Instead of worrying about
> context switching, you can attach handlers that work across your whole
> application, and respond for each different media type.  Handlers can be a
> specific view class (the default, as in the case of HTML, etc.), a reference
> to a class method or function (i.e. "json_encode" for JSON) or a closure
> where you can define custom rules or transformations.
> The great
> thing is, while handlers can be overridden on a case by case basis, once they're attached, you never need to think about them again, they just work; and all the switching
> logic is kept out of your controller.
>
> - Nate Abele
>   Lead Developer, CakePHP
>
> _______________________________________________
> New York PHP User Group Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> http://www.nyphp.org/show_participation.php
>



More information about the talk mailing list