NYCPHP Meetup

NYPHP.org

[nycphp-talk] JSON and MVC

Mitch Pirtle mitch.pirtle at gmail.com
Wed Jul 22 13:23:24 EDT 2009


Agreed - and Joomla does it by allowing you to assign the view as the
document type. For example, you can create different views for html,
rss, json output. As well, you can just output directly from the
controller and exit.

Been too busy with work to play with all the other frameworks out
there, wanting to take a look at the new Zend framework as well as
kohana. Wondering how all the other frameworks tackle this issue.

-- Mitch

On Wed, Jul 22, 2009 at 9:51 AM, Paul A Houle<paul at devonianfarm.com> wrote:
>   I'd say that practically frameworks need to have some way to disable the
> "view" layer,  at least the HTML templates,  to let a controller output raw
> data.
>
>   In my experience,  for instance,  business applications often need to
> output csv or xls so that people can load content into a spreadsheet.  Often
> you want to be able to format (nearly) the same content in different ways.
>
>   I'm working on a public facing app that's oriented towards the semantic
> web;  all pages are available in HTML,  RDF/NT and RSS formats.  Content is
> ~almost~ the same,  but not quite.  HTML output is paged in order of
> relevancy/quality (the page on topic X shows the top N content items related
> to topic X;)  RDF format offers a unpaged dump of triples related to topic X
> (all of the triples that come from traversing the relationship tree coming
> from X in a specified way);  RSS offers a limited number of items ordered by
> recency -- people can subscribe to a page via RSS and get updated when new
> content gets added.
>
>   The framework involves a certain amount of codesign between models,  views
> and controllers -- it's designed to produce a family of related sites with
> high reuse,  not to be a system for building general business apps like
> Rails/Symfony/Cake...
>
>   Administrative functions (editing content) are implemented in an
> AJAX-heavy manner,  where the role of "MVC" is quite different from
> traditional.  Layout templates aren't as important as a in conventional
> webapp,  since we're not redrawing the page each time.   However,  in an
> AJAX application,  the framework still must handle authentication for
> requests,  and also needs to have a systematic way to bolt in business rules
> and handle violations.
>
> _______________________________________________
> 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