Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

First of all, you shouldn't do that.

You are coupling controller, view and model logic in your controller action. You shouldn't "prepare things for the view" in the controller, but rather just "prepare the context for the view". That meaning, if you're in a inner context (such as one individual customer), the controller should set this up. But NEVER build data structures that are specific for one view.

You should use more of the TT programming language for such things. In a lot of cases, your controller action will be just empty, because context was defined in an earlier chained action, and you just need to dispatch to one specific view (most of the time, to one specific template).

That means that you are going to do a lot of "search" calls directyly in your template, but THAT'S OK!!. That's how MVC is supposed to be, remember. It's not a layered schema, it's a triangle.

    M
    ^^
   /  \
  V<---C

Which means, the model is accessed both by the controller and the view, and the controller just dispatches to the view. It is very important that you do not couple the controller to the view, otherwise, implementing an alternative view (RSS, ATOM, email) will be very hard.

daniel

In reply to Re: How to organize Catalyst stash by ruoso
in thread How to organize Catalyst stash by roman

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-24 05:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found