more useful options | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I think you're seriously overestimating the amount of programming involved in the templates in Petal. It's deliberately designed to stop you from doing anything more than substitutions, loops over an array and conditionals. It is not a turing complete language. As for the mini-language for manipulating references, the only rule for the language is / means go down another level so a/b/c is $h->{a}->{b}->{c}. It hardly deserves the name mini-language. Imagine a page with 20 variables. The templates look almost exactly the same for Petal and Seamstress but Seamstress also requires 40 almost identical lines of Perl to find the ids and replace them. This means that each ID tag has to appear twice, once in the template and once in your Perl, plenty of opportunity for typos. Lets say you decide that your template should display a field that was previously omitted. Now you have to change your template _and_ add 2 more lines of Perl to make sure it gets replaced. I don't like mini-languages either but I would quickly become bored writing a find line and a replace line for each datum. I'd probably decide on a convention for the id tags so that the the id taq can be interpreted as a path down into a hash of data. At which point I'd have basically invented the main part of TAL. Mini-languages are bad but I'll take a small, tight mini-language any day over lines and lines of cookie cutter coding. In reply to Re^5: Survey of Surveys on HTML Templating systems
by fergal
|
|