NYCPHP Meetup

NYPHP.org

[nycphp-talk] JSON and MVC

y2rob at aol.com y2rob at aol.com
Wed Jul 22 15:20:28 EDT 2009


i believe this can be done with codeigniter and kohana (it's been a while since i've done this, fyi), but the view is set with the associated data from the called controller method, you probably could leave the set view out and set a header for this call.

i hope this makes sense, if not i can clarify...



~rob

-----Original Message-----
From: Mitch Pirtle <mitch.pirtle at gmail.com>
To: NYPHP Talk <talk at lists.nyphp.org>
Sent: Wed, Jul 22, 2009 1:23 pm
Subject: Re: [nycphp-talk] JSON and MVC








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
>
_______________________________________________
New York PHP User Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/show_participation.php



 




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20090722/40734d79/attachment.html>


More information about the talk mailing list