in reply to Templating Systems

I use Embperl instead of some template system. It's simply and flexible tool.

Also, I work sometimes with Mason. In my opinion, it's the best choise for building web applications. There are many features in the Mason. Just try to look at documentation. My favorite pure Perl software - Request Tracker has web interface which was developed on Mason.

      
--------------------------------
SV* sv_bless(SV* sv, HV* stash);

Replies are listed 'Best First'.
Re: Re: Templating Systems
by markexpjp (Novice) on Jul 15, 2003 at 12:17 UTC
    Thanks for your input. I did consider this, and I always think about it, but it really comes down to design philosophy. There are numerous ways to accomplish anything. The reason I don't want to use Mason is that I really really like the idea of separating code and HTML, although, in a sense, template placeholders are code also. I havn't really looked that closely at the documentation for Mason, and I know I should. Thanks for your opinion.

    10POKE53280,A:POKE53281,A
    20?"C64 RULES ";
    30A=A+1:IFA=16THENA=0:GOTO10

      I'm agree with you. It's right conseption to separate code and HTML. But, I think, generally, it's the same to use operators of pseudo-language of template or Perl. In both cases you have code in your html page.

      Implement all logic of your application in the Modules (Classes) and just call methods for retriving some data and display in specified place.

      I don't agitate for Mason or Embperl. I'd like to tell you that those tools useful, power and flexible. You should just look at them more intent. ;-)

      Update: How about performance? In case with template system, you will have two processes of your data for building HTML page: preparetion template data and processing your template.

            
      --------------------------------
      SV* sv_bless(SV* sv, HV* stash);
      

      I personally feel that HTML::Template does the best job of this. While there is some "code" in the template it is more just variable placeholders and some simple boolean logic. There is no real logic or processing power. Which is great because the pretty picture designer guy can figure it out :)

      Lobster Aliens Are attacking the world!
      The reason I don't want to use Mason is that I really really like the idea of separating code and HTML

      Mason allows this but does not require it. There are numerous options for how to organize your code in a Mason site, including the following:

      <html> <head><title><% $title %></title</head> <body> <h1>Welcome to <% $sitename %>!</h1> <p>Our product of the day is <% $daily_product %>.</p> </body> </html> <%init> my $sitename = "Spuds.com"; my $title = "Spuds Home Page"; my $daily_product = get_daily_product(); </%init>

      This doesn't seem to be significantly more confusing than an HTML::Template would be, even for the "pretty picture designer guy" -- they just stay away from the %init block.

      Although you may not need them at first, Mason also has a bunch of additional features that might prove useful at some time in the future... It's powerful enough to support large public sites.