in reply to Re^4: Output should have multiple segments
in thread Output should have multiple segments

If the structure of your desired output requires two data structures, you create them.

For me that's not a good reason for moving program logic into the template.

If you're not convinced, think of what happens when you chose to add more views. There are plenty of possible output formats, like html, xml, pdf, json, yaml, plain text, ... - would you really want to duplicate code for all of those templates?

  • Comment on Re^5: Output should have multiple segments

Replies are listed 'Best First'.
Re^6: Output should have multiple segments
by Jenda (Abbot) on Jul 16, 2008 at 22:36 UTC

    So it is a good reason for moving display logic into the controler, right? The fact that the HTML format requires that some part of the stuff produced by the template has to end up in the <head> is an HTML-specific implementation detail, not something that the controler needs or even should know about. Exactly because of the many possible output formats I should not polute the controler with stuff required by the implementation specifics of one of the output formats.