When I started to play with MVC, having CGI::Application as a tool, I used this approach: Any runmode was my controller, I made another class-model which interacted with DB and returned raw data - array of hashrefs. I made another class-view which got the raw_data and reorganized that into some structure, that was turned to JSON string. After all, controller got that stuff from view and returned it back to web client. So view did all the job to rearrange model-given raw data and turn it json. Okay. Now I am trying to get understanding of Catalyst. Here I have to restructure raw data somewhere else, stash it, and forward all that mess to Catalyst::View::JSON. The question: WHERE I should rearrange/restructurize raw data if there are no any additional calculations planned, but simply preparing data for some jQuery widget in the end. I doubt it must be done in model or controller. What you think?

In reply to Catalyst. View. How to use? by tercoz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.