Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I don't have a lot of expierence with web development, but sometimes it's the best means to and end. I'm currently retrofitting an existing web based tool to use HTML::Template and by the end of the week I'm going to start working on converting it to use CGI::Application. I'm also working on a project that's in the planning phase where I'll be using HTML::Template and CGI::Application.

My question has to do with the strcutre of the application. I'm pretty anal about things being "clean", and I always feel like my web apps get out of hand. I have to do some redesign around how the content is printed to work with CGI::Application because I create and print different sections at different points in the app. For instance, the top title/header area is generated in one location and the left side panel is generated in another. Now this won't work with CGI::Application because I need to return the entire content from the method call. Now this lead me to this question..

How do people normally generate the different sections of content? It seems to me that I now have two options. I can either "templatize" the entire page (top, left and the main content) for each different "mode", or I can have each "mode" call fuctions that return strings that contain the top and left and then tie up the footer and closing div/table/html tags.

Neither way seems all that "clean" to me and leaves me feeling that I'm missing a better, "cleaner" way to make the logic flow and be more readable.

I'd appreciate any feedback. Also, if this would more approptriatly fit in Meditations, feel free to move it. I wasn't sure where it would be better.


In reply to HTML::Template, CGI:Application and design methodologies by rchiav

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 sharing their wisdom with the Monastery: (6)
As of 2024-03-28 15:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found